Skip to content

Commit b67b4ee

Browse files
maxnussbaumGERMAN ATTANASIO RUIZ
authored andcommitted
chore(examples): Adjust examples for iam future migration
1 parent 43314dc commit b67b4ee

8 files changed

+27
-19
lines changed

examples/assistant_v1.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
require("watson_apis/assistant_v1")
22

33
assistant = AssistantV1(
4-
username: "YOUR SERVICE USERNAME",
5-
password: "YOUR SERVICE PASSWORD",
4+
# username: "YOUR SERVICE USERNAME",
5+
# password: "YOUR SERVICE PASSWORD",
6+
iam_api_key: "IAM API KEY",
67
version: "2018-02-16"
78
)
89

examples/discovery_v1.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
require("watson_apis/discovery_v1")
22

33
discovery = WatsonAPIs::DiscoveryV1.new(
4-
version: "2018-03-05",
5-
username: "username",
6-
password: "password"
4+
# username: "username",
5+
# password: "password",
6+
iam_api_key: "IAM API KEY",
7+
version: "2018-03-05"
78
)
89

910
environments = discovery.list_environments.body

examples/natural_language_classifier_v1.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
require("watson_apis/natural_language_classifier_v1")
22

33
natural_language_classifier = WatsonAPIs::NaturalLanguageClassifierV1.new(
4-
username: "YOUR SERVICE USERNAME",
5-
password: "YOUR SERVICE PASSWORD"
4+
# username: "YOUR SERVICE USERNAME",
5+
# password: "YOUR SERVICE PASSWORD"
6+
iam_api_key: "IAM API KEY"
67
)
78

89
classifiers = natural_language_classifier.list_classifiers.body

examples/natural_language_understanding_v1.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
require("watson_apis/natural_language_understanding_v1")
22

33
natural_language_understanding = WatsonAPIs::NaturalLanguageUnderstandingV1.new(
4-
version: "2018-03-16",
5-
username: "YOUR SERVICE USERNAME",
6-
password: "YOUR SERVICE PASSWORD"
4+
# username: "YOUR SERVICE USERNAME",
5+
# password: "YOUR SERVICE PASSWORD",
6+
iam_api_key: "IAM API KEY",
7+
version: "2018-03-16"
78
)
89

910
response = natural_language_understanding.analyze(

examples/personality_insights_v3.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
# ../resources/personality-v3-expect2.txt
55

66
personality_insights = WatsonAPIs::PersonalityInsightsV3.new(
7-
version: "2017-10-13",
8-
username: "YOUR SERVICE USERNAME",
9-
password: "YOUR SERVICE PASSWORD"
7+
# username: "YOUR SERVICE USERNAME",
8+
# password: "YOUR SERVICE PASSWORD",
9+
iam_api_key: "IAM API KEY",
10+
version: "2017-10-13"
1011
)
1112
profile = nil
1213
File.open(Dir.getwd + "/resources/personality-v3.json") do |profile_json|

examples/speech_to_text_v1.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
require("watson_apis/recognize_callback")
33

44
speech_to_text = WatsonAPIs::SpeechToTextV1.new(
5-
username: "YOUR SERVICE USERNAME",
6-
password: "YOUR SERVICE PASSWORD"
5+
# username: "YOUR SERVICE USERNAME",
6+
# password: "YOUR SERVICE PASSWORD"
7+
iam_api_key: "IAM API KEY"
78
)
89

910
p speech_to_text.list_models.body

examples/text_to_speech_v1.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
require("watson_apis/text_to_speech_v1")
22

33
text_to_speech = WatsonAPIs::TextToSpeechV1.new(
4-
username: "YOUR SERVICE USERNAME",
5-
password: "YOUR SERVICE PASSWORD"
4+
# username: "YOUR SERVICE USERNAME",
5+
# password: "YOUR SERVICE PASSWORD"
6+
iam_api_key: "IAM API KEY"
67
)
78

89
p text_to_speech.list_voices.body

examples/tone_analyzer_v3.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
require("json")
33

44
tone_analyzer = ToneAnalyzerV3(
5-
username: "YOUR SERVICE USERNAME",
6-
password: "YOUR SERVICE PASSWORD",
5+
# username: "YOUR SERVICE USERNAME",
6+
# password: "YOUR SERVICE PASSWORD",
7+
iam_api_key: "IAM API KEY",
78
version: "2017-09-21"
89
)
910

0 commit comments

Comments
 (0)