2.73.0 (latest) 2.72.0 2.71.0 2.70.0 2.69.0 2.66.0 2.65.0 2.64.1 2.63.1 2.62.2 2.61.0 2.60.3 2.59.0 2.58.2 2.57.0 2.56.0 2.55.0 2.53.1 2.52.0 2.51.0 2.50.0 2.49.1 2.48.0 2.47.0 2.45.0 2.44.1 2.43.0 2.42.0 2.41.0 2.40.0 2.39.0 2.38.1 2.37.0 2.36.1 2.35.0 2.33.0 2.32.0 2.31.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.0 2.24.1 2.23.0 2.22.1 2.21.1 2.20.1 2.13.0 2.12.0 2.11.0 2.9.4 2.8.27 2.7.1 2.6.1 2.5.11 2.4.0 2.3.5

    public abstract static class ServiceOptions.Builder<ServiceT,OptionsT,B>

Builder for `ServiceOptions`.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> ServiceOptions.Builder\<ServiceT,OptionsT,B\>

## Inherited Members

[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-)

| ## Type Parameters ||
|---|---|
| **Name** | **Description** |
| `ServiceT` |   |
| `OptionsT` |   |
| `B` |   |

## Constructors

### Builder()

    protected Builder()

> [!WARNING]
> **Internal Only**: This feature is not stable for application use.
>
> *This class should only be extended within google-cloud-java*

### Builder(ServiceOptions\<ServiceT,OptionsT\> options)

    protected Builder(ServiceOptions<ServiceT,OptionsT> options)

> [!WARNING]
> **Internal Only**: This feature is not stable for application use.
>
> *This class should only be extended within google-cloud-java*

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `options` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-core/latest/com.google.cloud.ServiceOptions<ServiceT,OptionsT>` |

## Fields

### credentials

    protected Credentials credentials

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `com.google.auth.Credentials` |   |

## Methods

### build()

    protected abstract ServiceOptions<ServiceT,OptionsT> build()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-core/latest/com.google.cloud.ServiceOptions<ServiceT,OptionsT>` |   |

### getAllowedClientLibTokens()

    protected Set<String> getAllowedClientLibTokens()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Set.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### self()

    protected B self()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` |   |

### setApiTracerFactory(ApiTracerFactory apiTracerFactory)

    public B setApiTracerFactory(ApiTracerFactory apiTracerFactory)

> [!WARNING]
> **Internal Only**: This feature is not stable for application use.

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Sets the [ApiTracerFactory](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.tracing.ApiTracerFactory.html). It will be used to create an ApiTracer that is
annotated throughout the lifecycle of an RPC operation.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `apiTracerFactory` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.tracing.ApiTracerFactory.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` |   |

### setClientLibToken(String clientLibToken)

    public B setClientLibToken(String clientLibToken)

> [!WARNING]
> **Internal Only**: This feature is not stable for application use.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `clientLibToken` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` |   |

### setClock(ApiClock clock)

    public B setClock(ApiClock clock)

Sets the service's clock. The clock is mainly used for testing purpose. [ApiClock](https://docs.cloud.google.com/java/docs/reference/api-common/latest/com.google.api.core.ApiClock.html) will
be replaced by Java8's `java.time.Clock`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `clock` | `https://docs.cloud.google.com/java/docs/reference/api-common/latest/com.google.api.core.ApiClock.html` the clock to set |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` | the builder |

### setCredentials(Credentials credentials)

    public B setCredentials(Credentials credentials)

Sets the service authentication credentials. If no credentials are set, GoogleCredentials#getApplicationDefault() will be used to attempt getting credentials from
the environment. Use [NoCredentials#getInstance()](https://docs.cloud.google.com/java/docs/reference/google-cloud-core/latest/com.google.cloud.NoCredentials#com_google_cloud_NoCredentials_getInstance__) to skip authentication, this is
typically useful when using local service emulators.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `credentials` | `com.google.auth.Credentials` authentication credentials, should not be `null` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` | the builder |

### setHeaderProvider(HeaderProvider headerProvider)

    public B setHeaderProvider(HeaderProvider headerProvider)

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Sets the static header provider. The header provider will be called during client
construction only once. The headers returned by the provider will be cached and supplied as
is for each request issued by the constructed client. Some reserved headers can be overridden
(e.g. Content-Type) or merged with the default value (e.g. User-Agent) by the underlying
transport layer.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `headerProvider` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.HeaderProvider.html` the header provider |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` | the builder |

### setHost(String host)

    public B setHost(String host)

Sets service host.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `host` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` | the builder |

### setProjectId(String projectId)

    public B setProjectId(String projectId)

Sets the project ID. If no project ID is set, #getDefaultProjectId() will be used to
attempt getting the project ID from the environment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` | the builder |

### setQuotaProjectId(String quotaProjectId)

    public B setQuotaProjectId(String quotaProjectId)

Sets the quotaProjectId that specifies the project used for quota and billing purposes.
See Also: [See system parameter $userProject](https://cloud.google.com/apis/docs/system-parameters)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `quotaProjectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` |   |

### setRetrySettings(RetrySettings retrySettings)

    public B setRetrySettings(RetrySettings retrySettings)

Sets configuration parameters for request retries.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `retrySettings` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` | the builder |

### setServiceFactory(ServiceFactory\<ServiceT,OptionsT\> serviceFactory)

    public B setServiceFactory(ServiceFactory<ServiceT,OptionsT> serviceFactory)

Sets the service factory.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `serviceFactory` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-core/latest/com.google.cloud.ServiceFactory<ServiceT,OptionsT>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` |   |

### setServiceRpcFactory(ServiceRpcFactory\<OptionsT\> serviceRpcFactory)

    public B setServiceRpcFactory(ServiceRpcFactory<OptionsT> serviceRpcFactory)

Sets the factory for rpc services.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `serviceRpcFactory` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-core/latest/com.google.cloud.spi.ServiceRpcFactory<OptionsT>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` | the builder |

### setTransportOptions(TransportOptions transportOptions)

    public B setTransportOptions(TransportOptions transportOptions)

Sets the transport options.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `transportOptions` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-core/latest/com.google.cloud.TransportOptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` | the builder |

### setUniverseDomain(String universeDomain)

    public B setUniverseDomain(String universeDomain)

Universe Domain is the domain for Google Cloud Services. A Google Cloud endpoint follows the
format of `{ServiceName}.{UniverseDomain}`. For example, speech.googleapis.com would have a
Universe Domain value of `googleapis.com` and cloudasset.test.com would have a Universe
Domain of `test.com`.

If this value is not set, the resolved UniverseDomain will default to `googleapis.com`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `universeDomain` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` |   |

### setUseJwtAccessWithScope(boolean useJwtAccessWithScope)

    public B setUseJwtAccessWithScope(boolean useJwtAccessWithScope)

Sets the configuration determining whether self-signed JWT with scopes are used for service
account credentials.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `useJwtAccessWithScope` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` whether to use self-signed JWT with scopes |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `B` | the builder |