# Google Cloud Translation v2 API - Class TranslationClientBuilder (3.5.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [3.5.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2.TranslationClientBuilder)
- [3.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/3.4.0/Google.Cloud.Translation.V2.TranslationClientBuilder)
- [3.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/3.3.0/Google.Cloud.Translation.V2.TranslationClientBuilder)
- [3.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/3.2.0/Google.Cloud.Translation.V2.TranslationClientBuilder)
- [3.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/3.1.0/Google.Cloud.Translation.V2.TranslationClientBuilder)
- [3.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/3.0.0/Google.Cloud.Translation.V2.TranslationClientBuilder)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/2.1.0/Google.Cloud.Translation.V2.TranslationClientBuilder)

    public sealed class TranslationClientBuilder : ClientBuilderBase<TranslationClient>

Reference documentation and code samples for the Google Cloud Translation v2 API class TranslationClientBuilder.

A builder for [TranslationClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2.TranslationClient), allowing simple client customization.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [ClientBuilderBase](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html)[TranslationClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2.TranslationClient) \> TranslationClientBuilder

## Inherited Members

[ClientBuilderBase\<TranslationClient\>.CredentialsPath](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html#Google_Api_Gax_Rest_ClientBuilderBase_1_CredentialsPath) [ClientBuilderBase\<TranslationClient\>.JsonCredentials](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html#Google_Api_Gax_Rest_ClientBuilderBase_1_JsonCredentials) [ClientBuilderBase\<TranslationClient\>.ApplicationName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html#Google_Api_Gax_Rest_ClientBuilderBase_1_ApplicationName) [ClientBuilderBase\<TranslationClient\>.BaseUri](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html#Google_Api_Gax_Rest_ClientBuilderBase_1_BaseUri) [ClientBuilderBase\<TranslationClient\>.UniverseDomain](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html#Google_Api_Gax_Rest_ClientBuilderBase_1_UniverseDomain) [ClientBuilderBase\<TranslationClient\>.Credential](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html#Google_Api_Gax_Rest_ClientBuilderBase_1_Credential) [ClientBuilderBase\<TranslationClient\>.GoogleCredential](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html#Google_Api_Gax_Rest_ClientBuilderBase_1_GoogleCredential) [ClientBuilderBase\<TranslationClient\>.ApiKey](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html#Google_Api_Gax_Rest_ClientBuilderBase_1_ApiKey) [ClientBuilderBase\<TranslationClient\>.QuotaProject](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html#Google_Api_Gax_Rest_ClientBuilderBase_1_QuotaProject) [ClientBuilderBase\<TranslationClient\>.HttpClientFactory](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html#Google_Api_Gax_Rest_ClientBuilderBase_1_HttpClientFactory) [ClientBuilderBase\<TranslationClient\>.UseJwtAccessWithScopes](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ClientBuilderBase-1.html#Google_Api_Gax_Rest_ClientBuilderBase_1_UseJwtAccessWithScopes) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Translation.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2)

## Assembly

Google.Cloud.Translation.V2.dll

## Constructors

### TranslationClientBuilder()

    public TranslationClientBuilder()

Creates a new builder with default settings.

## Properties

### TranslationModel

    public TranslationModel TranslationModel { get; set; }

The translation model to use, defaulting to [ServiceDefault](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2.TranslationModel#Google_Cloud_Translation_V2_TranslationModel_ServiceDefault).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2.TranslationModel` |   |

## Methods

### Build()

    public override TranslationClient Build()

Builds the resulting client.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2.TranslationClient` |   |

**Overrides** Google.Api.Gax.Rest.ClientBuilderBase\<Google.Cloud.Translation.V2.TranslationClient\>.Build()

### BuildAsync(CancellationToken)

    public override Task<TranslationClient> BuildAsync(CancellationToken cancellationToken = default)

Builds the resulting client asynchronously.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2.TranslationClient` |   |

**Overrides** Google.Api.Gax.Rest.ClientBuilderBase\<Google.Cloud.Translation.V2.TranslationClient\>.BuildAsync(System.Threading.CancellationToken)

### GetDefaultApplicationName()

    protected override string GetDefaultApplicationName()

Returns the default application name, used if no custom name is otherwise specified.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Overrides** Google.Api.Gax.Rest.ClientBuilderBase\<Google.Cloud.Translation.V2.TranslationClient\>.GetDefaultApplicationName()

### GetScopedCredentialProvider()

    protected override ScopedCredentialProvider GetScopedCredentialProvider()

Returns the scoped credential provider for this builder.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.ScopedCredentialProvider.html` |   |

**Overrides** Google.Api.Gax.Rest.ClientBuilderBase\<Google.Cloud.Translation.V2.TranslationClient\>.GetScopedCredentialProvider()