ibm_watson 0.20.1 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +46 -60
- data/lib/ibm_watson.rb +0 -2
- data/lib/ibm_watson/assistant_v1.rb +82 -60
- data/lib/ibm_watson/assistant_v2.rb +8 -12
- data/lib/ibm_watson/compare_comply_v1.rb +21 -18
- data/lib/ibm_watson/discovery_v1.rb +107 -55
- data/lib/ibm_watson/language_translator_v3.rb +21 -23
- data/lib/ibm_watson/natural_language_classifier_v1.rb +15 -24
- data/lib/ibm_watson/natural_language_understanding_v1.rb +8 -12
- data/lib/ibm_watson/personality_insights_v3.rb +12 -24
- data/lib/ibm_watson/speech_to_text_v1.rb +90 -54
- data/lib/ibm_watson/text_to_speech_v1.rb +38 -32
- data/lib/ibm_watson/tone_analyzer_v3.rb +13 -24
- data/lib/ibm_watson/version.rb +1 -1
- data/lib/ibm_watson/visual_recognition_v3.rb +37 -25
- data/test/integration/test_assistant_v1.rb +8 -4
- data/test/integration/test_assistant_v2.rb +6 -1
- data/test/integration/test_compare_comply_v1.rb +6 -2
- data/test/integration/test_discovery_v1.rb +4 -1
- data/test/integration/test_language_translator_v3.rb +4 -16
- data/test/integration/test_natural_language_classifier_v1.rb +4 -1
- data/test/integration/test_natural_language_understanding_v1.rb +4 -1
- data/test/integration/test_personality_insights_v3.rb +5 -2
- data/test/integration/test_speech_to_text_v1.rb +9 -3
- data/test/integration/test_text_to_speech_v1.rb +5 -2
- data/test/integration/test_tone_analyzer_v3.rb +5 -2
- data/test/integration/test_visual_recognition_v3.rb +5 -2
- data/test/test_helper.rb +2 -0
- data/test/unit/test_assistant_v1.rb +269 -133
- data/test/unit/test_assistant_v2.rb +18 -9
- data/test/unit/test_compare_comply_v1.rb +72 -40
- data/test/unit/test_configure_http_client.rb +4 -2
- data/test/unit/test_discovery_v1.rb +297 -152
- data/test/unit/test_language_translator_v3.rb +52 -13
- data/test/unit/test_natural_language_classifier_v1.rb +10 -4
- data/test/unit/test_natural_language_understanding_v1.rb +25 -10
- data/test/unit/test_personality_insights_v3.rb +20 -8
- data/test/unit/test_speech_to_text_v1.rb +84 -21
- data/test/unit/test_text_to_speech_v1.rb +30 -5
- data/test/unit/test_tone_analyzer_v3.rb +30 -12
- data/test/unit/test_vcap_using_personality_insights.rb +12 -4
- data/test/unit/test_visual_recognition_v3.rb +37 -10
- metadata +8 -8
- data/test/unit/test_watson_service.rb +0 -59
@@ -3,6 +3,7 @@
|
|
3
3
|
require_relative("./../test_helper.rb")
|
4
4
|
SimpleCov.command_name "test:integration"
|
5
5
|
require("minitest/hooks/test")
|
6
|
+
require("ibm_cloud_sdk_core")
|
6
7
|
|
7
8
|
if !ENV["ASSISTANT_APIKEY"].nil? && !ENV["ASSISTANT_URL"].nil?
|
8
9
|
# Integration tests for the Watson Assistant V1 Service
|
@@ -10,10 +11,14 @@ if !ENV["ASSISTANT_APIKEY"].nil? && !ENV["ASSISTANT_URL"].nil?
|
|
10
11
|
include Minitest::Hooks
|
11
12
|
attr_accessor :service
|
12
13
|
def before_all
|
14
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
15
|
+
apikey: ENV["ASSISTANT_APIKEY"],
|
16
|
+
version: "2018-02-16"
|
17
|
+
)
|
13
18
|
@service = IBMWatson::AssistantV1.new(
|
14
|
-
|
19
|
+
version: "2018-02-16",
|
15
20
|
url: ENV["ASSISTANT_URL"],
|
16
|
-
|
21
|
+
authenticator: authenticator
|
17
22
|
)
|
18
23
|
@service.add_default_headers(
|
19
24
|
headers: {
|
@@ -51,8 +56,7 @@ if !ENV["ASSISTANT_APIKEY"].nil? && !ENV["ASSISTANT_URL"].nil?
|
|
51
56
|
|
52
57
|
def test_get_workspace
|
53
58
|
service_response = service.get_workspace(
|
54
|
-
workspace_id: ENV["ASSISTANT_WORKSPACE_ID"]
|
55
|
-
export: false
|
59
|
+
workspace_id: ENV["ASSISTANT_WORKSPACE_ID"]
|
56
60
|
)
|
57
61
|
assert((200..299).cover?(service_response.status))
|
58
62
|
end
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
require_relative("./../test_helper.rb")
|
4
4
|
SimpleCov.command_name "test:integration"
|
5
|
+
require("minitest/hooks/test")
|
6
|
+
require("ibm_cloud_sdk_core")
|
5
7
|
|
6
8
|
if !ENV["ASSISTANT_APIKEY"].nil? && !ENV["ASSISTANT_URL"].nil?
|
7
9
|
# Integration tests for the Watson Assistant V2 Service
|
@@ -9,9 +11,12 @@ if !ENV["ASSISTANT_APIKEY"].nil? && !ENV["ASSISTANT_URL"].nil?
|
|
9
11
|
include Minitest::Hooks
|
10
12
|
attr_accessor :service
|
11
13
|
def before_all
|
14
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
15
|
+
apikey: ENV["ASSISTANT_APIKEY"]
|
16
|
+
)
|
12
17
|
@service = IBMWatson::AssistantV2.new(
|
13
18
|
version: "2018-12-31",
|
14
|
-
|
19
|
+
authenticator: authenticator,
|
15
20
|
url: ENV["ASSISTANT_URL"],
|
16
21
|
assistant_id: ENV["ASSISTANT_ASSISTANT_ID"]
|
17
22
|
)
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative("./../test_helper.rb")
|
4
4
|
require("minitest/hooks/test")
|
5
|
+
require("ibm_cloud_sdk_core")
|
5
6
|
|
6
7
|
if !ENV["COMPARE_COMPLY_APIKEY"].nil?
|
7
8
|
# Integration tests for the Discovery V1 Service
|
@@ -10,9 +11,12 @@ if !ENV["COMPARE_COMPLY_APIKEY"].nil?
|
|
10
11
|
attr_accessor :service, :environment_id, :collection_id
|
11
12
|
|
12
13
|
def before_all
|
14
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
15
|
+
apikey: ENV["ASSISTANT_APIKEY"]
|
16
|
+
)
|
13
17
|
@service = IBMWatson::CompareComplyV1.new(
|
14
|
-
|
15
|
-
|
18
|
+
version: "2018-10-15",
|
19
|
+
authenticator: authenticator
|
16
20
|
)
|
17
21
|
@service.add_default_headers(
|
18
22
|
headers: {
|
@@ -10,8 +10,11 @@ if !ENV["DISCOVERY_APIKEY"].nil? && !ENV["DISCOVERY_URL"].nil?
|
|
10
10
|
attr_accessor :service, :environment_id, :collection_id
|
11
11
|
|
12
12
|
def before_all
|
13
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
14
|
+
apikey: ENV["DISCOVERY_APIKEY"]
|
15
|
+
)
|
13
16
|
@service = IBMWatson::DiscoveryV1.new(
|
14
|
-
|
17
|
+
authenticator: authenticator,
|
15
18
|
url: ENV["DISCOVERY_URL"],
|
16
19
|
version: "2018-03-05"
|
17
20
|
)
|
@@ -10,8 +10,11 @@ if !ENV["LANGUAGE_TRANSLATOR_APIKEY"].nil? && !ENV["LANGUAGE_TRANSLATOR_URL"].ni
|
|
10
10
|
include Minitest::Hooks
|
11
11
|
attr_accessor :service
|
12
12
|
def before_all
|
13
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
14
|
+
apikey: ENV["LANGUAGE_TRANSLATOR_APIKEY"]
|
15
|
+
)
|
13
16
|
@service = IBMWatson::LanguageTranslatorV3.new(
|
14
|
-
|
17
|
+
authenticator: authenticator,
|
15
18
|
url: ENV["LANGUAGE_TRANSLATOR_URL"],
|
16
19
|
version: "2018-05-01"
|
17
20
|
)
|
@@ -59,11 +62,6 @@ if !ENV["LANGUAGE_TRANSLATOR_APIKEY"].nil? && !ENV["LANGUAGE_TRANSLATOR_URL"].ni
|
|
59
62
|
end
|
60
63
|
|
61
64
|
def test_translate_document
|
62
|
-
@service = IBMWatson::LanguageTranslatorV3.new(
|
63
|
-
iam_apikey: ENV["LANGUAGE_TRANSLATOR_APIKEY"],
|
64
|
-
url: ENV["LANGUAGE_TRANSLATOR_URL"],
|
65
|
-
version: "2018-05-01"
|
66
|
-
)
|
67
65
|
@service.add_default_headers(
|
68
66
|
headers: {
|
69
67
|
"X-Watson-Test" => "1"
|
@@ -81,16 +79,6 @@ if !ENV["LANGUAGE_TRANSLATOR_APIKEY"].nil? && !ENV["LANGUAGE_TRANSLATOR_URL"].ni
|
|
81
79
|
end
|
82
80
|
|
83
81
|
def test_list_documents
|
84
|
-
@service = IBMWatson::LanguageTranslatorV3.new(
|
85
|
-
iam_apikey: ENV["LANGUAGE_TRANSLATOR_APIKEY"],
|
86
|
-
url: ENV["LANGUAGE_TRANSLATOR_URL"],
|
87
|
-
version: "2018-05-01"
|
88
|
-
)
|
89
|
-
@service.add_default_headers(
|
90
|
-
headers: {
|
91
|
-
"X-Watson-Test" => "1"
|
92
|
-
}
|
93
|
-
)
|
94
82
|
service_response = service.list_documents.result
|
95
83
|
refute(service_response.nil?)
|
96
84
|
end
|
@@ -10,8 +10,11 @@ if !ENV["NATURAL_LANGUAGE_CLASSIFIER_APIKEY"].nil? && !ENV["NATURAL_LANGUAGE_CLA
|
|
10
10
|
include Minitest::Hooks
|
11
11
|
attr_accessor :service
|
12
12
|
def before_all
|
13
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
14
|
+
apikey: ENV["NATURAL_LANGUAGE_CLASSIFIER_APIKEY"]
|
15
|
+
)
|
13
16
|
@service = IBMWatson::NaturalLanguageClassifierV1.new(
|
14
|
-
|
17
|
+
authenticator: authenticator,
|
15
18
|
url: ENV["NATURAL_LANGUAGE_CLASSIFIER_URL"]
|
16
19
|
)
|
17
20
|
@service.add_default_headers(
|
@@ -9,9 +9,12 @@ if !ENV["NATURAL_LANGUAGE_UNDERSTANDING_APIKEY"].nil? && !ENV["NATURAL_LANGUAGE_
|
|
9
9
|
include Minitest::Hooks
|
10
10
|
attr_accessor :service
|
11
11
|
def before_all
|
12
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
13
|
+
apikey: ENV["NATURAL_LANGUAGE_UNDERSTANDING_APIKEY"]
|
14
|
+
)
|
12
15
|
@service = IBMWatson::NaturalLanguageUnderstandingV1.new(
|
13
16
|
version: "2018-03-16",
|
14
|
-
|
17
|
+
authenticator: authenticator,
|
15
18
|
url: ENV["NATURAL_LANGUAGE_UNDERSTANDING_URL"]
|
16
19
|
)
|
17
20
|
@service.add_default_headers(
|
@@ -9,10 +9,13 @@ if !ENV["PERSONALITY_INSIGHTS_APIKEY"].nil? && !ENV["PERSONALITY_INSIGHTS_URL"].
|
|
9
9
|
include Minitest::Hooks
|
10
10
|
attr_accessor :service
|
11
11
|
def before_all
|
12
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
13
|
+
apikey: ENV["PERSONALITY_INSIGHTS_APIKEY"]
|
14
|
+
)
|
12
15
|
@service = IBMWatson::PersonalityInsightsV3.new(
|
13
16
|
version: "2017-10-13",
|
14
|
-
|
15
|
-
|
17
|
+
url: ENV["PERSONALITY_INSIGHTS_URL"],
|
18
|
+
authenticator: authenticator
|
16
19
|
)
|
17
20
|
@service.add_default_headers(
|
18
21
|
headers: {
|
@@ -28,9 +28,12 @@ if !ENV["SPEECH_TO_TEXT_APIKEY"].nil? && !ENV["SPEECH_TO_TEXT_URL"].nil?
|
|
28
28
|
include Minitest::Hooks
|
29
29
|
attr_accessor :service
|
30
30
|
def before_all
|
31
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
32
|
+
apikey: ENV["SPEECH_TO_TEXT_APIKEY"]
|
33
|
+
)
|
31
34
|
@service = IBMWatson::SpeechToTextV1.new(
|
32
|
-
|
33
|
-
|
35
|
+
url: ENV["SPEECH_TO_TEXT_URL"],
|
36
|
+
authenticator: authenticator
|
34
37
|
)
|
35
38
|
@service.add_default_headers(
|
36
39
|
headers: {
|
@@ -243,8 +246,11 @@ if !ENV["SPEECH_TO_TEXT_APIKEY"].nil? && !ENV["SPEECH_TO_TEXT_URL"].nil?
|
|
243
246
|
audio_file = File.open(Dir.getwd + "/resources/speech.wav")
|
244
247
|
atomic_boolean = Concurrent::AtomicBoolean.new
|
245
248
|
mycallback = MyRecognizeCallback.new(atomic_boolean: atomic_boolean)
|
249
|
+
authenticator = IBMCloudSdkCore::BearerTokenAuthenticator.new(
|
250
|
+
bearer_token: "bogus_iam_access_token"
|
251
|
+
)
|
246
252
|
temp_service = IBMWatson::SpeechToTextV1.new(
|
247
|
-
|
253
|
+
authenticator: authenticator
|
248
254
|
)
|
249
255
|
temp_service.add_default_headers(
|
250
256
|
headers: {
|
@@ -9,9 +9,12 @@ if !ENV["TEXT_TO_SPEECH_APIKEY"].nil? && !ENV["TEXT_TO_SPEECH_URL"].nil?
|
|
9
9
|
include Minitest::Hooks
|
10
10
|
attr_accessor :service
|
11
11
|
def before_all
|
12
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
13
|
+
apikey: ENV["TEXT_TO_SPEECH_APIKEY"]
|
14
|
+
)
|
12
15
|
@service = IBMWatson::TextToSpeechV1.new(
|
13
|
-
|
14
|
-
|
16
|
+
url: ENV["TEXT_TO_SPEECH_URL"],
|
17
|
+
authenticator: authenticator
|
15
18
|
)
|
16
19
|
@service.add_default_headers(
|
17
20
|
headers: {
|
@@ -9,10 +9,13 @@ if !ENV["TONE_ANALYZER_APIKEY"].nil? && !ENV["TONE_ANALYZER_URL"].nil?
|
|
9
9
|
include Minitest::Hooks
|
10
10
|
attr_accessor :service
|
11
11
|
def before_all
|
12
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
13
|
+
apikey: ENV["TONE_ANALYZER_APIKEY"]
|
14
|
+
)
|
12
15
|
@service = IBMWatson::ToneAnalyzerV3.new(
|
13
|
-
iam_apikey: ENV["TONE_ANALYZER_APIKEY"],
|
14
16
|
url: ENV["TONE_ANALYZER_URL"],
|
15
|
-
version: "2017-09-21"
|
17
|
+
version: "2017-09-21",
|
18
|
+
authenticator: authenticator
|
16
19
|
)
|
17
20
|
@service.add_default_headers(
|
18
21
|
headers: {
|
@@ -10,10 +10,13 @@ if !ENV["VISUAL_RECOGNITION_APIKEY"].nil? && !ENV["VISUAL_RECOGNITION_URL"].nil?
|
|
10
10
|
include Minitest::Hooks
|
11
11
|
attr_accessor :service, :classifier_id
|
12
12
|
def before_all
|
13
|
+
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
|
14
|
+
apikey: ENV["VISUAL_RECOGNITION_APIKEY"]
|
15
|
+
)
|
13
16
|
@service = IBMWatson::VisualRecognitionV3.new(
|
14
|
-
iam_apikey: ENV["VISUAL_RECOGNITION_APIKEY"],
|
15
17
|
version: "2018-03-19",
|
16
|
-
url: ENV["VISUAL_RECOGNITION_URL"]
|
18
|
+
url: ENV["VISUAL_RECOGNITION_URL"],
|
19
|
+
authenticator: authenticator
|
17
20
|
)
|
18
21
|
@classifier_id = "doxnotxdeletexsdksxintegration_718351350"
|
19
22
|
@service.add_default_headers(
|
data/test/test_helper.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require("json")
|
4
4
|
require_relative("./../test_helper.rb")
|
5
5
|
require("webmock/minitest")
|
6
|
+
require("ibm_cloud_sdk_core")
|
6
7
|
SimpleCov.command_name "test:unit"
|
7
8
|
|
8
9
|
WebMock.disable_net_connect!(allow_localhost: true)
|
@@ -28,11 +29,14 @@ class AssistantV1Test < Minitest::Test
|
|
28
29
|
"Host" => "gateway.watsonplatform.net"
|
29
30
|
}
|
30
31
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
31
|
-
|
32
|
-
version: "2018-02-16",
|
32
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
33
33
|
username: "username",
|
34
34
|
password: "password"
|
35
35
|
)
|
36
|
+
service = IBMWatson::AssistantV1.new(
|
37
|
+
version: "2018-02-16",
|
38
|
+
authenticator: authenticator
|
39
|
+
)
|
36
40
|
service_response = service.create_counterexample(
|
37
41
|
workspace_id: "boguswid",
|
38
42
|
text: "I want financial advice today."
|
@@ -54,15 +58,18 @@ class AssistantV1Test < Minitest::Test
|
|
54
58
|
body: "{\"text\":\"I want financial advice today.\"}",
|
55
59
|
headers: {
|
56
60
|
"Accept" => "application/json",
|
57
|
-
"Authorization" => "Basic
|
61
|
+
"Authorization" => "Basic dXNlcm5hbWU6cGFzc3dvcmQ=",
|
58
62
|
"Content-Type" => "application/json",
|
59
63
|
"Host" => "gateway.watsonplatform.net"
|
60
64
|
}
|
61
65
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
66
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
67
|
+
username: "username",
|
68
|
+
password: "password"
|
69
|
+
)
|
62
70
|
service = IBMWatson::AssistantV1.new(
|
63
71
|
version: "2018-02-16",
|
64
|
-
|
65
|
-
password: "icp-xyz"
|
72
|
+
authenticator: authenticator
|
66
73
|
)
|
67
74
|
service_response = service.create_counterexample(
|
68
75
|
workspace_id: "boguswid",
|
@@ -91,10 +98,13 @@ class AssistantV1Test < Minitest::Test
|
|
91
98
|
"Host" => "gateway.watsonplatform.net"
|
92
99
|
}
|
93
100
|
).to_return(status: 429, body: error_response.to_json, headers: headers)
|
94
|
-
|
101
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
95
102
|
username: "username",
|
96
|
-
password: "password"
|
97
|
-
|
103
|
+
password: "password"
|
104
|
+
)
|
105
|
+
service = IBMWatson::AssistantV1.new(
|
106
|
+
version: "2018-02-16",
|
107
|
+
authenticator: authenticator
|
98
108
|
)
|
99
109
|
begin
|
100
110
|
service.create_counterexample(
|
@@ -128,10 +138,13 @@ class AssistantV1Test < Minitest::Test
|
|
128
138
|
"Host" => "gateway.watsonplatform.net"
|
129
139
|
}
|
130
140
|
).to_return(status: 407, body: error_response.to_json, headers: headers)
|
131
|
-
|
141
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
132
142
|
username: "username",
|
133
|
-
password: "password"
|
134
|
-
|
143
|
+
password: "password"
|
144
|
+
)
|
145
|
+
service = IBMWatson::AssistantV1.new(
|
146
|
+
version: "2018-02-16",
|
147
|
+
authenticator: authenticator
|
135
148
|
)
|
136
149
|
begin
|
137
150
|
service.create_counterexample(
|
@@ -156,10 +169,13 @@ class AssistantV1Test < Minitest::Test
|
|
156
169
|
"Host" => "gateway.watsonplatform.net"
|
157
170
|
}
|
158
171
|
).to_return(status: 200, body: {}.to_json, headers: headers)
|
159
|
-
|
172
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
160
173
|
username: "username",
|
161
|
-
password: "password"
|
162
|
-
|
174
|
+
password: "password"
|
175
|
+
)
|
176
|
+
service = IBMWatson::AssistantV1.new(
|
177
|
+
version: "2018-02-16",
|
178
|
+
authenticator: authenticator
|
163
179
|
)
|
164
180
|
service_response = service.delete_counterexample(
|
165
181
|
workspace_id: "boguswid",
|
@@ -185,10 +201,13 @@ class AssistantV1Test < Minitest::Test
|
|
185
201
|
"Host" => "gateway.watsonplatform.net"
|
186
202
|
}
|
187
203
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
188
|
-
|
204
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
189
205
|
username: "username",
|
190
|
-
password: "password"
|
191
|
-
|
206
|
+
password: "password"
|
207
|
+
)
|
208
|
+
service = IBMWatson::AssistantV1.new(
|
209
|
+
version: "2018-02-16",
|
210
|
+
authenticator: authenticator
|
192
211
|
)
|
193
212
|
service_response = service.get_counterexample(
|
194
213
|
workspace_id: "boguswid",
|
@@ -226,10 +245,13 @@ class AssistantV1Test < Minitest::Test
|
|
226
245
|
"Host" => "gateway.watsonplatform.net"
|
227
246
|
}
|
228
247
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
229
|
-
|
248
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
230
249
|
username: "username",
|
231
|
-
password: "password"
|
232
|
-
|
250
|
+
password: "password"
|
251
|
+
)
|
252
|
+
service = IBMWatson::AssistantV1.new(
|
253
|
+
version: "2018-02-16",
|
254
|
+
authenticator: authenticator
|
233
255
|
)
|
234
256
|
service_response = service.list_counterexamples(
|
235
257
|
workspace_id: "boguswid"
|
@@ -256,10 +278,13 @@ class AssistantV1Test < Minitest::Test
|
|
256
278
|
"Host" => "gateway.watsonplatform.net"
|
257
279
|
}
|
258
280
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
259
|
-
|
281
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
260
282
|
username: "username",
|
261
|
-
password: "password"
|
262
|
-
|
283
|
+
password: "password"
|
284
|
+
)
|
285
|
+
service = IBMWatson::AssistantV1.new(
|
286
|
+
version: "2018-02-16",
|
287
|
+
authenticator: authenticator
|
263
288
|
)
|
264
289
|
service_response = service.update_counterexample(
|
265
290
|
workspace_id: "boguswid",
|
@@ -292,10 +317,13 @@ class AssistantV1Test < Minitest::Test
|
|
292
317
|
"Host" => "gateway.watsonplatform.net"
|
293
318
|
}
|
294
319
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
295
|
-
|
320
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
296
321
|
username: "username",
|
297
|
-
password: "password"
|
298
|
-
|
322
|
+
password: "password"
|
323
|
+
)
|
324
|
+
service = IBMWatson::AssistantV1.new(
|
325
|
+
version: "2018-02-16",
|
326
|
+
authenticator: authenticator
|
299
327
|
)
|
300
328
|
service_response = service.create_entity(
|
301
329
|
workspace_id: "boguswid",
|
@@ -320,10 +348,13 @@ class AssistantV1Test < Minitest::Test
|
|
320
348
|
"Host" => "gateway.watsonplatform.net"
|
321
349
|
}
|
322
350
|
).to_return(status: 200, body: "{}", headers: headers)
|
323
|
-
|
351
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
324
352
|
username: "username",
|
325
|
-
password: "password"
|
326
|
-
|
353
|
+
password: "password"
|
354
|
+
)
|
355
|
+
service = IBMWatson::AssistantV1.new(
|
356
|
+
version: "2018-02-16",
|
357
|
+
authenticator: authenticator
|
327
358
|
)
|
328
359
|
service_response = service.delete_entity(
|
329
360
|
workspace_id: "boguswid",
|
@@ -353,10 +384,13 @@ class AssistantV1Test < Minitest::Test
|
|
353
384
|
"Host" => "gateway.watsonplatform.net"
|
354
385
|
}
|
355
386
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
356
|
-
|
387
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
357
388
|
username: "username",
|
358
|
-
password: "password"
|
359
|
-
|
389
|
+
password: "password"
|
390
|
+
)
|
391
|
+
service = IBMWatson::AssistantV1.new(
|
392
|
+
version: "2018-02-16",
|
393
|
+
authenticator: authenticator
|
360
394
|
)
|
361
395
|
service_response = service.get_entity(
|
362
396
|
workspace_id: "boguswid",
|
@@ -397,10 +431,13 @@ class AssistantV1Test < Minitest::Test
|
|
397
431
|
"Host" => "gateway.watsonplatform.net"
|
398
432
|
}
|
399
433
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
400
|
-
|
434
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
401
435
|
username: "username",
|
402
|
-
password: "password"
|
403
|
-
|
436
|
+
password: "password"
|
437
|
+
)
|
438
|
+
service = IBMWatson::AssistantV1.new(
|
439
|
+
version: "2018-02-16",
|
440
|
+
authenticator: authenticator
|
404
441
|
)
|
405
442
|
service_response = service.list_entities(
|
406
443
|
workspace_id: "boguswid",
|
@@ -432,10 +469,13 @@ class AssistantV1Test < Minitest::Test
|
|
432
469
|
"Host" => "gateway.watsonplatform.net"
|
433
470
|
}
|
434
471
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
435
|
-
|
472
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
436
473
|
username: "username",
|
437
|
-
password: "password"
|
438
|
-
|
474
|
+
password: "password"
|
475
|
+
)
|
476
|
+
service = IBMWatson::AssistantV1.new(
|
477
|
+
version: "2018-02-16",
|
478
|
+
authenticator: authenticator
|
439
479
|
)
|
440
480
|
service_response = service.update_entity(
|
441
481
|
workspace_id: "boguswid",
|
@@ -464,10 +504,13 @@ class AssistantV1Test < Minitest::Test
|
|
464
504
|
"Host" => "gateway.watsonplatform.net"
|
465
505
|
}
|
466
506
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
467
|
-
|
507
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
468
508
|
username: "username",
|
469
|
-
password: "password"
|
470
|
-
|
509
|
+
password: "password"
|
510
|
+
)
|
511
|
+
service = IBMWatson::AssistantV1.new(
|
512
|
+
version: "2018-02-16",
|
513
|
+
authenticator: authenticator
|
471
514
|
)
|
472
515
|
service_response = service.create_example(
|
473
516
|
workspace_id: "boguswid",
|
@@ -490,10 +533,13 @@ class AssistantV1Test < Minitest::Test
|
|
490
533
|
"Host" => "gateway.watsonplatform.net"
|
491
534
|
}
|
492
535
|
).to_return(status: 200, body: "{}", headers: headers)
|
493
|
-
|
536
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
494
537
|
username: "username",
|
495
|
-
password: "password"
|
496
|
-
|
538
|
+
password: "password"
|
539
|
+
)
|
540
|
+
service = IBMWatson::AssistantV1.new(
|
541
|
+
version: "2018-02-16",
|
542
|
+
authenticator: authenticator
|
497
543
|
)
|
498
544
|
service_response = service.delete_example(
|
499
545
|
workspace_id: "boguswid",
|
@@ -520,10 +566,13 @@ class AssistantV1Test < Minitest::Test
|
|
520
566
|
"Host" => "gateway.watsonplatform.net"
|
521
567
|
}
|
522
568
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
523
|
-
|
569
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
524
570
|
username: "username",
|
525
|
-
password: "password"
|
526
|
-
|
571
|
+
password: "password"
|
572
|
+
)
|
573
|
+
service = IBMWatson::AssistantV1.new(
|
574
|
+
version: "2018-02-16",
|
575
|
+
authenticator: authenticator
|
527
576
|
)
|
528
577
|
service_response = service.get_example(
|
529
578
|
workspace_id: "boguswid",
|
@@ -562,10 +611,13 @@ class AssistantV1Test < Minitest::Test
|
|
562
611
|
"Host" => "gateway.watsonplatform.net"
|
563
612
|
}
|
564
613
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
565
|
-
|
614
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
566
615
|
username: "username",
|
567
|
-
password: "password"
|
568
|
-
|
616
|
+
password: "password"
|
617
|
+
)
|
618
|
+
service = IBMWatson::AssistantV1.new(
|
619
|
+
version: "2018-02-16",
|
620
|
+
authenticator: authenticator
|
569
621
|
)
|
570
622
|
service_response = service.list_examples(
|
571
623
|
workspace_id: "boguswid",
|
@@ -593,10 +645,13 @@ class AssistantV1Test < Minitest::Test
|
|
593
645
|
"Host" => "gateway.watsonplatform.net"
|
594
646
|
}
|
595
647
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
596
|
-
|
648
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
597
649
|
username: "username",
|
598
|
-
password: "password"
|
599
|
-
|
650
|
+
password: "password"
|
651
|
+
)
|
652
|
+
service = IBMWatson::AssistantV1.new(
|
653
|
+
version: "2018-02-16",
|
654
|
+
authenticator: authenticator
|
600
655
|
)
|
601
656
|
service_response = service.update_example(
|
602
657
|
workspace_id: "boguswid",
|
@@ -628,10 +683,13 @@ class AssistantV1Test < Minitest::Test
|
|
628
683
|
"Host" => "gateway.watsonplatform.net"
|
629
684
|
}
|
630
685
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
631
|
-
|
686
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
632
687
|
username: "username",
|
633
|
-
password: "password"
|
634
|
-
|
688
|
+
password: "password"
|
689
|
+
)
|
690
|
+
service = IBMWatson::AssistantV1.new(
|
691
|
+
version: "2018-02-16",
|
692
|
+
authenticator: authenticator
|
635
693
|
)
|
636
694
|
service_response = service.create_intent(
|
637
695
|
workspace_id: "boguswid",
|
@@ -653,10 +711,13 @@ class AssistantV1Test < Minitest::Test
|
|
653
711
|
"Host" => "gateway.watsonplatform.net"
|
654
712
|
}
|
655
713
|
).to_return(status: 200, body: "{}", headers: headers)
|
656
|
-
|
714
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
657
715
|
username: "username",
|
658
|
-
password: "password"
|
659
|
-
|
716
|
+
password: "password"
|
717
|
+
)
|
718
|
+
service = IBMWatson::AssistantV1.new(
|
719
|
+
version: "2018-02-16",
|
720
|
+
authenticator: authenticator
|
660
721
|
)
|
661
722
|
service_response = service.delete_intent(
|
662
723
|
workspace_id: "boguswid",
|
@@ -683,10 +744,13 @@ class AssistantV1Test < Minitest::Test
|
|
683
744
|
"Host" => "gateway.watsonplatform.net"
|
684
745
|
}
|
685
746
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
686
|
-
|
747
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
687
748
|
username: "username",
|
688
|
-
password: "password"
|
689
|
-
|
749
|
+
password: "password"
|
750
|
+
)
|
751
|
+
service = IBMWatson::AssistantV1.new(
|
752
|
+
version: "2018-02-16",
|
753
|
+
authenticator: authenticator
|
690
754
|
)
|
691
755
|
service_response = service.get_intent(
|
692
756
|
workspace_id: "boguswid",
|
@@ -722,10 +786,13 @@ class AssistantV1Test < Minitest::Test
|
|
722
786
|
"Host" => "gateway.watsonplatform.net"
|
723
787
|
}
|
724
788
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
725
|
-
|
789
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
726
790
|
username: "username",
|
727
|
-
password: "password"
|
728
|
-
|
791
|
+
password: "password"
|
792
|
+
)
|
793
|
+
service = IBMWatson::AssistantV1.new(
|
794
|
+
version: "2018-02-16",
|
795
|
+
authenticator: authenticator
|
729
796
|
)
|
730
797
|
service_response = service.list_intents(
|
731
798
|
workspace_id: "boguswid",
|
@@ -754,9 +821,12 @@ class AssistantV1Test < Minitest::Test
|
|
754
821
|
"Host" => "gateway.watsonplatform.net"
|
755
822
|
}
|
756
823
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
757
|
-
|
824
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
758
825
|
username: "username",
|
759
|
-
password: "password"
|
826
|
+
password: "password"
|
827
|
+
)
|
828
|
+
service = IBMWatson::AssistantV1.new(
|
829
|
+
authenticator: authenticator,
|
760
830
|
version: "2018-02-16"
|
761
831
|
)
|
762
832
|
service_response = service.update_intent(
|
@@ -831,10 +901,13 @@ class AssistantV1Test < Minitest::Test
|
|
831
901
|
"Host" => "gateway.watsonplatform.net"
|
832
902
|
}
|
833
903
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
834
|
-
|
904
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
835
905
|
username: "username",
|
836
|
-
password: "password"
|
837
|
-
|
906
|
+
password: "password"
|
907
|
+
)
|
908
|
+
service = IBMWatson::AssistantV1.new(
|
909
|
+
version: "2018-02-16",
|
910
|
+
authenticator: authenticator
|
838
911
|
)
|
839
912
|
service_response = service.list_logs(
|
840
913
|
workspace_id: "boguswid"
|
@@ -913,10 +986,13 @@ class AssistantV1Test < Minitest::Test
|
|
913
986
|
"Host" => "gateway.watsonplatform.net"
|
914
987
|
}
|
915
988
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
916
|
-
|
989
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
917
990
|
username: "username",
|
918
|
-
password: "password"
|
919
|
-
|
991
|
+
password: "password"
|
992
|
+
)
|
993
|
+
service = IBMWatson::AssistantV1.new(
|
994
|
+
version: "2018-02-16",
|
995
|
+
authenticator: authenticator
|
920
996
|
)
|
921
997
|
service_response = service.list_all_logs(
|
922
998
|
filter: "language::en,request.context.metadata.deployment::deployment_1"
|
@@ -925,10 +1001,13 @@ class AssistantV1Test < Minitest::Test
|
|
925
1001
|
end
|
926
1002
|
|
927
1003
|
def test_message
|
928
|
-
|
1004
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
929
1005
|
username: "username",
|
930
|
-
password: "password"
|
931
|
-
|
1006
|
+
password: "password"
|
1007
|
+
)
|
1008
|
+
service = IBMWatson::AssistantV1.new(
|
1009
|
+
version: "2018-02-16",
|
1010
|
+
authenticator: authenticator
|
932
1011
|
)
|
933
1012
|
# service.set_default_headers("x-watson-learning-opt-out" => true)
|
934
1013
|
workspace_id = "f8fdbc65-e0bd-4e43-b9f8-2975a366d4ec"
|
@@ -1016,10 +1095,13 @@ class AssistantV1Test < Minitest::Test
|
|
1016
1095
|
"Host" => "gateway.watsonplatform.net"
|
1017
1096
|
}
|
1018
1097
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
1019
|
-
|
1098
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1020
1099
|
username: "username",
|
1021
|
-
password: "password"
|
1022
|
-
|
1100
|
+
password: "password"
|
1101
|
+
)
|
1102
|
+
service = IBMWatson::AssistantV1.new(
|
1103
|
+
version: "2018-02-16",
|
1104
|
+
authenticator: authenticator
|
1023
1105
|
)
|
1024
1106
|
service_response = service.create_synonym(
|
1025
1107
|
workspace_id: "boguswid",
|
@@ -1042,10 +1124,13 @@ class AssistantV1Test < Minitest::Test
|
|
1042
1124
|
"Host" => "gateway.watsonplatform.net"
|
1043
1125
|
}
|
1044
1126
|
).to_return(status: 200, body: "", headers: headers)
|
1045
|
-
|
1127
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1046
1128
|
username: "username",
|
1047
|
-
password: "password"
|
1048
|
-
|
1129
|
+
password: "password"
|
1130
|
+
)
|
1131
|
+
service = IBMWatson::AssistantV1.new(
|
1132
|
+
version: "2018-02-16",
|
1133
|
+
authenticator: authenticator
|
1049
1134
|
)
|
1050
1135
|
service_response = service.delete_synonym(
|
1051
1136
|
workspace_id: "boguswid",
|
@@ -1073,10 +1158,13 @@ class AssistantV1Test < Minitest::Test
|
|
1073
1158
|
"Host" => "gateway.watsonplatform.net"
|
1074
1159
|
}
|
1075
1160
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1076
|
-
|
1161
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1077
1162
|
username: "username",
|
1078
|
-
password: "password"
|
1079
|
-
|
1163
|
+
password: "password"
|
1164
|
+
)
|
1165
|
+
service = IBMWatson::AssistantV1.new(
|
1166
|
+
version: "2018-02-16",
|
1167
|
+
authenticator: authenticator
|
1080
1168
|
)
|
1081
1169
|
service_response = service.get_synonym(
|
1082
1170
|
workspace_id: "boguswid",
|
@@ -1119,10 +1207,13 @@ class AssistantV1Test < Minitest::Test
|
|
1119
1207
|
"Host" => "gateway.watsonplatform.net"
|
1120
1208
|
}
|
1121
1209
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1122
|
-
|
1210
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1123
1211
|
username: "username",
|
1124
|
-
password: "password"
|
1125
|
-
|
1212
|
+
password: "password"
|
1213
|
+
)
|
1214
|
+
service = IBMWatson::AssistantV1.new(
|
1215
|
+
version: "2018-02-16",
|
1216
|
+
authenticator: authenticator
|
1126
1217
|
)
|
1127
1218
|
service_response = service.list_synonyms(
|
1128
1219
|
workspace_id: "boguswid",
|
@@ -1151,10 +1242,13 @@ class AssistantV1Test < Minitest::Test
|
|
1151
1242
|
"Host" => "gateway.watsonplatform.net"
|
1152
1243
|
}
|
1153
1244
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1154
|
-
|
1245
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1155
1246
|
username: "username",
|
1156
|
-
password: "password"
|
1157
|
-
|
1247
|
+
password: "password"
|
1248
|
+
)
|
1249
|
+
service = IBMWatson::AssistantV1.new(
|
1250
|
+
version: "2018-02-16",
|
1251
|
+
authenticator: authenticator
|
1158
1252
|
)
|
1159
1253
|
service_response = service.update_synonym(
|
1160
1254
|
workspace_id: "boguswid",
|
@@ -1187,10 +1281,13 @@ class AssistantV1Test < Minitest::Test
|
|
1187
1281
|
"Host" => "gateway.watsonplatform.net"
|
1188
1282
|
}
|
1189
1283
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
1190
|
-
|
1284
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1191
1285
|
username: "username",
|
1192
|
-
password: "password"
|
1193
|
-
|
1286
|
+
password: "password"
|
1287
|
+
)
|
1288
|
+
service = IBMWatson::AssistantV1.new(
|
1289
|
+
version: "2018-02-16",
|
1290
|
+
authenticator: authenticator
|
1194
1291
|
)
|
1195
1292
|
service_response = service.create_value(
|
1196
1293
|
workspace_id: "boguswid",
|
@@ -1212,10 +1309,13 @@ class AssistantV1Test < Minitest::Test
|
|
1212
1309
|
"Host" => "gateway.watsonplatform.net"
|
1213
1310
|
}
|
1214
1311
|
).to_return(status: 200, body: "", headers: headers)
|
1215
|
-
|
1312
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1216
1313
|
username: "username",
|
1217
|
-
password: "password"
|
1218
|
-
|
1314
|
+
password: "password"
|
1315
|
+
)
|
1316
|
+
service = IBMWatson::AssistantV1.new(
|
1317
|
+
version: "2018-02-16",
|
1318
|
+
authenticator: authenticator
|
1219
1319
|
)
|
1220
1320
|
service_response = service.delete_value(
|
1221
1321
|
workspace_id: "boguswid",
|
@@ -1246,10 +1346,13 @@ class AssistantV1Test < Minitest::Test
|
|
1246
1346
|
"Host" => "gateway.watsonplatform.net"
|
1247
1347
|
}
|
1248
1348
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1249
|
-
|
1349
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1250
1350
|
username: "username",
|
1251
|
-
password: "password"
|
1252
|
-
|
1351
|
+
password: "password"
|
1352
|
+
)
|
1353
|
+
service = IBMWatson::AssistantV1.new(
|
1354
|
+
version: "2018-02-16",
|
1355
|
+
authenticator: authenticator
|
1253
1356
|
)
|
1254
1357
|
service_response = service.get_value(
|
1255
1358
|
workspace_id: "boguswid",
|
@@ -1291,10 +1394,13 @@ class AssistantV1Test < Minitest::Test
|
|
1291
1394
|
"Host" => "gateway.watsonplatform.net"
|
1292
1395
|
}
|
1293
1396
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1294
|
-
|
1397
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1295
1398
|
username: "username",
|
1296
|
-
password: "password"
|
1297
|
-
|
1399
|
+
password: "password"
|
1400
|
+
)
|
1401
|
+
service = IBMWatson::AssistantV1.new(
|
1402
|
+
version: "2018-02-16",
|
1403
|
+
authenticator: authenticator
|
1298
1404
|
)
|
1299
1405
|
service_response = service.list_values(
|
1300
1406
|
workspace_id: "boguswid",
|
@@ -1327,10 +1433,13 @@ class AssistantV1Test < Minitest::Test
|
|
1327
1433
|
"Host" => "gateway.watsonplatform.net"
|
1328
1434
|
}
|
1329
1435
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1330
|
-
|
1436
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1331
1437
|
username: "username",
|
1332
|
-
password: "password"
|
1333
|
-
|
1438
|
+
password: "password"
|
1439
|
+
)
|
1440
|
+
service = IBMWatson::AssistantV1.new(
|
1441
|
+
version: "2018-02-16",
|
1442
|
+
authenticator: authenticator
|
1334
1443
|
)
|
1335
1444
|
service_response = service.update_value(
|
1336
1445
|
workspace_id: "boguswid",
|
@@ -1366,10 +1475,13 @@ class AssistantV1Test < Minitest::Test
|
|
1366
1475
|
"Host" => "gateway.watsonplatform.net"
|
1367
1476
|
}
|
1368
1477
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
1369
|
-
|
1478
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1370
1479
|
username: "username",
|
1371
|
-
password: "password"
|
1372
|
-
|
1480
|
+
password: "password"
|
1481
|
+
)
|
1482
|
+
service = IBMWatson::AssistantV1.new(
|
1483
|
+
version: "2018-02-16",
|
1484
|
+
authenticator: authenticator
|
1373
1485
|
)
|
1374
1486
|
service_response = service.create_workspace(
|
1375
1487
|
name: "Pizza app",
|
@@ -1393,10 +1505,13 @@ class AssistantV1Test < Minitest::Test
|
|
1393
1505
|
"Host" => "gateway.watsonplatform.net"
|
1394
1506
|
}
|
1395
1507
|
).to_return(status: 200, body: "", headers: headers)
|
1396
|
-
|
1508
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1397
1509
|
username: "username",
|
1398
|
-
password: "password"
|
1399
|
-
|
1510
|
+
password: "password"
|
1511
|
+
)
|
1512
|
+
service = IBMWatson::AssistantV1.new(
|
1513
|
+
version: "2018-02-16",
|
1514
|
+
authenticator: authenticator
|
1400
1515
|
)
|
1401
1516
|
service_response = service.delete_workspace(
|
1402
1517
|
workspace_id: "boguswid"
|
@@ -1427,10 +1542,13 @@ class AssistantV1Test < Minitest::Test
|
|
1427
1542
|
"Host" => "gateway.watsonplatform.net"
|
1428
1543
|
}
|
1429
1544
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1430
|
-
|
1545
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1431
1546
|
username: "username",
|
1432
|
-
password: "password"
|
1433
|
-
|
1547
|
+
password: "password"
|
1548
|
+
)
|
1549
|
+
service = IBMWatson::AssistantV1.new(
|
1550
|
+
version: "2018-02-16",
|
1551
|
+
authenticator: authenticator
|
1434
1552
|
)
|
1435
1553
|
service_response = service.get_workspace(
|
1436
1554
|
workspace_id: "boguswid",
|
@@ -1468,10 +1586,13 @@ class AssistantV1Test < Minitest::Test
|
|
1468
1586
|
"Host" => "gateway.watsonplatform.net"
|
1469
1587
|
}
|
1470
1588
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1471
|
-
|
1589
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1472
1590
|
username: "username",
|
1473
|
-
password: "password"
|
1474
|
-
|
1591
|
+
password: "password"
|
1592
|
+
)
|
1593
|
+
service = IBMWatson::AssistantV1.new(
|
1594
|
+
version: "2018-02-16",
|
1595
|
+
authenticator: authenticator
|
1475
1596
|
)
|
1476
1597
|
service_response = service.list_workspaces
|
1477
1598
|
assert_equal(response, service_response.result)
|
@@ -1500,10 +1621,13 @@ class AssistantV1Test < Minitest::Test
|
|
1500
1621
|
"Host" => "gateway.watsonplatform.net"
|
1501
1622
|
}
|
1502
1623
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1503
|
-
|
1624
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1504
1625
|
username: "username",
|
1505
|
-
password: "password"
|
1506
|
-
|
1626
|
+
password: "password"
|
1627
|
+
)
|
1628
|
+
service = IBMWatson::AssistantV1.new(
|
1629
|
+
version: "2018-02-16",
|
1630
|
+
authenticator: authenticator
|
1507
1631
|
)
|
1508
1632
|
service_response = service.update_workspace(
|
1509
1633
|
workspace_id: "pizza_app-e0f3",
|
@@ -1517,10 +1641,13 @@ class AssistantV1Test < Minitest::Test
|
|
1517
1641
|
end
|
1518
1642
|
|
1519
1643
|
def test_dialog_nodes
|
1520
|
-
|
1644
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1521
1645
|
username: "username",
|
1522
|
-
password: "password"
|
1523
|
-
|
1646
|
+
password: "password"
|
1647
|
+
)
|
1648
|
+
service = IBMWatson::AssistantV1.new(
|
1649
|
+
version: "2018-02-16",
|
1650
|
+
authenticator: authenticator
|
1524
1651
|
)
|
1525
1652
|
headers = {
|
1526
1653
|
"Content-Type" => "application/json"
|
@@ -1597,10 +1724,13 @@ class AssistantV1Test < Minitest::Test
|
|
1597
1724
|
"Host" => "gateway.watsonplatform.net"
|
1598
1725
|
}
|
1599
1726
|
).to_return(status: 200, body: "", headers: headers)
|
1600
|
-
|
1727
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1601
1728
|
username: "username",
|
1602
|
-
password: "password"
|
1603
|
-
|
1729
|
+
password: "password"
|
1730
|
+
)
|
1731
|
+
service = IBMWatson::AssistantV1.new(
|
1732
|
+
version: "2018-02-16",
|
1733
|
+
authenticator: authenticator
|
1604
1734
|
)
|
1605
1735
|
service_response = service.delete_user_data(
|
1606
1736
|
customer_id: "id"
|
@@ -1609,10 +1739,13 @@ class AssistantV1Test < Minitest::Test
|
|
1609
1739
|
end
|
1610
1740
|
|
1611
1741
|
def test_update_dialog_node
|
1612
|
-
|
1742
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1613
1743
|
username: "username",
|
1614
|
-
password: "password"
|
1615
|
-
|
1744
|
+
password: "password"
|
1745
|
+
)
|
1746
|
+
service = IBMWatson::AssistantV1.new(
|
1747
|
+
version: "2018-02-16",
|
1748
|
+
authenticator: authenticator
|
1616
1749
|
)
|
1617
1750
|
stub_request(:post, "https://gateway.watsonplatform.net/assistant/api/v1/workspaces/workspace_id/dialog_nodes/dialog_node?version=2018-02-16")
|
1618
1751
|
.with(
|
@@ -1634,10 +1767,13 @@ class AssistantV1Test < Minitest::Test
|
|
1634
1767
|
end
|
1635
1768
|
|
1636
1769
|
def test_list_mentions
|
1637
|
-
|
1770
|
+
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
1638
1771
|
username: "username",
|
1639
|
-
password: "password"
|
1640
|
-
|
1772
|
+
password: "password"
|
1773
|
+
)
|
1774
|
+
service = IBMWatson::AssistantV1.new(
|
1775
|
+
version: "2018-02-16",
|
1776
|
+
authenticator: authenticator
|
1641
1777
|
)
|
1642
1778
|
stub_request(:get, "https://gateway.watsonplatform.net/assistant/api/v1/workspaces/workspace_id/entities/entity/mentions?export=true&include_audit=true&version=2018-02-16")
|
1643
1779
|
.with(
|