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
public static class ServiceAccountCredentials.Builder extends GoogleCredentials.Builder
-
-
Field Summary
-
Fields inherited from class com.google.auth.oauth2.GoogleCredentials.Builder
quotaProjectId
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder()
protected
Builder(ServiceAccountCredentials credentials)
-
Method Summary
-
Methods inherited from class com.google.auth.oauth2.GoogleCredentials.Builder
getQuotaProjectId, setAccessToken
-
Methods inherited from class com.google.auth.oauth2.OAuth2Credentials.Builder
getAccessToken, getExpirationMargin, getRefreshMargin, setExpirationMargin, setRefreshMargin
-
-
-
-
Constructor Detail
-
Builder
protected Builder()
-
Builder
protected Builder(ServiceAccountCredentials credentials)
-
-
Method Detail
-
setClientId
public ServiceAccountCredentials.Builder setClientId(String clientId)
-
setClientEmail
public ServiceAccountCredentials.Builder setClientEmail(String clientEmail)
-
setPrivateKey
public ServiceAccountCredentials.Builder setPrivateKey(PrivateKey privateKey)
-
setPrivateKeyString
public ServiceAccountCredentials.Builder setPrivateKeyString(String privateKeyPkcs8) throws IOException
- Throws:
IOException
-
setPrivateKeyId
public ServiceAccountCredentials.Builder setPrivateKeyId(String privateKeyId)
-
setScopes
public ServiceAccountCredentials.Builder setScopes(Collection<String> scopes)
-
setScopes
public ServiceAccountCredentials.Builder setScopes(Collection<String> scopes, Collection<String> defaultScopes)
-
setServiceAccountUser
public ServiceAccountCredentials.Builder setServiceAccountUser(String serviceAccountUser)
-
setProjectId
public ServiceAccountCredentials.Builder setProjectId(String projectId)
-
setTokenServerUri
public ServiceAccountCredentials.Builder setTokenServerUri(URI tokenServerUri)
-
setHttpTransportFactory
public ServiceAccountCredentials.Builder setHttpTransportFactory(HttpTransportFactory transportFactory)
-
setQuotaProjectId
public ServiceAccountCredentials.Builder setQuotaProjectId(String quotaProjectId)
- Overrides:
setQuotaProjectId
in classGoogleCredentials.Builder
-
setLifetime
public ServiceAccountCredentials.Builder setLifetime(int lifetime)
-
setUseJwtAccessWithScope
public ServiceAccountCredentials.Builder setUseJwtAccessWithScope(boolean useJwtAccessWithScope)
-
setDefaultRetriesEnabled
public ServiceAccountCredentials.Builder setDefaultRetriesEnabled(boolean defaultRetriesEnabled)
-
getClientId
public String getClientId()
-
getClientEmail
public String getClientEmail()
-
getPrivateKey
public PrivateKey getPrivateKey()
-
getPrivateKeyId
public String getPrivateKeyId()
-
getScopes
public Collection<String> getScopes()
-
getDefaultScopes
public Collection<String> getDefaultScopes()
-
getServiceAccountUser
public String getServiceAccountUser()
-
getProjectId
public String getProjectId()
-
getTokenServerUri
public URI getTokenServerUri()
-
getHttpTransportFactory
public HttpTransportFactory getHttpTransportFactory()
-
getLifetime
public int getLifetime()
-
getUseJwtAccessWithScope
public boolean getUseJwtAccessWithScope()
-
isDefaultRetriesEnabled
public boolean isDefaultRetriesEnabled()
-
build
public ServiceAccountCredentials build()
- Overrides:
build
in classGoogleCredentials.Builder
-
-