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
2222
2323``` java
2424LanguageTranslator 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);
2629
2730TranslateOptions translateOptions = new TranslateOptions .Builder ()
2831 .addText(" hello" )
Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ following picture.
2424
2525``` java
2626VisualRecognition 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);
2831
2932System . out. println(" Classify an image" );
3033ClassifyOptions options = new ClassifyOptions .Builder ()
You can’t perform that action at this time.
0 commit comments