# Class BaseClientService.Initializer (1.73.0)

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

- [1.73.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService.Initializer)
- [1.69.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.69.0/Google.Apis.Services.BaseClientService.Initializer)
- [1.68.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.68.0/Google.Apis.Services.BaseClientService.Initializer)
- [1.60.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.60.0/Google.Apis.Services.BaseClientService.Initializer)
- [1.59.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.59.0/Google.Apis.Services.BaseClientService.Initializer)
- [1.55.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.55.0/Google.Apis.Services.BaseClientService.Initializer)
- [1.50.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.50.0/Google.Apis.Services.BaseClientService.Initializer)

    public class BaseClientService.Initializer

An initializer class for the client service.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> BaseClientService.Initializer

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Apis.Services](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services)

## Assembly

Google.Apis.dll

## Constructors

### Initializer()

    public Initializer()

Constructs a new initializer with default values.

## Properties

### ApiKey

    public string ApiKey { get; set; }

Gets or sets the API Key. Default value is `null`.

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

### ApplicationName

    public string ApplicationName { get; set; }

Gets or sets Application name to be used in the User-Agent header. Default value is `null`.

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

### BaseUri

    public string BaseUri { get; set; }

Gets or sets the base URI to use for the service. If the value is `null`,
the default base URI for the service is used.

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

### DefaultExponentialBackOffPolicy

    public ExponentialBackOffPolicy DefaultExponentialBackOffPolicy { get; set; }

Indicates which of exceptions and / or HTTP status codes are automatically retried using exponential backoff.
The default value is [UnsuccessfulResponse503](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ExponentialBackOffPolicy#Google_Apis_Http_ExponentialBackOffPolicy_UnsuccessfulResponse503) which means HTTP Status code 503
will be retried with exponential backoff.
If set to [None](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ExponentialBackOffPolicy#Google_Apis_Http_ExponentialBackOffPolicy_None) no automatic retries will happen.
Calling code may still specify custom retries by configuring [HttpClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService#Google_Apis_Services_BaseClientService_HttpClient).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ExponentialBackOffPolicy` |   |

### GZipEnabled

    public bool GZipEnabled { get; set; }

Gets or sets whether this service supports GZip. Default value is `true`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HttpClientFactory

    public IHttpClientFactory HttpClientFactory { get; set; }

Gets or sets the factory for creating [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient) instance. If this
property is not set the service uses a new [HttpClientFactory](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.HttpClientFactory) instance.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.IHttpClientFactory` |   |

### HttpClientInitializer

    public IConfigurableHttpClientInitializer HttpClientInitializer { get; set; }

Gets or sets a HTTP client initializer which is able to customize properties on
[ConfigurableHttpClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ConfigurableHttpClient) and
[ConfigurableMessageHandler](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ConfigurableMessageHandler).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.IConfigurableHttpClientInitializer` |   |

### HttpClientTimeout

    public TimeSpan? HttpClientTimeout { get; set; }

The timeout to set on [HttpClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService#Google_Apis_Services_BaseClientService_HttpClient) instances used by the service.
May be null, in which case the default timeout values on [HttpClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService#Google_Apis_Services_BaseClientService_HttpClient) instances
used by this service will be left unchanged.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.timespan` |   |

### MaxUrlLength

    public uint MaxUrlLength { get; set; }

Maximum allowed length of a URL string for GET requests. Default value is `2048`. If the value is
set to `0`, requests will never be modified due to URL string length.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.uint32` |   |

### Serializer

    public ISerializer Serializer { get; set; }

Gets or sets the serializer. Default value is [NewtonsoftJsonSerializer](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Json.NewtonsoftJsonSerializer).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.ISerializer` |   |

### UniverseDomain

    public string UniverseDomain { get; set; }

The universe domain to connect to, or null to use the default universe domain Google.Apis.Services.BaseClientService.DefaultUniverseDomain.

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

**Remarks**
[UniverseDomain](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService.Initializer#Google_Apis_Services_BaseClientService_Initializer_UniverseDomain) is used to build the endpoint to connect to, unless [BaseUri](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService.Initializer#Google_Apis_Services_BaseClientService_Initializer_BaseUri)
is set, in which case [BaseUri](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService.Initializer#Google_Apis_Services_BaseClientService_Initializer_BaseUri) will be used without further modification.
[UniverseDomain](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService.Initializer#Google_Apis_Services_BaseClientService_Initializer_UniverseDomain) may also be used by the credential, if any, to validate against its
own universe domain.

### ValidateParameters

    public bool ValidateParameters { get; set; }

Determines whether request parameters are validated (client-side) by default.
Defaults to true. This can be overridden on a per-request basis using [ValidateParameters](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Requests.ClientServiceRequest-1#Google_Apis_Requests_ClientServiceRequest_1_ValidateParameters).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### VersionHeaderBuilder

    public VersionHeaderBuilder VersionHeaderBuilder { get; }

Builder for the x-goog-api-client header, collecting version information.
Services automatically add the API library version to this.
Most users will never need to configure this, but higher level abstraction Google libraries
may add their own version here.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Requests.VersionHeaderBuilder` |   |

## Extension Method

[Utilities.ThrowIfNull\<T\>(T, string)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Util.Utilities#Google_Apis_Util_Utilities_ThrowIfNull__1___0_System_String_)