ibm_watson 1.6.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.31.0-902c9336-20210504-161156
18
+ #
17
19
  # The IBM Watson™ Assistant service combines machine learning, natural language
18
20
  # understanding, and an integrated dialog editor to create conversation flows between your
19
21
  # apps and your users.
@@ -27,7 +29,6 @@ require "json"
27
29
  require "ibm_cloud_sdk_core"
28
30
  require_relative "./common.rb"
29
31
 
30
- # Module for the Watson APIs
31
32
  module IBMWatson
32
33
  ##
33
34
  # The Assistant V2 service.
@@ -35,21 +36,14 @@ module IBMWatson
35
36
  include Concurrent::Async
36
37
  DEFAULT_SERVICE_NAME = "assistant"
37
38
  DEFAULT_SERVICE_URL = "https://api.us-south.assistant.watson.cloud.ibm.com"
39
+ attr_accessor :version
38
40
  ##
39
41
  # @!method initialize(args)
40
42
  # Construct a new client for the Assistant service.
41
43
  #
42
44
  # @param args [Hash] The args to initialize with
43
- # @option args version [String] The API version date to use with the service, in
44
- # "YYYY-MM-DD" format. Whenever the API is changed in a backwards
45
- # incompatible way, a new minor version of the API is released.
46
- # The service uses the API version for the date you specify, or
47
- # the most recent version before that date. Note that you should
48
- # not programmatically specify the current date at runtime, in
49
- # case the API has been updated since your application's release.
50
- # Instead, specify a version date that is compatible with your
51
- # application, and don't change it until your application is
52
- # ready for a later version.
45
+ # @option args version [String] Release date of the API version you want to use. Specify dates in YYYY-MM-DD
46
+ # format. The current version is `2020-09-24`.
53
47
  # @option args service_url [String] The base service URL to use when contacting the service.
54
48
  # The base service_url may differ between IBM Cloud regions.
55
49
  # @option args authenticator [Object] The Authenticator instance to be configured for this service.
@@ -58,10 +52,10 @@ module IBMWatson
58
52
  def initialize(args = {})
59
53
  @__async_initialized__ = false
60
54
  defaults = {}
61
- defaults[:version] = nil
62
55
  defaults[:service_url] = DEFAULT_SERVICE_URL
63
56
  defaults[:service_name] = DEFAULT_SERVICE_NAME
64
57
  defaults[:authenticator] = nil
58
+ defaults[:version] = nil
65
59
  user_service_url = args[:service_url] unless args[:service_url].nil?
66
60
  args = defaults.merge(args)
67
61
  @version = args[:version]
@@ -94,6 +88,8 @@ module IBMWatson
94
88
  def create_session(assistant_id:)
95
89
  raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
96
90
 
91
+ raise ArgumentError.new("version must be provided") if version.nil?
92
+
97
93
  headers = {
98
94
  }
99
95
  sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "create_session")
@@ -132,6 +128,8 @@ module IBMWatson
132
128
  def delete_session(assistant_id:, session_id:)
133
129
  raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
134
130
 
131
+ raise ArgumentError.new("version must be provided") if version.nil?
132
+
135
133
  raise ArgumentError.new("session_id must be provided") if session_id.nil?
136
134
 
137
135
  headers = {
@@ -159,7 +157,7 @@ module IBMWatson
159
157
  #########################
160
158
 
161
159
  ##
162
- # @!method message(assistant_id:, session_id:, input: nil, context: nil)
160
+ # @!method message(assistant_id:, session_id:, input: nil, context: nil, user_id: nil)
163
161
  # Send user input to assistant (stateful).
164
162
  # Send user input to an assistant and receive a response, with conversation state
165
163
  # (including context data) stored by Watson Assistant for the duration of the
@@ -178,12 +176,24 @@ module IBMWatson
178
176
  #
179
177
  # **Note:** The total size of the context data stored for a stateful session cannot
180
178
  # exceed 100KB.
179
+ # @param user_id [String] A string value that identifies the user who is interacting with the assistant. The
180
+ # client must provide a unique identifier for each individual end user who accesses
181
+ # the application. For user-based plans, this user ID is used to identify unique
182
+ # users for billing purposes. This string cannot contain carriage return, newline,
183
+ # or tab characters. If no value is specified in the input, **user_id** is
184
+ # automatically set to the value of **context.global.session_id**.
185
+ #
186
+ # **Note:** This property is the same as the **user_id** property in the global
187
+ # system context. If **user_id** is specified in both locations, the value specified
188
+ # at the root is used.
181
189
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
182
- def message(assistant_id:, session_id:, input: nil, context: nil)
190
+ def message(assistant_id:, session_id:, input: nil, context: nil, user_id: nil)
183
191
  raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
184
192
 
185
193
  raise ArgumentError.new("session_id must be provided") if session_id.nil?
186
194
 
195
+ raise ArgumentError.new("version must be provided") if version.nil?
196
+
187
197
  headers = {
188
198
  }
189
199
  sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "message")
@@ -195,7 +205,8 @@ module IBMWatson
195
205
 
196
206
  data = {
197
207
  "input" => input,
198
- "context" => context
208
+ "context" => context,
209
+ "user_id" => user_id
199
210
  }
200
211
 
201
212
  method_url = "/v2/assistants/%s/sessions/%s/message" % [ERB::Util.url_encode(assistant_id), ERB::Util.url_encode(session_id)]
@@ -212,7 +223,7 @@ module IBMWatson
212
223
  end
213
224
 
214
225
  ##
215
- # @!method message_stateless(assistant_id:, input: nil, context: nil)
226
+ # @!method message_stateless(assistant_id:, input: nil, context: nil, user_id: nil)
216
227
  # Send user input to assistant (stateless).
217
228
  # Send user input to an assistant and receive a response, with conversation state
218
229
  # (including context data) managed by your application.
@@ -230,10 +241,22 @@ module IBMWatson
230
241
  #
231
242
  # **Note:** The total size of the context data for a stateless session cannot exceed
232
243
  # 250KB.
244
+ # @param user_id [String] A string value that identifies the user who is interacting with the assistant. The
245
+ # client must provide a unique identifier for each individual end user who accesses
246
+ # the application. For user-based plans, this user ID is used to identify unique
247
+ # users for billing purposes. This string cannot contain carriage return, newline,
248
+ # or tab characters. If no value is specified in the input, **user_id** is
249
+ # automatically set to the value of **context.global.session_id**.
250
+ #
251
+ # **Note:** This property is the same as the **user_id** property in the global
252
+ # system context. If **user_id** is specified in both locations in a message
253
+ # request, the value specified at the root is used.
233
254
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
234
- def message_stateless(assistant_id:, input: nil, context: nil)
255
+ def message_stateless(assistant_id:, input: nil, context: nil, user_id: nil)
235
256
  raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
236
257
 
258
+ raise ArgumentError.new("version must be provided") if version.nil?
259
+
237
260
  headers = {
238
261
  }
239
262
  sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "message_stateless")
@@ -245,7 +268,8 @@ module IBMWatson
245
268
 
246
269
  data = {
247
270
  "input" => input,
248
- "context" => context
271
+ "context" => context,
272
+ "user_id" => user_id
249
273
  }
250
274
 
251
275
  method_url = "/v2/assistants/%s/message" % [ERB::Util.url_encode(assistant_id)]
@@ -261,6 +285,53 @@ module IBMWatson
261
285
  response
262
286
  end
263
287
  #########################
288
+ # Bulk classify
289
+ #########################
290
+
291
+ ##
292
+ # @!method bulk_classify(skill_id:, input: nil)
293
+ # Identify intents and entities in multiple user utterances.
294
+ # Send multiple user inputs to a dialog skill in a single request and receive
295
+ # information about the intents and entities recognized in each input. This method
296
+ # is useful for testing and comparing the performance of different skills or skill
297
+ # versions.
298
+ #
299
+ # This method is available only with Enterprise with Data Isolation plans.
300
+ # @param skill_id [String] Unique identifier of the skill. To find the skill ID in the Watson Assistant user
301
+ # interface, open the skill settings and click **API Details**.
302
+ # @param input [Array[BulkClassifyUtterance]] An array of input utterances to classify.
303
+ # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
304
+ def bulk_classify(skill_id:, input: nil)
305
+ raise ArgumentError.new("skill_id must be provided") if skill_id.nil?
306
+
307
+ raise ArgumentError.new("version must be provided") if version.nil?
308
+
309
+ headers = {
310
+ }
311
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "bulk_classify")
312
+ headers.merge!(sdk_headers)
313
+
314
+ params = {
315
+ "version" => @version
316
+ }
317
+
318
+ data = {
319
+ "input" => input
320
+ }
321
+
322
+ method_url = "/v2/skills/%s/workspace/bulk_classify" % [ERB::Util.url_encode(skill_id)]
323
+
324
+ response = request(
325
+ method: "POST",
326
+ url: method_url,
327
+ headers: headers,
328
+ params: params,
329
+ json: data,
330
+ accept_json: true
331
+ )
332
+ response
333
+ end
334
+ #########################
264
335
  # Logs
265
336
  #########################
266
337
 
@@ -269,7 +340,7 @@ module IBMWatson
269
340
  # List log events for an assistant.
270
341
  # List the events from the log of an assistant.
271
342
  #
272
- # This method is available only with Premium plans.
343
+ # This method requires Manager access, and is available only with Enterprise plans.
273
344
  # @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
274
345
  # Assistant user interface, open the assistant settings and click **API Details**.
275
346
  # For information about creating assistants, see the
@@ -287,6 +358,8 @@ module IBMWatson
287
358
  def list_logs(assistant_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
288
359
  raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
289
360
 
361
+ raise ArgumentError.new("version must be provided") if version.nil?
362
+
290
363
  headers = {
291
364
  }
292
365
  sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "list_logs")
@@ -326,11 +399,16 @@ module IBMWatson
326
399
  # customer IDs, see [Information
327
400
  # security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
328
401
  #
329
- # This operation is limited to 4 requests per minute. For more information, see
330
- # **Rate limiting**.
402
+ # **Note:** This operation is intended only for deleting data associated with a
403
+ # single specific customer, not for deleting data associated with multiple customers
404
+ # or for any other purpose. For more information, see [Labeling and deleting data in
405
+ # Watson
406
+ # Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security-gdpr-wa).
331
407
  # @param customer_id [String] The customer ID for which all data is to be deleted.
332
408
  # @return [nil]
333
409
  def delete_user_data(customer_id:)
410
+ raise ArgumentError.new("version must be provided") if version.nil?
411
+
334
412
  raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
335
413
 
336
414
  headers = {
@@ -13,9 +13,19 @@
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
-
17
- # IBM Watson™ Compare and Comply analyzes governing documents to provide details
18
- # about critical aspects of the documents.
16
+ #
17
+ # IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156
18
+ #
19
+ # IBM Watson™ Compare and Comply is discontinued. Existing instances are supported
20
+ # until 30 November 2021, but as of 1 December 2020, you can't create instances. Any
21
+ # instance that exists on 30 November 2021 will be deleted. Consider migrating to Watson
22
+ # Discovery Premium on IBM Cloud for your Compare and Comply use cases. To start the
23
+ # migration process, visit
24
+ # [https://ibm.biz/contact-wdc-premium](https://ibm.biz/contact-wdc-premium).
25
+ # {: deprecated}
26
+ #
27
+ # Compare and Comply analyzes governing documents to provide details about critical
28
+ # aspects of the documents.
19
29
 
20
30
  require "concurrent"
21
31
  require "erb"
@@ -23,7 +33,6 @@ require "json"
23
33
  require "ibm_cloud_sdk_core"
24
34
  require_relative "./common.rb"
25
35
 
26
- # Module for the Watson APIs
27
36
  module IBMWatson
28
37
  ##
29
38
  # The Compare Comply V1 service.
@@ -31,33 +40,27 @@ module IBMWatson
31
40
  include Concurrent::Async
32
41
  DEFAULT_SERVICE_NAME = "compare_comply"
33
42
  DEFAULT_SERVICE_URL = "https://api.us-south.compare-comply.watson.cloud.ibm.com"
43
+ attr_accessor :version
34
44
  ##
35
45
  # @!method initialize(args)
36
46
  # Construct a new client for the Compare Comply service.
37
47
  #
38
48
  # @param args [Hash] The args to initialize with
39
- # @option args version [String] The API version date to use with the service, in
40
- # "YYYY-MM-DD" format. Whenever the API is changed in a backwards
41
- # incompatible way, a new minor version of the API is released.
42
- # The service uses the API version for the date you specify, or
43
- # the most recent version before that date. Note that you should
44
- # not programmatically specify the current date at runtime, in
45
- # case the API has been updated since your application's release.
46
- # Instead, specify a version date that is compatible with your
47
- # application, and don't change it until your application is
48
- # ready for a later version.
49
+ # @option args version [String] Release date of the version of the API you want to use. Specify dates in
50
+ # YYYY-MM-DD format. The current version is `2018-10-15`.
49
51
  # @option args service_url [String] The base service URL to use when contacting the service.
50
52
  # The base service_url may differ between IBM Cloud regions.
51
53
  # @option args authenticator [Object] The Authenticator instance to be configured for this service.
52
54
  # @option args service_name [String] The name of the service to configure. Will be used as the key to load
53
55
  # any external configuration, if applicable.
54
56
  def initialize(args = {})
57
+ warn "On 30 November 2021, Compare and Comply will no longer be available. For more information, see https://github.com/watson-developer-cloud/ruby-sdk#compare-and-comply-deprecation."
55
58
  @__async_initialized__ = false
56
59
  defaults = {}
57
- defaults[:version] = nil
58
60
  defaults[:service_url] = DEFAULT_SERVICE_URL
59
61
  defaults[:service_name] = DEFAULT_SERVICE_NAME
60
62
  defaults[:authenticator] = nil
63
+ defaults[:version] = nil
61
64
  user_service_url = args[:service_url] unless args[:service_url].nil?
62
65
  args = defaults.merge(args)
63
66
  @version = args[:version]
@@ -84,6 +87,8 @@ module IBMWatson
84
87
  # standalone methods as well as to the methods' use in batch-processing requests.
85
88
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
86
89
  def convert_to_html(file:, file_content_type: nil, model: nil)
90
+ raise ArgumentError.new("version must be provided") if version.nil?
91
+
87
92
  raise ArgumentError.new("file must be provided") if file.nil?
88
93
 
89
94
  headers = {
@@ -131,6 +136,8 @@ module IBMWatson
131
136
  # standalone methods as well as to the methods' use in batch-processing requests.
132
137
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
133
138
  def classify_elements(file:, file_content_type: nil, model: nil)
139
+ raise ArgumentError.new("version must be provided") if version.nil?
140
+
134
141
  raise ArgumentError.new("file must be provided") if file.nil?
135
142
 
136
143
  headers = {
@@ -178,6 +185,8 @@ module IBMWatson
178
185
  # standalone methods as well as to the methods' use in batch-processing requests.
179
186
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
180
187
  def extract_tables(file:, file_content_type: nil, model: nil)
188
+ raise ArgumentError.new("version must be provided") if version.nil?
189
+
181
190
  raise ArgumentError.new("file must be provided") if file.nil?
182
191
 
183
192
  headers = {
@@ -229,6 +238,8 @@ module IBMWatson
229
238
  # standalone methods as well as to the methods' use in batch-processing requests.
230
239
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
231
240
  def compare_documents(file_1:, file_2:, file_1_content_type: nil, file_2_content_type: nil, file_1_label: nil, file_2_label: nil, model: nil)
241
+ raise ArgumentError.new("version must be provided") if version.nil?
242
+
232
243
  raise ArgumentError.new("file_1 must be provided") if file_1.nil?
233
244
 
234
245
  raise ArgumentError.new("file_2 must be provided") if file_2.nil?
@@ -286,6 +297,8 @@ module IBMWatson
286
297
  # @param comment [String] An optional comment on or description of the feedback.
287
298
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
288
299
  def add_feedback(feedback_data:, user_id: nil, comment: nil)
300
+ raise ArgumentError.new("version must be provided") if version.nil?
301
+
289
302
  raise ArgumentError.new("feedback_data must be provided") if feedback_data.nil?
290
303
 
291
304
  headers = {
@@ -317,15 +330,11 @@ module IBMWatson
317
330
  end
318
331
 
319
332
  ##
320
- # @!method list_feedback(feedback_type: nil, before: nil, after: nil, document_title: nil, model_id: nil, model_version: nil, category_removed: nil, category_added: nil, category_not_changed: nil, type_removed: nil, type_added: nil, type_not_changed: nil, page_limit: nil, cursor: nil, sort: nil, include_total: nil)
333
+ # @!method list_feedback(feedback_type: nil, document_title: nil, model_id: nil, model_version: nil, category_removed: nil, category_added: nil, category_not_changed: nil, type_removed: nil, type_added: nil, type_not_changed: nil, page_limit: nil, cursor: nil, sort: nil, include_total: nil)
321
334
  # List the feedback in a document.
322
335
  # Lists the feedback in a document.
323
336
  # @param feedback_type [String] An optional string that filters the output to include only feedback with the
324
337
  # specified feedback type. The only permitted value is `element_classification`.
325
- # @param before [Time] An optional string in the format `YYYY-MM-DD` that filters the output to include
326
- # only feedback that was added before the specified date.
327
- # @param after [Time] An optional string in the format `YYYY-MM-DD` that filters the output to include
328
- # only feedback that was added after the specified date.
329
338
  # @param document_title [String] An optional string that filters the output to include only feedback from the
330
339
  # document with the specified `document_title`.
331
340
  # @param model_id [String] An optional string that filters the output to include only feedback with the
@@ -362,7 +371,9 @@ module IBMWatson
362
371
  # output includes a value called `total` that gives the total count of feedback
363
372
  # created.
364
373
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
365
- def list_feedback(feedback_type: nil, before: nil, after: nil, document_title: nil, model_id: nil, model_version: nil, category_removed: nil, category_added: nil, category_not_changed: nil, type_removed: nil, type_added: nil, type_not_changed: nil, page_limit: nil, cursor: nil, sort: nil, include_total: nil)
374
+ def list_feedback(feedback_type: nil, document_title: nil, model_id: nil, model_version: nil, category_removed: nil, category_added: nil, category_not_changed: nil, type_removed: nil, type_added: nil, type_not_changed: nil, page_limit: nil, cursor: nil, sort: nil, include_total: nil)
375
+ raise ArgumentError.new("version must be provided") if version.nil?
376
+
366
377
  headers = {
367
378
  }
368
379
  sdk_headers = Common.new.get_sdk_headers("compare-comply", "V1", "list_feedback")
@@ -371,8 +382,6 @@ module IBMWatson
371
382
  params = {
372
383
  "version" => @version,
373
384
  "feedback_type" => feedback_type,
374
- "before" => before,
375
- "after" => after,
376
385
  "document_title" => document_title,
377
386
  "model_id" => model_id,
378
387
  "model_version" => model_version,
@@ -411,6 +420,8 @@ module IBMWatson
411
420
  # standalone methods as well as to the methods' use in batch-processing requests.
412
421
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
413
422
  def get_feedback(feedback_id:, model: nil)
423
+ raise ArgumentError.new("version must be provided") if version.nil?
424
+
414
425
  raise ArgumentError.new("feedback_id must be provided") if feedback_id.nil?
415
426
 
416
427
  headers = {
@@ -446,6 +457,8 @@ module IBMWatson
446
457
  # standalone methods as well as to the methods' use in batch-processing requests.
447
458
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
448
459
  def delete_feedback(feedback_id:, model: nil)
460
+ raise ArgumentError.new("version must be provided") if version.nil?
461
+
449
462
  raise ArgumentError.new("feedback_id must be provided") if feedback_id.nil?
450
463
 
451
464
  headers = {
@@ -504,6 +517,8 @@ module IBMWatson
504
517
  # standalone methods as well as to the methods' use in batch-processing requests.
505
518
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
506
519
  def create_batch(function:, input_credentials_file:, input_bucket_location:, input_bucket_name:, output_credentials_file:, output_bucket_location:, output_bucket_name:, model: nil)
520
+ raise ArgumentError.new("version must be provided") if version.nil?
521
+
507
522
  raise ArgumentError.new("function must be provided") if function.nil?
508
523
 
509
524
  raise ArgumentError.new("input_credentials_file must be provided") if input_credentials_file.nil?
@@ -568,6 +583,8 @@ module IBMWatson
568
583
  # Lists batch-processing jobs submitted by users.
569
584
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
570
585
  def list_batches
586
+ raise ArgumentError.new("version must be provided") if version.nil?
587
+
571
588
  headers = {
572
589
  }
573
590
  sdk_headers = Common.new.get_sdk_headers("compare-comply", "V1", "list_batches")
@@ -596,6 +613,8 @@ module IBMWatson
596
613
  # @param batch_id [String] The ID of the batch-processing job whose information you want to retrieve.
597
614
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
598
615
  def get_batch(batch_id:)
616
+ raise ArgumentError.new("version must be provided") if version.nil?
617
+
599
618
  raise ArgumentError.new("batch_id must be provided") if batch_id.nil?
600
619
 
601
620
  headers = {
@@ -632,6 +651,8 @@ module IBMWatson
632
651
  # standalone methods as well as to the methods' use in batch-processing requests.
633
652
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
634
653
  def update_batch(batch_id:, action:, model: nil)
654
+ raise ArgumentError.new("version must be provided") if version.nil?
655
+
635
656
  raise ArgumentError.new("batch_id must be provided") if batch_id.nil?
636
657
 
637
658
  raise ArgumentError.new("action must be provided") if action.nil?
@@ -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.31.0-902c9336-20210504-161156
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
@@ -26,7 +28,6 @@ require "json"
26
28
  require "ibm_cloud_sdk_core"
27
29
  require_relative "./common.rb"
28
30
 
29
- # Module for the Watson APIs
30
31
  module IBMWatson
31
32
  ##
32
33
  # The Discovery V1 service.
@@ -34,21 +35,14 @@ module IBMWatson
34
35
  include Concurrent::Async
35
36
  DEFAULT_SERVICE_NAME = "discovery"
36
37
  DEFAULT_SERVICE_URL = "https://api.us-south.discovery.watson.cloud.ibm.com"
38
+ attr_accessor :version
37
39
  ##
38
40
  # @!method initialize(args)
39
41
  # Construct a new client for the Discovery service.
40
42
  #
41
43
  # @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.
44
+ # @option args version [String] Release date of the version of the API you want to use. Specify dates in
45
+ # YYYY-MM-DD format. The current version is `2019-04-30`.
52
46
  # @option args service_url [String] The base service URL to use when contacting the service.
53
47
  # The base service_url may differ between IBM Cloud regions.
54
48
  # @option args authenticator [Object] The Authenticator instance to be configured for this service.
@@ -57,10 +51,10 @@ module IBMWatson
57
51
  def initialize(args = {})
58
52
  @__async_initialized__ = false
59
53
  defaults = {}
60
- defaults[:version] = nil
61
54
  defaults[:service_url] = DEFAULT_SERVICE_URL
62
55
  defaults[:service_name] = DEFAULT_SERVICE_NAME
63
56
  defaults[:authenticator] = nil
57
+ defaults[:version] = nil
64
58
  user_service_url = args[:service_url] unless args[:service_url].nil?
65
59
  args = defaults.merge(args)
66
60
  @version = args[:version]
@@ -89,6 +83,8 @@ module IBMWatson
89
83
  # `LT`, in all other plans the default is `S`.
90
84
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
91
85
  def create_environment(name:, description: nil, size: nil)
86
+ raise ArgumentError.new("version must be provided") if version.nil?
87
+
92
88
  raise ArgumentError.new("name must be provided") if name.nil?
93
89
 
94
90
  headers = {
@@ -126,6 +122,8 @@ module IBMWatson
126
122
  # @param name [String] Show only the environment with the given name.
127
123
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
128
124
  def list_environments(name: nil)
125
+ raise ArgumentError.new("version must be provided") if version.nil?
126
+
129
127
  headers = {
130
128
  }
131
129
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "list_environments")
@@ -154,6 +152,8 @@ module IBMWatson
154
152
  # @param environment_id [String] The ID of the environment.
155
153
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
156
154
  def get_environment(environment_id:)
155
+ raise ArgumentError.new("version must be provided") if version.nil?
156
+
157
157
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
158
158
 
159
159
  headers = {
@@ -190,6 +190,8 @@ module IBMWatson
190
190
  # decreased.
191
191
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
192
192
  def update_environment(environment_id:, name: nil, description: nil, size: nil)
193
+ raise ArgumentError.new("version must be provided") if version.nil?
194
+
193
195
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
194
196
 
195
197
  headers = {
@@ -226,6 +228,8 @@ module IBMWatson
226
228
  # @param environment_id [String] The ID of the environment.
227
229
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
228
230
  def delete_environment(environment_id:)
231
+ raise ArgumentError.new("version must be provided") if version.nil?
232
+
229
233
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
230
234
 
231
235
  headers = {
@@ -258,6 +262,8 @@ module IBMWatson
258
262
  # @param collection_ids [Array[String]] A comma-separated list of collection IDs to be queried against.
259
263
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
260
264
  def list_fields(environment_id:, collection_ids:)
265
+ raise ArgumentError.new("version must be provided") if version.nil?
266
+
261
267
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
262
268
 
263
269
  raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
@@ -314,6 +320,8 @@ module IBMWatson
314
320
  # @param source [Source] Object containing source parameters for the configuration.
315
321
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
316
322
  def create_configuration(environment_id:, name:, description: nil, conversions: nil, enrichments: nil, normalizations: nil, source: nil)
323
+ raise ArgumentError.new("version must be provided") if version.nil?
324
+
317
325
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
318
326
 
319
327
  raise ArgumentError.new("name must be provided") if name.nil?
@@ -357,6 +365,8 @@ module IBMWatson
357
365
  # @param name [String] Find configurations with the given name.
358
366
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
359
367
  def list_configurations(environment_id:, name: nil)
368
+ raise ArgumentError.new("version must be provided") if version.nil?
369
+
360
370
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
361
371
 
362
372
  headers = {
@@ -388,6 +398,8 @@ module IBMWatson
388
398
  # @param configuration_id [String] The ID of the configuration.
389
399
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
390
400
  def get_configuration(environment_id:, configuration_id:)
401
+ raise ArgumentError.new("version must be provided") if version.nil?
402
+
391
403
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
392
404
 
393
405
  raise ArgumentError.new("configuration_id must be provided") if configuration_id.nil?
@@ -437,6 +449,8 @@ module IBMWatson
437
449
  # @param source [Source] Object containing source parameters for the configuration.
438
450
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
439
451
  def update_configuration(environment_id:, configuration_id:, name:, description: nil, conversions: nil, enrichments: nil, normalizations: nil, source: nil)
452
+ raise ArgumentError.new("version must be provided") if version.nil?
453
+
440
454
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
441
455
 
442
456
  raise ArgumentError.new("configuration_id must be provided") if configuration_id.nil?
@@ -487,6 +501,8 @@ module IBMWatson
487
501
  # @param configuration_id [String] The ID of the configuration.
488
502
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
489
503
  def delete_configuration(environment_id:, configuration_id:)
504
+ raise ArgumentError.new("version must be provided") if version.nil?
505
+
490
506
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
491
507
 
492
508
  raise ArgumentError.new("configuration_id must be provided") if configuration_id.nil?
@@ -526,6 +542,8 @@ module IBMWatson
526
542
  # 639-1 language code.
527
543
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
528
544
  def create_collection(environment_id:, name:, description: nil, configuration_id: nil, language: nil)
545
+ raise ArgumentError.new("version must be provided") if version.nil?
546
+
529
547
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
530
548
 
531
549
  raise ArgumentError.new("name must be provided") if name.nil?
@@ -567,6 +585,8 @@ module IBMWatson
567
585
  # @param name [String] Find collections with the given name.
568
586
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
569
587
  def list_collections(environment_id:, name: nil)
588
+ raise ArgumentError.new("version must be provided") if version.nil?
589
+
570
590
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
571
591
 
572
592
  headers = {
@@ -598,6 +618,8 @@ module IBMWatson
598
618
  # @param collection_id [String] The ID of the collection.
599
619
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
600
620
  def get_collection(environment_id:, collection_id:)
621
+ raise ArgumentError.new("version must be provided") if version.nil?
622
+
601
623
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
602
624
 
603
625
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -633,6 +655,8 @@ module IBMWatson
633
655
  # @param configuration_id [String] The ID of the configuration in which the collection is to be updated.
634
656
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
635
657
  def update_collection(environment_id:, collection_id:, name:, description: nil, configuration_id: nil)
658
+ raise ArgumentError.new("version must be provided") if version.nil?
659
+
636
660
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
637
661
 
638
662
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -674,6 +698,8 @@ module IBMWatson
674
698
  # @param collection_id [String] The ID of the collection.
675
699
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
676
700
  def delete_collection(environment_id:, collection_id:)
701
+ raise ArgumentError.new("version must be provided") if version.nil?
702
+
677
703
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
678
704
 
679
705
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -707,6 +733,8 @@ module IBMWatson
707
733
  # @param collection_id [String] The ID of the collection.
708
734
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
709
735
  def list_collection_fields(environment_id:, collection_id:)
736
+ raise ArgumentError.new("version must be provided") if version.nil?
737
+
710
738
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
711
739
 
712
740
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -744,6 +772,8 @@ module IBMWatson
744
772
  # @param collection_id [String] The ID of the collection.
745
773
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
746
774
  def list_expansions(environment_id:, collection_id:)
775
+ raise ArgumentError.new("version must be provided") if version.nil?
776
+
747
777
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
748
778
 
749
779
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -795,6 +825,8 @@ module IBMWatson
795
825
  # **expanded_terms** array.
796
826
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
797
827
  def create_expansions(environment_id:, collection_id:, expansions:)
828
+ raise ArgumentError.new("version must be provided") if version.nil?
829
+
798
830
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
799
831
 
800
832
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -836,6 +868,8 @@ module IBMWatson
836
868
  # @param collection_id [String] The ID of the collection.
837
869
  # @return [nil]
838
870
  def delete_expansions(environment_id:, collection_id:)
871
+ raise ArgumentError.new("version must be provided") if version.nil?
872
+
839
873
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
840
874
 
841
875
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -870,6 +904,8 @@ module IBMWatson
870
904
  # @param collection_id [String] The ID of the collection.
871
905
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
872
906
  def get_tokenization_dictionary_status(environment_id:, collection_id:)
907
+ raise ArgumentError.new("version must be provided") if version.nil?
908
+
873
909
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
874
910
 
875
911
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -906,6 +942,8 @@ module IBMWatson
906
942
  # `part_of_speech` the text is from.
907
943
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
908
944
  def create_tokenization_dictionary(environment_id:, collection_id:, tokenization_rules: nil)
945
+ raise ArgumentError.new("version must be provided") if version.nil?
946
+
909
947
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
910
948
 
911
949
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -944,6 +982,8 @@ module IBMWatson
944
982
  # @param collection_id [String] The ID of the collection.
945
983
  # @return [nil]
946
984
  def delete_tokenization_dictionary(environment_id:, collection_id:)
985
+ raise ArgumentError.new("version must be provided") if version.nil?
986
+
947
987
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
948
988
 
949
989
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -977,6 +1017,8 @@ module IBMWatson
977
1017
  # @param collection_id [String] The ID of the collection.
978
1018
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
979
1019
  def get_stopword_list_status(environment_id:, collection_id:)
1020
+ raise ArgumentError.new("version must be provided") if version.nil?
1021
+
980
1022
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
981
1023
 
982
1024
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1012,6 +1054,8 @@ module IBMWatson
1012
1054
  # @param stopword_filename [String] The filename for stopword_file.
1013
1055
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1014
1056
  def create_stopword_list(environment_id:, collection_id:, stopword_file:, stopword_filename: nil)
1057
+ raise ArgumentError.new("version must be provided") if version.nil?
1058
+
1015
1059
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1016
1060
 
1017
1061
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1057,6 +1101,8 @@ module IBMWatson
1057
1101
  # @param collection_id [String] The ID of the collection.
1058
1102
  # @return [nil]
1059
1103
  def delete_stopword_list(environment_id:, collection_id:)
1104
+ raise ArgumentError.new("version must be provided") if version.nil?
1105
+
1060
1106
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1061
1107
 
1062
1108
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1131,6 +1177,8 @@ module IBMWatson
1131
1177
  # } ```.
1132
1178
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1133
1179
  def add_document(environment_id:, collection_id:, file: nil, filename: nil, file_content_type: nil, metadata: nil)
1180
+ raise ArgumentError.new("version must be provided") if version.nil?
1181
+
1134
1182
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1135
1183
 
1136
1184
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1181,6 +1229,8 @@ module IBMWatson
1181
1229
  # @param document_id [String] The ID of the document.
1182
1230
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1183
1231
  def get_document_status(environment_id:, collection_id:, document_id:)
1232
+ raise ArgumentError.new("version must be provided") if version.nil?
1233
+
1184
1234
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1185
1235
 
1186
1236
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1232,6 +1282,8 @@ module IBMWatson
1232
1282
  # } ```.
1233
1283
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1234
1284
  def update_document(environment_id:, collection_id:, document_id:, file: nil, filename: nil, file_content_type: nil, metadata: nil)
1285
+ raise ArgumentError.new("version must be provided") if version.nil?
1286
+
1235
1287
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1236
1288
 
1237
1289
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1283,6 +1335,8 @@ module IBMWatson
1283
1335
  # @param document_id [String] The ID of the document.
1284
1336
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1285
1337
  def delete_document(environment_id:, collection_id:, document_id:)
1338
+ raise ArgumentError.new("version must be provided") if version.nil?
1339
+
1286
1340
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1287
1341
 
1288
1342
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1375,13 +1429,15 @@ module IBMWatson
1375
1429
  # parameter.
1376
1430
  # @param spelling_suggestions [Boolean] When `true` and the **natural_language_query** parameter is used, the
1377
1431
  # **natural_languge_query** parameter is spell checked. The most likely correction
1378
- # is retunred in the **suggested_query** field of the response (if one exists).
1432
+ # is returned in the **suggested_query** field of the response (if one exists).
1379
1433
  #
1380
1434
  # **Important:** this parameter is only valid when using the Cloud Pak version of
1381
1435
  # Discovery.
1382
1436
  # @param x_watson_logging_opt_out [Boolean] If `true`, queries are not stored in the Discovery **Logs** endpoint.
1383
1437
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1384
1438
  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)
1439
+ raise ArgumentError.new("version must be provided") if version.nil?
1440
+
1385
1441
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1386
1442
 
1387
1443
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1486,6 +1542,8 @@ module IBMWatson
1486
1542
  # comparison.
1487
1543
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1488
1544
  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)
1545
+ raise ArgumentError.new("version must be provided") if version.nil?
1546
+
1489
1547
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1490
1548
 
1491
1549
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1596,6 +1654,8 @@ module IBMWatson
1596
1654
  # @param x_watson_logging_opt_out [Boolean] If `true`, queries are not stored in the Discovery **Logs** endpoint.
1597
1655
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1598
1656
  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)
1657
+ raise ArgumentError.new("version must be provided") if version.nil?
1658
+
1599
1659
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1600
1660
 
1601
1661
  raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
@@ -1694,6 +1754,8 @@ module IBMWatson
1694
1754
  # comparison.
1695
1755
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1696
1756
  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)
1757
+ raise ArgumentError.new("version must be provided") if version.nil?
1758
+
1697
1759
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1698
1760
 
1699
1761
  raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
@@ -1753,6 +1815,8 @@ module IBMWatson
1753
1815
  # @param count [Fixnum] The number of autocompletion suggestions to return.
1754
1816
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1755
1817
  def get_autocompletion(environment_id:, collection_id:, prefix:, field: nil, count: nil)
1818
+ raise ArgumentError.new("version must be provided") if version.nil?
1819
+
1756
1820
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1757
1821
 
1758
1822
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1794,6 +1858,8 @@ module IBMWatson
1794
1858
  # @param collection_id [String] The ID of the collection.
1795
1859
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1796
1860
  def list_training_data(environment_id:, collection_id:)
1861
+ raise ArgumentError.new("version must be provided") if version.nil?
1862
+
1797
1863
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1798
1864
 
1799
1865
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1832,6 +1898,8 @@ module IBMWatson
1832
1898
  # @param examples [Array[TrainingExample]] Array of training examples.
1833
1899
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1834
1900
  def add_training_data(environment_id:, collection_id:, natural_language_query: nil, filter: nil, examples: nil)
1901
+ raise ArgumentError.new("version must be provided") if version.nil?
1902
+
1835
1903
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1836
1904
 
1837
1905
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1872,6 +1940,8 @@ module IBMWatson
1872
1940
  # @param collection_id [String] The ID of the collection.
1873
1941
  # @return [nil]
1874
1942
  def delete_all_training_data(environment_id:, collection_id:)
1943
+ raise ArgumentError.new("version must be provided") if version.nil?
1944
+
1875
1945
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1876
1946
 
1877
1947
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1907,6 +1977,8 @@ module IBMWatson
1907
1977
  # @param query_id [String] The ID of the query used for training.
1908
1978
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1909
1979
  def get_training_data(environment_id:, collection_id:, query_id:)
1980
+ raise ArgumentError.new("version must be provided") if version.nil?
1981
+
1910
1982
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1911
1983
 
1912
1984
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1944,6 +2016,8 @@ module IBMWatson
1944
2016
  # @param query_id [String] The ID of the query used for training.
1945
2017
  # @return [nil]
1946
2018
  def delete_training_data(environment_id:, collection_id:, query_id:)
2019
+ raise ArgumentError.new("version must be provided") if version.nil?
2020
+
1947
2021
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1948
2022
 
1949
2023
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1980,6 +2054,8 @@ module IBMWatson
1980
2054
  # @param query_id [String] The ID of the query used for training.
1981
2055
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1982
2056
  def list_training_examples(environment_id:, collection_id:, query_id:)
2057
+ raise ArgumentError.new("version must be provided") if version.nil?
2058
+
1983
2059
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1984
2060
 
1985
2061
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2019,6 +2095,8 @@ module IBMWatson
2019
2095
  # @param relevance [Fixnum] The relevance of the training example.
2020
2096
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2021
2097
  def create_training_example(environment_id:, collection_id:, query_id:, document_id: nil, cross_reference: nil, relevance: nil)
2098
+ raise ArgumentError.new("version must be provided") if version.nil?
2099
+
2022
2100
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2023
2101
 
2024
2102
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2063,6 +2141,8 @@ module IBMWatson
2063
2141
  # @param example_id [String] The ID of the document as it is indexed.
2064
2142
  # @return [nil]
2065
2143
  def delete_training_example(environment_id:, collection_id:, query_id:, example_id:)
2144
+ raise ArgumentError.new("version must be provided") if version.nil?
2145
+
2066
2146
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2067
2147
 
2068
2148
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2104,6 +2184,8 @@ module IBMWatson
2104
2184
  # @param relevance [Fixnum] The relevance value for this example.
2105
2185
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2106
2186
  def update_training_example(environment_id:, collection_id:, query_id:, example_id:, cross_reference: nil, relevance: nil)
2187
+ raise ArgumentError.new("version must be provided") if version.nil?
2188
+
2107
2189
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2108
2190
 
2109
2191
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2149,6 +2231,8 @@ module IBMWatson
2149
2231
  # @param example_id [String] The ID of the document as it is indexed.
2150
2232
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2151
2233
  def get_training_example(environment_id:, collection_id:, query_id:, example_id:)
2234
+ raise ArgumentError.new("version must be provided") if version.nil?
2235
+
2152
2236
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2153
2237
 
2154
2238
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2194,6 +2278,8 @@ module IBMWatson
2194
2278
  # @param customer_id [String] The customer ID for which all data is to be deleted.
2195
2279
  # @return [nil]
2196
2280
  def delete_user_data(customer_id:)
2281
+ raise ArgumentError.new("version must be provided") if version.nil?
2282
+
2197
2283
  raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
2198
2284
 
2199
2285
  headers = {
@@ -2231,6 +2317,8 @@ module IBMWatson
2231
2317
  # @param data [EventData] Query event data object.
2232
2318
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2233
2319
  def create_event(type:, data:)
2320
+ raise ArgumentError.new("version must be provided") if version.nil?
2321
+
2234
2322
  raise ArgumentError.new("type must be provided") if type.nil?
2235
2323
 
2236
2324
  raise ArgumentError.new("data must be provided") if data.nil?
@@ -2284,6 +2372,8 @@ module IBMWatson
2284
2372
  # ascending. Ascending is the default sort direction if no prefix is specified.
2285
2373
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2286
2374
  def query_log(filter: nil, query: nil, count: nil, offset: nil, sort: nil)
2375
+ raise ArgumentError.new("version must be provided") if version.nil?
2376
+
2287
2377
  headers = {
2288
2378
  }
2289
2379
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "query_log")
@@ -2323,6 +2413,8 @@ module IBMWatson
2323
2413
  # @param result_type [String] The type of result to consider when calculating the metric.
2324
2414
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2325
2415
  def get_metrics_query(start_time: nil, end_time: nil, result_type: nil)
2416
+ raise ArgumentError.new("version must be provided") if version.nil?
2417
+
2326
2418
  headers = {
2327
2419
  }
2328
2420
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query")
@@ -2360,6 +2452,8 @@ module IBMWatson
2360
2452
  # @param result_type [String] The type of result to consider when calculating the metric.
2361
2453
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2362
2454
  def get_metrics_query_event(start_time: nil, end_time: nil, result_type: nil)
2455
+ raise ArgumentError.new("version must be provided") if version.nil?
2456
+
2363
2457
  headers = {
2364
2458
  }
2365
2459
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query_event")
@@ -2396,6 +2490,8 @@ module IBMWatson
2396
2490
  # @param result_type [String] The type of result to consider when calculating the metric.
2397
2491
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2398
2492
  def get_metrics_query_no_results(start_time: nil, end_time: nil, result_type: nil)
2493
+ raise ArgumentError.new("version must be provided") if version.nil?
2494
+
2399
2495
  headers = {
2400
2496
  }
2401
2497
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query_no_results")
@@ -2433,6 +2529,8 @@ module IBMWatson
2433
2529
  # @param result_type [String] The type of result to consider when calculating the metric.
2434
2530
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2435
2531
  def get_metrics_event_rate(start_time: nil, end_time: nil, result_type: nil)
2532
+ raise ArgumentError.new("version must be provided") if version.nil?
2533
+
2436
2534
  headers = {
2437
2535
  }
2438
2536
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_event_rate")
@@ -2468,6 +2566,8 @@ module IBMWatson
2468
2566
  # together in any one query is **10000**.
2469
2567
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2470
2568
  def get_metrics_query_token_event(count: nil)
2569
+ raise ArgumentError.new("version must be provided") if version.nil?
2570
+
2471
2571
  headers = {
2472
2572
  }
2473
2573
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query_token_event")
@@ -2503,6 +2603,8 @@ module IBMWatson
2503
2603
  # @param environment_id [String] The ID of the environment.
2504
2604
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2505
2605
  def list_credentials(environment_id:)
2606
+ raise ArgumentError.new("version must be provided") if version.nil?
2607
+
2506
2608
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2507
2609
 
2508
2610
  headers = {
@@ -2553,6 +2655,8 @@ module IBMWatson
2553
2655
  # expired) and must be corrected before they can be used with a collection.
2554
2656
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2555
2657
  def create_credentials(environment_id:, source_type: nil, credential_details: nil, status: nil)
2658
+ raise ArgumentError.new("version must be provided") if version.nil?
2659
+
2556
2660
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2557
2661
 
2558
2662
  headers = {
@@ -2594,6 +2698,8 @@ module IBMWatson
2594
2698
  # @param credential_id [String] The unique identifier for a set of source credentials.
2595
2699
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2596
2700
  def get_credentials(environment_id:, credential_id:)
2701
+ raise ArgumentError.new("version must be provided") if version.nil?
2702
+
2597
2703
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2598
2704
 
2599
2705
  raise ArgumentError.new("credential_id must be provided") if credential_id.nil?
@@ -2646,6 +2752,8 @@ module IBMWatson
2646
2752
  # expired) and must be corrected before they can be used with a collection.
2647
2753
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2648
2754
  def update_credentials(environment_id:, credential_id:, source_type: nil, credential_details: nil, status: nil)
2755
+ raise ArgumentError.new("version must be provided") if version.nil?
2756
+
2649
2757
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2650
2758
 
2651
2759
  raise ArgumentError.new("credential_id must be provided") if credential_id.nil?
@@ -2686,6 +2794,8 @@ module IBMWatson
2686
2794
  # @param credential_id [String] The unique identifier for a set of source credentials.
2687
2795
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2688
2796
  def delete_credentials(environment_id:, credential_id:)
2797
+ raise ArgumentError.new("version must be provided") if version.nil?
2798
+
2689
2799
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2690
2800
 
2691
2801
  raise ArgumentError.new("credential_id must be provided") if credential_id.nil?
@@ -2721,6 +2831,8 @@ module IBMWatson
2721
2831
  # @param environment_id [String] The ID of the environment.
2722
2832
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2723
2833
  def list_gateways(environment_id:)
2834
+ raise ArgumentError.new("version must be provided") if version.nil?
2835
+
2724
2836
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2725
2837
 
2726
2838
  headers = {
@@ -2752,6 +2864,8 @@ module IBMWatson
2752
2864
  # @param name [String] User-defined name.
2753
2865
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2754
2866
  def create_gateway(environment_id:, name: nil)
2867
+ raise ArgumentError.new("version must be provided") if version.nil?
2868
+
2755
2869
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2756
2870
 
2757
2871
  headers = {
@@ -2788,6 +2902,8 @@ module IBMWatson
2788
2902
  # @param gateway_id [String] The requested gateway ID.
2789
2903
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2790
2904
  def get_gateway(environment_id:, gateway_id:)
2905
+ raise ArgumentError.new("version must be provided") if version.nil?
2906
+
2791
2907
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2792
2908
 
2793
2909
  raise ArgumentError.new("gateway_id must be provided") if gateway_id.nil?
@@ -2821,6 +2937,8 @@ module IBMWatson
2821
2937
  # @param gateway_id [String] The requested gateway ID.
2822
2938
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2823
2939
  def delete_gateway(environment_id:, gateway_id:)
2940
+ raise ArgumentError.new("version must be provided") if version.nil?
2941
+
2824
2942
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2825
2943
 
2826
2944
  raise ArgumentError.new("gateway_id must be provided") if gateway_id.nil?