Credentials
π -> CredentialsProvider
π
ImageAnnotatorSettings.Builder
-> ImageAnnotatorSettings
-> ImageAnnotatorClient
Example (mostly copied from the docs):
Credentials myCredentials = ServiceAccountCredentials.fromStream(
new FileInputStream("path/to/credentials.json"));
ImageAnnotatorSettings imageAnnotatorSettings =
ImageAnnotatorSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ImageAnnotatorClient imageAnnotatorClient =
ImageAnnotatorClient.create(imageAnnotatorSettings);
- ImageAnnotatorClient:
com.google.cloud.vision.v1.ImageAnnotatorClient
π
- ImageAnnotatorSettings:
com.google.cloud.vision.v1.ImageAnnotatorSettings
π
- ClientSettings.Builder:
com.google.api.gax.rpc.ClientSettings.Builder
π
- FixedCredentialsProvider:
com.google.api.gax.core.FixedCredentialsProvider
π
- ServiceAccountCredentials:
com.google.auth.oauth2.ServiceAccountCredentials
π
Note: The above is for Java. The API for C# is different.