Class ServiceAccountCredentials.Builder (1.24.1)

public static class ServiceAccountCredentials.Builder extends GoogleCredentials.Builder

Inheritance

java.lang.Object > OAuth2Credentials.Builder > GoogleCredentials.Builder > ServiceAccountCredentials.Builder

Constructors

Builder()

protected Builder()

Builder(ServiceAccountCredentials credentials)

protected Builder(ServiceAccountCredentials credentials)
Parameter
Name Description
credentials ServiceAccountCredentials

Methods

build()

public ServiceAccountCredentials build()
Returns
Type Description
ServiceAccountCredentials
Overrides

getClientEmail()

public String getClientEmail()
Returns
Type Description
String

getClientId()

public String getClientId()
Returns
Type Description
String

getDefaultScopes()

public Collection<String> getDefaultScopes()
Returns
Type Description
Collection<String>

getHttpTransportFactory()

public HttpTransportFactory getHttpTransportFactory()
Returns
Type Description
HttpTransportFactory

getLifetime()

public int getLifetime()
Returns
Type Description
int

getPrivateKey()

public PrivateKey getPrivateKey()
Returns
Type Description
PrivateKey

getPrivateKeyId()

public String getPrivateKeyId()
Returns
Type Description
String

getProjectId()

public String getProjectId()
Returns
Type Description
String

getScopes()

public Collection<String> getScopes()
Returns
Type Description
Collection<String>

getServiceAccountUser()

public String getServiceAccountUser()
Returns
Type Description
String

getTokenServerUri()

public URI getTokenServerUri()
Returns
Type Description
URI

getUseJwtAccessWithScope()

public boolean getUseJwtAccessWithScope()
Returns
Type Description
boolean

isDefaultRetriesEnabled()

public boolean isDefaultRetriesEnabled()
Returns
Type Description
boolean

setClientEmail(String clientEmail)

public ServiceAccountCredentials.Builder setClientEmail(String clientEmail)
Parameter
Name Description
clientEmail String
Returns
Type Description
ServiceAccountCredentials.Builder

setClientId(String clientId)

public ServiceAccountCredentials.Builder setClientId(String clientId)
Parameter
Name Description
clientId String
Returns
Type Description
ServiceAccountCredentials.Builder

setDefaultRetriesEnabled(boolean defaultRetriesEnabled)

public ServiceAccountCredentials.Builder setDefaultRetriesEnabled(boolean defaultRetriesEnabled)
Parameter
Name Description
defaultRetriesEnabled boolean
Returns
Type Description
ServiceAccountCredentials.Builder

setHttpTransportFactory(HttpTransportFactory transportFactory)

public ServiceAccountCredentials.Builder setHttpTransportFactory(HttpTransportFactory transportFactory)
Parameter
Name Description
transportFactory HttpTransportFactory
Returns
Type Description
ServiceAccountCredentials.Builder

setLifetime(int lifetime)

public ServiceAccountCredentials.Builder setLifetime(int lifetime)
Parameter
Name Description
lifetime int
Returns
Type Description
ServiceAccountCredentials.Builder

setPrivateKey(PrivateKey privateKey)

public ServiceAccountCredentials.Builder setPrivateKey(PrivateKey privateKey)
Parameter
Name Description
privateKey PrivateKey
Returns
Type Description
ServiceAccountCredentials.Builder

setPrivateKeyId(String privateKeyId)

public ServiceAccountCredentials.Builder setPrivateKeyId(String privateKeyId)
Parameter
Name Description
privateKeyId String
Returns
Type Description
ServiceAccountCredentials.Builder

setPrivateKeyString(String privateKeyPkcs8)

public ServiceAccountCredentials.Builder setPrivateKeyString(String privateKeyPkcs8)
Parameter
Name Description
privateKeyPkcs8 String
Returns
Type Description
ServiceAccountCredentials.Builder
Exceptions
Type Description
IOException

setProjectId(String projectId)

public ServiceAccountCredentials.Builder setProjectId(String projectId)
Parameter
Name Description
projectId String
Returns
Type Description
ServiceAccountCredentials.Builder

setQuotaProjectId(String quotaProjectId)

public ServiceAccountCredentials.Builder setQuotaProjectId(String quotaProjectId)
Parameter
Name Description
quotaProjectId String
Returns
Type Description
ServiceAccountCredentials.Builder
Overrides

setScopes(Collection<String> scopes)

public ServiceAccountCredentials.Builder setScopes(Collection<String> scopes)
Parameter
Name Description
scopes Collection<String>
Returns
Type Description
ServiceAccountCredentials.Builder

setScopes(Collection<String> scopes, Collection<String> defaultScopes)

public ServiceAccountCredentials.Builder setScopes(Collection<String> scopes, Collection<String> defaultScopes)
Parameters
Name Description
scopes Collection<String>
defaultScopes Collection<String>
Returns
Type Description
ServiceAccountCredentials.Builder

setServiceAccountUser(String serviceAccountUser)

public ServiceAccountCredentials.Builder setServiceAccountUser(String serviceAccountUser)
Parameter
Name Description
serviceAccountUser String
Returns
Type Description
ServiceAccountCredentials.Builder

setTokenServerUri(URI tokenServerUri)

public ServiceAccountCredentials.Builder setTokenServerUri(URI tokenServerUri)
Parameter
Name Description
tokenServerUri URI
Returns
Type Description
ServiceAccountCredentials.Builder

setUniverseDomain(String universeDomain)

public ServiceAccountCredentials.Builder setUniverseDomain(String universeDomain)
Parameter
Name Description
universeDomain String
Returns
Type Description
ServiceAccountCredentials.Builder
Overrides

setUseJwtAccessWithScope(boolean useJwtAccessWithScope)

public ServiceAccountCredentials.Builder setUseJwtAccessWithScope(boolean useJwtAccessWithScope)

Sets the useJwtAccessWithScope flag. This flag will be ignored if universeDomain field is different from Credentials#GOOGLE_DEFAULT_UNIVERSE.

Parameter
Name Description
useJwtAccessWithScope boolean
Returns
Type Description
ServiceAccountCredentials.Builder