Package com.google.auth.oauth2
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 String
private String
private boolean
private Collection
<String> private int
private PrivateKey
private String
private String
private Collection
<String> private String
private URI
private HttpTransportFactory
private boolean
Fields inherited from class com.google.auth.oauth2.GoogleCredentials.Builder
quotaProjectId, universeDomain
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Builder()
protected
Builder
(ServiceAccountCredentials credentials) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
int
boolean
boolean
setClientEmail
(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 com.google.auth.oauth2.GoogleCredentials.Builder
getQuotaProjectId, getUniverseDomain, setAccessToken
Methods inherited from class com.google.auth.oauth2.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:
setQuotaProjectId
in 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:
setUniverseDomain
in 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:
build
in classGoogleCredentials.Builder
-