2.9.3 (latest) 2.9.2 2.8.1 2.7.2 2.6.0 2.5.1 2.4.1 2.1.2 2.0.1 1.35.2 1.34.1 1.33.4

```java
public static class ComputeCredential.Builder extends Credential.Builder
```
Beta   

Google Compute Engine credential builder.

Implementation is not thread-safe.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> com.google.api.client.auth.oauth2.Credential.Builder \> ComputeCredential.Builder

## Inherited Members

com.google.api.client.auth.oauth2.Credential.Builder.addRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener) com.google.api.client.auth.oauth2.Credential.Builder.build() com.google.api.client.auth.oauth2.Credential.Builder.getClientAuthentication() com.google.api.client.auth.oauth2.Credential.Builder.getClock() com.google.api.client.auth.oauth2.Credential.Builder.getJsonFactory() com.google.api.client.auth.oauth2.Credential.Builder.getMethod() com.google.api.client.auth.oauth2.Credential.Builder.getRefreshListeners() com.google.api.client.auth.oauth2.Credential.Builder.getRequestInitializer() com.google.api.client.auth.oauth2.Credential.Builder.getTokenServerUrl() com.google.api.client.auth.oauth2.Credential.Builder.getTransport() com.google.api.client.auth.oauth2.Credential.Builder.setClientAuthentication(com.google.api.client.http.HttpExecuteInterceptor) com.google.api.client.auth.oauth2.Credential.Builder.setClock(com.google.api.client.util.Clock) com.google.api.client.auth.oauth2.Credential.Builder.setJsonFactory(com.google.api.client.json.JsonFactory) com.google.api.client.auth.oauth2.Credential.Builder.setRefreshListeners(java.util.Collection\<com.google.api.client.auth.oauth2.CredentialRefreshListener\>) com.google.api.client.auth.oauth2.Credential.Builder.setRequestInitializer(com.google.api.client.http.HttpRequestInitializer) com.google.api.client.auth.oauth2.Credential.Builder.setTokenServerEncodedUrl(java.lang.String) com.google.api.client.auth.oauth2.Credential.Builder.setTokenServerUrl(com.google.api.client.http.GenericUrl) com.google.api.client.auth.oauth2.Credential.Builder.setTransport(com.google.api.client.http.HttpTransport) [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Constructors

### Builder(HttpTransport transport, JsonFactory jsonFactory)

```java
public Builder(HttpTransport transport, JsonFactory jsonFactory)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `transport` | `com.google.api.client.http.HttpTransport` HTTP transport |
| `jsonFactory` | `com.google.api.client.json.JsonFactory` JSON factory |

## Methods

### addRefreshListener(CredentialRefreshListener refreshListener)

```java
public ComputeCredential.Builder addRefreshListener(CredentialRefreshListener refreshListener)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `refreshListener` | `com.google.api.client.auth.oauth2.CredentialRefreshListener` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ComputeCredential.Builder` |   |

**Overrides** com.google.api.client.auth.oauth2.Credential.Builder.addRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener)

### build()

```java
public ComputeCredential build()
```

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ComputeCredential` |   |

**Overrides** com.google.api.client.auth.oauth2.Credential.Builder.build()

### setClientAuthentication(HttpExecuteInterceptor clientAuthentication)

```java
public ComputeCredential.Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `clientAuthentication` | `com.google.api.client.http.HttpExecuteInterceptor` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ComputeCredential.Builder` |   |

**Overrides** com.google.api.client.auth.oauth2.Credential.Builder.setClientAuthentication(com.google.api.client.http.HttpExecuteInterceptor)

### setClock(Clock clock)

```java
public ComputeCredential.Builder setClock(Clock clock)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `clock` | `com.google.api.client.util.Clock` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ComputeCredential.Builder` |   |

**Overrides** com.google.api.client.auth.oauth2.Credential.Builder.setClock(com.google.api.client.util.Clock)

### setJsonFactory(JsonFactory jsonFactory)

```java
public ComputeCredential.Builder setJsonFactory(JsonFactory jsonFactory)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `jsonFactory` | `com.google.api.client.json.JsonFactory` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ComputeCredential.Builder` |   |

**Overrides** com.google.api.client.auth.oauth2.Credential.Builder.setJsonFactory(com.google.api.client.json.JsonFactory)

### setRefreshListeners(Collection\<CredentialRefreshListener\> refreshListeners)

```java
public ComputeCredential.Builder setRefreshListeners(Collection<CredentialRefreshListener> refreshListeners)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `refreshListeners` | `Collection<com.google.api.client.auth.oauth2.CredentialRefreshListener>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ComputeCredential.Builder` |   |

**Overrides** com.google.api.client.auth.oauth2.Credential.Builder.setRefreshListeners(java.util.Collection\<com.google.api.client.auth.oauth2.CredentialRefreshListener\>)

### setRequestInitializer(HttpRequestInitializer requestInitializer)

```java
public ComputeCredential.Builder setRequestInitializer(HttpRequestInitializer requestInitializer)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `requestInitializer` | `com.google.api.client.http.HttpRequestInitializer` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ComputeCredential.Builder` |   |

**Overrides** com.google.api.client.auth.oauth2.Credential.Builder.setRequestInitializer(com.google.api.client.http.HttpRequestInitializer)

### setTokenServerEncodedUrl(String tokenServerEncodedUrl)

```java
public ComputeCredential.Builder setTokenServerEncodedUrl(String tokenServerEncodedUrl)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tokenServerEncodedUrl` | `String` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ComputeCredential.Builder` |   |

**Overrides** com.google.api.client.auth.oauth2.Credential.Builder.setTokenServerEncodedUrl(java.lang.String)

### setTokenServerUrl(GenericUrl tokenServerUrl)

```java
public ComputeCredential.Builder setTokenServerUrl(GenericUrl tokenServerUrl)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tokenServerUrl` | `com.google.api.client.http.GenericUrl` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ComputeCredential.Builder` |   |

**Overrides** com.google.api.client.auth.oauth2.Credential.Builder.setTokenServerUrl(com.google.api.client.http.GenericUrl)

### setTransport(HttpTransport transport)

```java
public ComputeCredential.Builder setTransport(HttpTransport transport)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `transport` | `com.google.api.client.http.HttpTransport` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ComputeCredential.Builder` |   |

**Overrides** com.google.api.client.auth.oauth2.Credential.Builder.setTransport(com.google.api.client.http.HttpTransport)