Skip to content

Commit 6215164

Browse files
committed
chore(Visual Recognition): Update Visual Recognition example to remove legacy apikey
1 parent 9ff84b1 commit 6215164

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,7 @@ void Start()
8888
private IEnumerator CreateService()
8989
{
9090
Credentials credentials = null;
91-
if (!string.IsNullOrEmpty(_apikey))
92-
{
93-
// Authenticate using apikey
94-
credentials = new Credentials(_apikey, _serviceUrl);
95-
}
96-
else if (!string.IsNullOrEmpty(_iamApikey))
91+
if (!string.IsNullOrEmpty(_iamApikey))
9792
{
9893
// Authenticate using iamApikey
9994
TokenOptions tokenOptions = new TokenOptions()
@@ -110,7 +105,7 @@ private IEnumerator CreateService()
110105
}
111106
else
112107
{
113-
throw new WatsonException("Please provide either CF apikey or IAM apikey to authenticate the service.");
108+
throw new WatsonException("Please provide IAM apikey to authenticate the service.");
114109
}
115110

116111
// Create credential and instantiate service

0 commit comments

Comments
 (0)