Class ServiceAccountCredentials.Builder
java.lang.Object
com.google.auth.oauth2.OAuth2Credentials.Builder
com.google.auth.oauth2.GoogleCredentials.Builder
com.google.auth.oauth2.ServiceAccountCredentials.Builder
- Enclosing class:
ServiceAccountCredentials
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Stringprivate booleanprivate Collection<String> private intprivate PrivateKeyprivate Stringprivate Stringprivate Collection<String> private Stringprivate URIprivate HttpTransportFactoryprivate booleanFields inherited from class GoogleCredentials.Builder
quotaProjectId, universeDomain -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()protectedBuilder(ServiceAccountCredentials credentials) -
Method Summary
Modifier and TypeMethodDescriptionbuild()intbooleanbooleansetClientEmail(String clientEmail) setClientId(String clientId) setDefaultRetriesEnabled(boolean defaultRetriesEnabled) setHttpTransportFactory(HttpTransportFactory transportFactory) setLifetime(int lifetime) setPrivateKey(PrivateKey privateKey) setPrivateKeyId(String privateKeyId) setPrivateKeyString(String privateKeyPkcs8) setProjectId(String projectId) setQuotaProjectId(String quotaProjectId) setScopes(Collection<String> scopes) setScopes(Collection<String> scopes, Collection<String> defaultScopes) setServiceAccountUser(String serviceAccountUser) setTokenServerUri(URI tokenServerUri) setUniverseDomain(String universeDomain) setUseJwtAccessWithScope(boolean useJwtAccessWithScope) Sets the useJwtAccessWithScope flag.Methods inherited from class GoogleCredentials.Builder
getQuotaProjectId, getUniverseDomain, setAccessTokenMethods inherited from class OAuth2Credentials.Builder
getAccessToken, getExpirationMargin, getRefreshMargin, setExpirationMargin, setRefreshMargin
-
Field Details
-
clientId
-
clientEmail
-
privateKey
-
privateKeyId
-
serviceAccountUser
-
projectId
-
tokenServerUri
-
scopes
-
defaultScopes
-
transportFactory
-
lifetime
private int lifetime -
useJwtAccessWithScope
private boolean useJwtAccessWithScope -
defaultRetriesEnabled
private boolean defaultRetriesEnabled
-
-
Constructor Details
-
Builder
protected Builder() -
Builder
-
-
Method Details
-
setClientId
-
setClientEmail
-
setPrivateKey
-
setPrivateKeyString
@CanIgnoreReturnValue public ServiceAccountCredentials.Builder setPrivateKeyString(String privateKeyPkcs8) throws IOException - Throws:
IOException
-
setPrivateKeyId
-
setScopes
-
setScopes
@CanIgnoreReturnValue public ServiceAccountCredentials.Builder setScopes(Collection<String> scopes, Collection<String> defaultScopes) -
setServiceAccountUser
@CanIgnoreReturnValue public ServiceAccountCredentials.Builder setServiceAccountUser(String serviceAccountUser) -
setProjectId
-
setTokenServerUri
@CanIgnoreReturnValue public ServiceAccountCredentials.Builder setTokenServerUri(URI tokenServerUri) -
setHttpTransportFactory
@CanIgnoreReturnValue public ServiceAccountCredentials.Builder setHttpTransportFactory(HttpTransportFactory transportFactory) -
setQuotaProjectId
@CanIgnoreReturnValue public ServiceAccountCredentials.Builder setQuotaProjectId(String quotaProjectId) - Overrides:
setQuotaProjectIdin classGoogleCredentials.Builder
-
setLifetime
-
setUseJwtAccessWithScope
@CanIgnoreReturnValue public ServiceAccountCredentials.Builder setUseJwtAccessWithScope(boolean useJwtAccessWithScope) Sets the useJwtAccessWithScope flag. This flag will be ignored if universeDomain field is different fromCredentials.GOOGLE_DEFAULT_UNIVERSE. -
setDefaultRetriesEnabled
@CanIgnoreReturnValue public ServiceAccountCredentials.Builder setDefaultRetriesEnabled(boolean defaultRetriesEnabled) -
setUniverseDomain
- Overrides:
setUniverseDomainin classGoogleCredentials.Builder
-
getClientId
-
getClientEmail
-
getPrivateKey
-
getPrivateKeyId
-
getScopes
-
getDefaultScopes
-
getServiceAccountUser
-
getProjectId
-
getTokenServerUri
-
getHttpTransportFactory
-
getLifetime
public int getLifetime() -
getUseJwtAccessWithScope
public boolean getUseJwtAccessWithScope() -
isDefaultRetriesEnabled
public boolean isDefaultRetriesEnabled() -
build
- Overrides:
buildin classGoogleCredentials.Builder
-