File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ Example: Translate 'hello' from English to Spanish using the [Language Translato
22
22
23
23
``` java
24
24
LanguageTranslator service = new LanguageTranslator ();
25
- service. setUsernameAndPassword(" <username>" , " <password>" );
25
+ IamOptions iamOptions = new IamOptions .Builder ()
26
+ .apiKey(" <iam_api_key>" )
27
+ .build();
28
+ service. setIamCredentials(iamOptions);
26
29
27
30
TranslateOptions translateOptions = new TranslateOptions .Builder ()
28
31
.addText(" hello" )
Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ following picture.
24
24
25
25
``` java
26
26
VisualRecognition service = new VisualRecognition (" 2016-05-20" );
27
- service. setApiKey(" <api-key>" );
27
+ IamOptions iamOptions = new IamOptions .Builder ()
28
+ .apiKey(" <iam_api_key>" )
29
+ .build();
30
+ service. setIamCredentials(iamOptions);
28
31
29
32
System . out. println(" Classify an image" );
30
33
ClassifyOptions options = new ClassifyOptions .Builder ()
You can’t perform that action at this time.
0 commit comments