ibm_watson 1.5.0 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +42 -4
- data/lib/ibm_watson/assistant_v1.rb +213 -195
- data/lib/ibm_watson/assistant_v2.rb +161 -17
- data/lib/ibm_watson/compare_comply_v1.rb +35 -21
- data/lib/ibm_watson/discovery_v1.rb +132 -13
- data/lib/ibm_watson/discovery_v2.rb +728 -21
- data/lib/ibm_watson/language_translator_v3.rb +205 -67
- data/lib/ibm_watson/natural_language_classifier_v1.rb +4 -2
- data/lib/ibm_watson/natural_language_understanding_v1.rb +21 -21
- data/lib/ibm_watson/personality_insights_v3.rb +27 -18
- data/lib/ibm_watson/speech_to_text_v1.rb +58 -46
- data/lib/ibm_watson/text_to_speech_v1.rb +113 -129
- data/lib/ibm_watson/tone_analyzer_v3.rb +12 -13
- data/lib/ibm_watson/version.rb +1 -1
- data/lib/ibm_watson/visual_recognition_v3.rb +33 -16
- data/lib/ibm_watson/visual_recognition_v4.rb +58 -17
- data/test/integration/test_assistant_v1.rb +9 -0
- data/test/integration/test_assistant_v2.rb +27 -0
- data/test/integration/test_discovery_v2.rb +132 -6
- data/test/integration/test_language_translator_v3.rb +5 -0
- data/test/integration/test_text_to_speech_v1.rb +3 -3
- data/test/unit/test_assistant_v1.rb +150 -99
- data/test/unit/test_assistant_v2.rb +91 -12
- data/test/unit/test_compare_comply_v1.rb +20 -20
- data/test/unit/test_discovery_v1.rb +125 -125
- data/test/unit/test_discovery_v2.rb +262 -29
- data/test/unit/test_language_translator_v3.rb +85 -24
- data/test/unit/test_natural_language_classifier_v1.rb +17 -17
- data/test/unit/test_natural_language_understanding_v1.rb +10 -10
- data/test/unit/test_personality_insights_v3.rb +14 -14
- data/test/unit/test_speech_to_text_v1.rb +97 -97
- data/test/unit/test_text_to_speech_v1.rb +48 -48
- data/test/unit/test_tone_analyzer_v3.rb +12 -12
- data/test/unit/test_visual_recognition_v3.rb +16 -16
- data/test/unit/test_visual_recognition_v4.rb +40 -40
- metadata +12 -11
@@ -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
|
# The IBM Watson™ Tone Analyzer service uses linguistic analysis to detect
|
18
20
|
# emotional and language tones in written text. The service can analyze tone at both the
|
19
21
|
# document and sentence levels. You can use the service to understand how your written
|
@@ -39,22 +41,15 @@ module IBMWatson
|
|
39
41
|
class ToneAnalyzerV3 < IBMCloudSdkCore::BaseService
|
40
42
|
include Concurrent::Async
|
41
43
|
DEFAULT_SERVICE_NAME = "tone_analyzer"
|
42
|
-
DEFAULT_SERVICE_URL = "https://
|
44
|
+
DEFAULT_SERVICE_URL = "https://api.us-south.tone-analyzer.watson.cloud.ibm.com"
|
45
|
+
attr_accessor :version
|
43
46
|
##
|
44
47
|
# @!method initialize(args)
|
45
48
|
# Construct a new client for the Tone Analyzer service.
|
46
49
|
#
|
47
50
|
# @param args [Hash] The args to initialize with
|
48
|
-
# @option args version [String]
|
49
|
-
#
|
50
|
-
# incompatible way, a new minor version of the API is released.
|
51
|
-
# The service uses the API version for the date you specify, or
|
52
|
-
# the most recent version before that date. Note that you should
|
53
|
-
# not programmatically specify the current date at runtime, in
|
54
|
-
# case the API has been updated since your application's release.
|
55
|
-
# Instead, specify a version date that is compatible with your
|
56
|
-
# application, and don't change it until your application is
|
57
|
-
# ready for a later version.
|
51
|
+
# @option args version [String] Release date of the version of the API you want to use. Specify dates in
|
52
|
+
# YYYY-MM-DD format. The current version is `2017-09-21`.
|
58
53
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
59
54
|
# The base service_url may differ between IBM Cloud regions.
|
60
55
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
@@ -63,10 +58,10 @@ module IBMWatson
|
|
63
58
|
def initialize(args = {})
|
64
59
|
@__async_initialized__ = false
|
65
60
|
defaults = {}
|
66
|
-
defaults[:version] = nil
|
67
61
|
defaults[:service_url] = DEFAULT_SERVICE_URL
|
68
62
|
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
69
63
|
defaults[:authenticator] = nil
|
64
|
+
defaults[:version] = nil
|
70
65
|
user_service_url = args[:service_url] unless args[:service_url].nil?
|
71
66
|
args = defaults.merge(args)
|
72
67
|
@version = args[:version]
|
@@ -131,6 +126,8 @@ module IBMWatson
|
|
131
126
|
# **Accept-Language**.
|
132
127
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
133
128
|
def tone(tone_input:, content_type: nil, sentences: nil, tones: nil, content_language: nil, accept_language: nil)
|
129
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
130
|
+
|
134
131
|
raise ArgumentError.new("tone_input must be provided") if tone_input.nil?
|
135
132
|
|
136
133
|
headers = {
|
@@ -199,6 +196,8 @@ module IBMWatson
|
|
199
196
|
# **Accept-Language**.
|
200
197
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
201
198
|
def tone_chat(utterances:, content_language: nil, accept_language: nil)
|
199
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
200
|
+
|
202
201
|
raise ArgumentError.new("utterances must be provided") if utterances.nil?
|
203
202
|
|
204
203
|
headers = {
|
data/lib/ibm_watson/version.rb
CHANGED
@@ -13,10 +13,17 @@
|
|
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
|
-
#
|
18
|
-
#
|
19
|
-
#
|
16
|
+
#
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.19.0-be3b4618-20201113-200858
|
18
|
+
#
|
19
|
+
# IBM Watson™ Visual Recognition is discontinued. Existing instances are supported
|
20
|
+
# until 1 December 2021, but as of 7 January 2021, you can't create instances. Any
|
21
|
+
# instance that is provisioned on 1 December 2021 will be deleted.
|
22
|
+
# {: deprecated}
|
23
|
+
#
|
24
|
+
# The IBM Watson Visual Recognition service uses deep learning algorithms to identify
|
25
|
+
# scenes and objects in images that you upload to the service. You can create and train a
|
26
|
+
# custom classifier to identify subjects that suit your needs.
|
20
27
|
|
21
28
|
require "concurrent"
|
22
29
|
require "erb"
|
@@ -31,34 +38,28 @@ module IBMWatson
|
|
31
38
|
class VisualRecognitionV3 < IBMCloudSdkCore::BaseService
|
32
39
|
include Concurrent::Async
|
33
40
|
DEFAULT_SERVICE_NAME = "visual_recognition"
|
34
|
-
DEFAULT_SERVICE_URL = "https://
|
41
|
+
DEFAULT_SERVICE_URL = "https://api.us-south.visual-recognition.watson.cloud.ibm.com"
|
42
|
+
attr_accessor :version
|
35
43
|
##
|
36
44
|
# @!method initialize(args)
|
37
45
|
# Construct a new client for the Visual Recognition service.
|
38
46
|
#
|
39
47
|
# @param args [Hash] The args to initialize with
|
40
|
-
# @option args version [String]
|
41
|
-
#
|
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.
|
48
|
+
# @option args version [String] Release date of the API version you want to use. Specify dates in YYYY-MM-DD
|
49
|
+
# format. The current version is `2018-03-19`.
|
50
50
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
51
51
|
# The base service_url may differ between IBM Cloud regions.
|
52
52
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
53
53
|
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
|
54
54
|
# any external configuration, if applicable.
|
55
55
|
def initialize(args = {})
|
56
|
+
warn "On 1 December 2021, Visual Recognition will no longer be available. For more information, see https://github.com/watson-developer-cloud/ruby-sdk/tree/master#visual-recognition-deprecation."
|
56
57
|
@__async_initialized__ = false
|
57
58
|
defaults = {}
|
58
|
-
defaults[:version] = nil
|
59
59
|
defaults[:service_url] = DEFAULT_SERVICE_URL
|
60
60
|
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
61
61
|
defaults[:authenticator] = nil
|
62
|
+
defaults[:version] = nil
|
62
63
|
user_service_url = args[:service_url] unless args[:service_url].nil?
|
63
64
|
args = defaults.merge(args)
|
64
65
|
@version = args[:version]
|
@@ -112,6 +113,8 @@ module IBMWatson
|
|
112
113
|
# @param accept_language [String] The desired language of parts of the response. See the response for details.
|
113
114
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
114
115
|
def classify(images_file: nil, images_filename: nil, images_file_content_type: nil, url: nil, threshold: nil, owners: nil, classifier_ids: nil, accept_language: nil)
|
116
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
117
|
+
|
115
118
|
headers = {
|
116
119
|
"Accept-Language" => accept_language
|
117
120
|
}
|
@@ -198,6 +201,8 @@ module IBMWatson
|
|
198
201
|
# @param negative_examples_filename [String] The filename for negative_examples.
|
199
202
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
200
203
|
def create_classifier(name:, positive_examples:, negative_examples: nil, negative_examples_filename: nil)
|
204
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
205
|
+
|
201
206
|
raise ArgumentError.new("name must be provided") if name.nil?
|
202
207
|
|
203
208
|
raise ArgumentError.new("positive_examples must be a hash") unless positive_examples.is_a?(Hash)
|
@@ -253,6 +258,8 @@ module IBMWatson
|
|
253
258
|
# return a brief list of classifiers.
|
254
259
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
255
260
|
def list_classifiers(verbose: nil)
|
261
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
262
|
+
|
256
263
|
headers = {
|
257
264
|
}
|
258
265
|
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V3", "list_classifiers")
|
@@ -282,6 +289,8 @@ module IBMWatson
|
|
282
289
|
# @param classifier_id [String] The ID of the classifier.
|
283
290
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
284
291
|
def get_classifier(classifier_id:)
|
292
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
293
|
+
|
285
294
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
286
295
|
|
287
296
|
headers = {
|
@@ -350,6 +359,8 @@ module IBMWatson
|
|
350
359
|
# @param negative_examples_filename [String] The filename for negative_examples.
|
351
360
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
352
361
|
def update_classifier(classifier_id:, positive_examples: nil, negative_examples: nil, negative_examples_filename: nil)
|
362
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
363
|
+
|
353
364
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
354
365
|
|
355
366
|
raise ArgumentError.new("positive_examples must be a hash") unless positive_examples.nil? || positive_examples.is_a?(Hash)
|
@@ -401,6 +412,8 @@ module IBMWatson
|
|
401
412
|
# @param classifier_id [String] The ID of the classifier.
|
402
413
|
# @return [nil]
|
403
414
|
def delete_classifier(classifier_id:)
|
415
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
416
|
+
|
404
417
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
405
418
|
|
406
419
|
headers = {
|
@@ -435,6 +448,8 @@ module IBMWatson
|
|
435
448
|
# @param classifier_id [String] The ID of the classifier.
|
436
449
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
437
450
|
def get_core_ml_model(classifier_id:)
|
451
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
452
|
+
|
438
453
|
raise ArgumentError.new("classifier_id must be provided") if classifier_id.nil?
|
439
454
|
|
440
455
|
headers = {
|
@@ -474,6 +489,8 @@ module IBMWatson
|
|
474
489
|
# @param customer_id [String] The customer ID for which all data is to be deleted.
|
475
490
|
# @return [nil]
|
476
491
|
def delete_user_data(customer_id:)
|
492
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
493
|
+
|
477
494
|
raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
|
478
495
|
|
479
496
|
headers = {
|
@@ -13,9 +13,16 @@
|
|
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
|
-
#
|
18
|
-
#
|
16
|
+
#
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.19.0-be3b4618-20201113-200858
|
18
|
+
#
|
19
|
+
# IBM Watson™ Visual Recognition is discontinued. Existing instances are supported
|
20
|
+
# until 1 December 2021, but as of 7 January 2021, you can't create instances. Any
|
21
|
+
# instance that is provisioned on 1 December 2021 will be deleted.
|
22
|
+
# {: deprecated}
|
23
|
+
#
|
24
|
+
# Provide images to the IBM Watson Visual Recognition service for analysis. The service
|
25
|
+
# detects objects based on a set of images with training data.
|
19
26
|
|
20
27
|
require "concurrent"
|
21
28
|
require "erb"
|
@@ -30,34 +37,28 @@ module IBMWatson
|
|
30
37
|
class VisualRecognitionV4 < IBMCloudSdkCore::BaseService
|
31
38
|
include Concurrent::Async
|
32
39
|
DEFAULT_SERVICE_NAME = "visual_recognition"
|
33
|
-
DEFAULT_SERVICE_URL = "https://
|
40
|
+
DEFAULT_SERVICE_URL = "https://api.us-south.visual-recognition.watson.cloud.ibm.com"
|
41
|
+
attr_accessor :version
|
34
42
|
##
|
35
43
|
# @!method initialize(args)
|
36
44
|
# Construct a new client for the Visual Recognition service.
|
37
45
|
#
|
38
46
|
# @param args [Hash] The args to initialize with
|
39
|
-
# @option args version [String]
|
40
|
-
#
|
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.
|
47
|
+
# @option args version [String] Release date of the API version you want to use. Specify dates in YYYY-MM-DD
|
48
|
+
# format. The current version is `2019-02-11`.
|
49
49
|
# @option args service_url [String] The base service URL to use when contacting the service.
|
50
50
|
# The base service_url may differ between IBM Cloud regions.
|
51
51
|
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
|
52
52
|
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
|
53
53
|
# any external configuration, if applicable.
|
54
54
|
def initialize(args = {})
|
55
|
+
warn "On 1 December 2021, Visual Recognition will no longer be available. For more information, see https://github.com/watson-developer-cloud/ruby-sdk/tree/master#visual-recognition-deprecation."
|
55
56
|
@__async_initialized__ = false
|
56
57
|
defaults = {}
|
57
|
-
defaults[:version] = nil
|
58
58
|
defaults[:service_url] = DEFAULT_SERVICE_URL
|
59
59
|
defaults[:service_name] = DEFAULT_SERVICE_NAME
|
60
60
|
defaults[:authenticator] = nil
|
61
|
+
defaults[:version] = nil
|
61
62
|
user_service_url = args[:service_url] unless args[:service_url].nil?
|
62
63
|
args = defaults.merge(args)
|
63
64
|
@version = args[:version]
|
@@ -101,6 +102,8 @@ module IBMWatson
|
|
101
102
|
# @param threshold [Float] The minimum score a feature must have to be returned.
|
102
103
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
103
104
|
def analyze(collection_ids:, features:, images_file: nil, image_url: nil, threshold: nil)
|
105
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
106
|
+
|
104
107
|
raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
|
105
108
|
|
106
109
|
raise ArgumentError.new("features must be provided") if features.nil?
|
@@ -170,6 +173,8 @@ module IBMWatson
|
|
170
173
|
# @param description [String] The description of the collection.
|
171
174
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
172
175
|
def create_collection(name: nil, description: nil)
|
176
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
177
|
+
|
173
178
|
headers = {
|
174
179
|
}
|
175
180
|
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V4", "create_collection")
|
@@ -203,6 +208,8 @@ module IBMWatson
|
|
203
208
|
# Retrieves a list of collections for the service instance.
|
204
209
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
205
210
|
def list_collections
|
211
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
212
|
+
|
206
213
|
headers = {
|
207
214
|
}
|
208
215
|
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V4", "list_collections")
|
@@ -231,6 +238,8 @@ module IBMWatson
|
|
231
238
|
# @param collection_id [String] The identifier of the collection.
|
232
239
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
233
240
|
def get_collection(collection_id:)
|
241
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
242
|
+
|
234
243
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
235
244
|
|
236
245
|
headers = {
|
@@ -267,6 +276,8 @@ module IBMWatson
|
|
267
276
|
# @param description [String] The description of the collection.
|
268
277
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
269
278
|
def update_collection(collection_id:, name: nil, description: nil)
|
279
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
280
|
+
|
270
281
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
271
282
|
|
272
283
|
headers = {
|
@@ -303,6 +314,8 @@ module IBMWatson
|
|
303
314
|
# @param collection_id [String] The identifier of the collection.
|
304
315
|
# @return [nil]
|
305
316
|
def delete_collection(collection_id:)
|
317
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
318
|
+
|
306
319
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
307
320
|
|
308
321
|
headers = {
|
@@ -342,6 +355,8 @@ module IBMWatson
|
|
342
355
|
# @param model_format [String] The format of the returned model.
|
343
356
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
344
357
|
def get_model_file(collection_id:, feature:, model_format:)
|
358
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
359
|
+
|
345
360
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
346
361
|
|
347
362
|
raise ArgumentError.new("feature must be provided") if feature.nil?
|
@@ -405,6 +420,8 @@ module IBMWatson
|
|
405
420
|
# than 32 characters.
|
406
421
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
407
422
|
def add_images(collection_id:, images_file: nil, image_url: nil, training_data: nil)
|
423
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
424
|
+
|
408
425
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
409
426
|
|
410
427
|
headers = {
|
@@ -454,6 +471,8 @@ module IBMWatson
|
|
454
471
|
# @param collection_id [String] The identifier of the collection.
|
455
472
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
456
473
|
def list_images(collection_id:)
|
474
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
475
|
+
|
457
476
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
458
477
|
|
459
478
|
headers = {
|
@@ -485,6 +504,8 @@ module IBMWatson
|
|
485
504
|
# @param image_id [String] The identifier of the image.
|
486
505
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
487
506
|
def get_image_details(collection_id:, image_id:)
|
507
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
508
|
+
|
488
509
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
489
510
|
|
490
511
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -518,6 +539,8 @@ module IBMWatson
|
|
518
539
|
# @param image_id [String] The identifier of the image.
|
519
540
|
# @return [nil]
|
520
541
|
def delete_image(collection_id:, image_id:)
|
542
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
543
|
+
|
521
544
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
522
545
|
|
523
546
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -554,6 +577,8 @@ module IBMWatson
|
|
554
577
|
# For example, an original 800 x 1000 image is resized to 160 x 200 pixels.
|
555
578
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
556
579
|
def get_jpeg_image(collection_id:, image_id:, size: nil)
|
580
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
581
|
+
|
557
582
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
558
583
|
|
559
584
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -590,6 +615,8 @@ module IBMWatson
|
|
590
615
|
# @param collection_id [String] The identifier of the collection.
|
591
616
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
592
617
|
def list_object_metadata(collection_id:)
|
618
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
619
|
+
|
593
620
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
594
621
|
|
595
622
|
headers = {
|
@@ -625,6 +652,8 @@ module IBMWatson
|
|
625
652
|
# `sys-`.
|
626
653
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
627
654
|
def update_object_metadata(collection_id:, object:, new_object:)
|
655
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
656
|
+
|
628
657
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
629
658
|
|
630
659
|
raise ArgumentError.new("object must be provided") if object.nil?
|
@@ -665,6 +694,8 @@ module IBMWatson
|
|
665
694
|
# @param object [String] The name of the object.
|
666
695
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
667
696
|
def get_object_metadata(collection_id:, object:)
|
697
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
698
|
+
|
668
699
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
669
700
|
|
670
701
|
raise ArgumentError.new("object must be provided") if object.nil?
|
@@ -699,6 +730,8 @@ module IBMWatson
|
|
699
730
|
# @param object [String] The name of the object.
|
700
731
|
# @return [nil]
|
701
732
|
def delete_object(collection_id:, object:)
|
733
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
734
|
+
|
702
735
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
703
736
|
|
704
737
|
raise ArgumentError.new("object must be provided") if object.nil?
|
@@ -736,6 +769,8 @@ module IBMWatson
|
|
736
769
|
# @param collection_id [String] The identifier of the collection.
|
737
770
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
738
771
|
def train(collection_id:)
|
772
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
773
|
+
|
739
774
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
740
775
|
|
741
776
|
headers = {
|
@@ -777,6 +812,8 @@ module IBMWatson
|
|
777
812
|
# @param objects [Array[TrainingDataObject]] Training data for specific objects.
|
778
813
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
779
814
|
def add_image_training_data(collection_id:, image_id:, objects: nil)
|
815
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
816
|
+
|
780
817
|
raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
|
781
818
|
|
782
819
|
raise ArgumentError.new("image_id must be provided") if image_id.nil?
|
@@ -812,14 +849,16 @@ module IBMWatson
|
|
812
849
|
# Get training usage.
|
813
850
|
# Information about the completed training events. You can use this information to
|
814
851
|
# determine how close you are to the training limits for the month.
|
815
|
-
# @param start_time [
|
852
|
+
# @param start_time [Time] The earliest day to include training events. Specify dates in YYYY-MM-DD format.
|
816
853
|
# If empty or not specified, the earliest training event is included.
|
817
|
-
# @param end_time [
|
854
|
+
# @param end_time [Time] The most recent day to include training events. Specify dates in YYYY-MM-DD
|
818
855
|
# format. All events for the day are included. If empty or not specified, the
|
819
856
|
# current day is used. Specify the same value as `start_time` to request events for
|
820
857
|
# a single day.
|
821
858
|
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
|
822
859
|
def get_training_usage(start_time: nil, end_time: nil)
|
860
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
861
|
+
|
823
862
|
headers = {
|
824
863
|
}
|
825
864
|
sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V4", "get_training_usage")
|
@@ -859,6 +898,8 @@ module IBMWatson
|
|
859
898
|
# @param customer_id [String] The customer ID for which all data is to be deleted.
|
860
899
|
# @return [nil]
|
861
900
|
def delete_user_data(customer_id:)
|
901
|
+
raise ArgumentError.new("version must be provided") if version.nil?
|
902
|
+
|
862
903
|
raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
|
863
904
|
|
864
905
|
headers = {
|
@@ -382,6 +382,15 @@ if !ENV["ASSISTANT_APIKEY"].nil? && !ENV["ASSISTANT_URL"].nil?
|
|
382
382
|
)
|
383
383
|
assert(service_response.nil?)
|
384
384
|
end
|
385
|
+
|
386
|
+
def test_bulk_classify
|
387
|
+
skip "Covered with the unit test. No need to run it here"
|
388
|
+
|
389
|
+
service_response = service.bulk_classify(
|
390
|
+
workspace_id: ENV["ASSISTANT_WORKSPACE_ID"]
|
391
|
+
)
|
392
|
+
assert(service_response.nil?)
|
393
|
+
end
|
385
394
|
end
|
386
395
|
else
|
387
396
|
class AssistantV1Test < Minitest::Test
|