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 which means HTTP Status code 503
will be retried with exponential backoff.
If set to None no automatic retries will happen.
Calling code may still specify custom retries by configuring HttpClient.
The timeout to set on HttpClient instances used by the service.
May be null, in which case the default timeout values on HttpClient instances
used by this service will be left unchanged.
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.
UniverseDomain is used to build the endpoint to connect to, unless BaseUri
is set, in which case BaseUri will be used without further modification.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eBaseClientService.Initializer\u003c/code\u003e class is used to configure and initialize a client service with various settings, including API key, application name, and base URI.\u003c/p\u003e\n"],["\u003cp\u003eThis class allows customization of HTTP request handling by enabling GZip support, setting timeouts, and specifying an \u003ccode\u003eHttpClientFactory\u003c/code\u003e or \u003ccode\u003eHttpClientInitializer\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe initializer supports automatic retries for specific HTTP status codes via \u003ccode\u003eDefaultExponentialBackOffPolicy\u003c/code\u003e, enabling control over the retry behavior.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUniverseDomain\u003c/code\u003e property lets users connect to different universe domains, while \u003ccode\u003eBaseUri\u003c/code\u003e can be set for a specific endpoint, overriding the universe domain.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eInitializer\u003c/code\u003e class includes a \u003ccode\u003eVersionHeaderBuilder\u003c/code\u003e to manage the \u003ccode\u003ex-goog-api-client\u003c/code\u003e header, allowing the inclusion of various version details.\u003c/p\u003e\n"]]],[],null,["# Class BaseClientService.Initializer (1.69.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.69.0 (latest)](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService.Initializer)\n- [1.68.0](/dotnet/docs/reference/Google.Apis/1.68.0/Google.Apis.Services.BaseClientService.Initializer)\n- [1.60.0](/dotnet/docs/reference/Google.Apis/1.60.0/Google.Apis.Services.BaseClientService.Initializer)\n- [1.59.0](/dotnet/docs/reference/Google.Apis/1.59.0/Google.Apis.Services.BaseClientService.Initializer)\n- [1.55.0](/dotnet/docs/reference/Google.Apis/1.55.0/Google.Apis.Services.BaseClientService.Initializer)\n- [1.50.0](/dotnet/docs/reference/Google.Apis/1.50.0/Google.Apis.Services.BaseClientService.Initializer) \n\n public class BaseClientService.Initializer\n\nAn initializer class for the client service. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e BaseClientService.Initializer \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Apis.Services](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services)\n\nAssembly\n--------\n\nGoogle.Apis.dll\n\nConstructors\n------------\n\n### Initializer()\n\n public Initializer()\n\nConstructs a new initializer with default values.\n\nProperties\n----------\n\n### ApiKey\n\n public string ApiKey { get; set; }\n\nGets or sets the API Key. Default value is `null`.\n\n### ApplicationName\n\n public string ApplicationName { get; set; }\n\nGets or sets Application name to be used in the User-Agent header. Default value is `null`.\n\n### BaseUri\n\n public string BaseUri { get; set; }\n\nGets or sets the base URI to use for the service. If the value is `null`,\nthe default base URI for the service is used.\n\n### DefaultExponentialBackOffPolicy\n\n public ExponentialBackOffPolicy DefaultExponentialBackOffPolicy { get; set; }\n\nIndicates which of exceptions and / or HTTP status codes are automatically retried using exponential backoff.\nThe default value is [UnsuccessfulResponse503](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ExponentialBackOffPolicy#Google_Apis_Http_ExponentialBackOffPolicy_UnsuccessfulResponse503) which means HTTP Status code 503\nwill be retried with exponential backoff.\nIf set to [None](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ExponentialBackOffPolicy#Google_Apis_Http_ExponentialBackOffPolicy_None) no automatic retries will happen.\nCalling code may still specify custom retries by configuring [HttpClient](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService#Google_Apis_Services_BaseClientService_HttpClient).\n\n### GZipEnabled\n\n public bool GZipEnabled { get; set; }\n\nGets or sets whether this service supports GZip. Default value is `true`.\n\n### HttpClientFactory\n\n public IHttpClientFactory HttpClientFactory { get; set; }\n\nGets or sets the factory for creating [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient) instance. If this\nproperty is not set the service uses a new [HttpClientFactory](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.HttpClientFactory) instance.\n\n### HttpClientInitializer\n\n public IConfigurableHttpClientInitializer HttpClientInitializer { get; set; }\n\nGets or sets a HTTP client initializer which is able to customize properties on\n[ConfigurableHttpClient](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ConfigurableHttpClient) and\n[ConfigurableMessageHandler](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ConfigurableMessageHandler).\n\n### HttpClientTimeout\n\n public TimeSpan? HttpClientTimeout { get; set; }\n\nThe timeout to set on [HttpClient](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService#Google_Apis_Services_BaseClientService_HttpClient) instances used by the service.\nMay be null, in which case the default timeout values on [HttpClient](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService#Google_Apis_Services_BaseClientService_HttpClient) instances\nused by this service will be left unchanged.\n\n### MaxUrlLength\n\n public uint MaxUrlLength { get; set; }\n\nMaximum allowed length of a URL string for GET requests. Default value is `2048`. If the value is\nset to `0`, requests will never be modified due to URL string length.\n\n### Serializer\n\n public ISerializer Serializer { get; set; }\n\nGets or sets the serializer. Default value is [NewtonsoftJsonSerializer](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Json.NewtonsoftJsonSerializer).\n\n### UniverseDomain\n\n public string UniverseDomain { get; set; }\n\nThe universe domain to connect to, or null to use the default universe domain [DefaultUniverseDomain](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService#Google_Apis_Services_BaseClientService_DefaultUniverseDomain).\n\n**Remarks** \n\n[UniverseDomain](/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](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService.Initializer#Google_Apis_Services_BaseClientService_Initializer_BaseUri)\nis set, in which case [BaseUri](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Services.BaseClientService.Initializer#Google_Apis_Services_BaseClientService_Initializer_BaseUri) will be used without further modification.\n[UniverseDomain](/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\nown universe domain.\n\n### ValidateParameters\n\n public bool ValidateParameters { get; set; }\n\nDetermines whether request parameters are validated (client-side) by default.\nDefaults to true. This can be overridden on a per-request basis using [ValidateParameters](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Requests.ClientServiceRequest-1#Google_Apis_Requests_ClientServiceRequest_1_ValidateParameters).\n\n### VersionHeaderBuilder\n\n public VersionHeaderBuilder VersionHeaderBuilder { get; }\n\nBuilder for the x-goog-api-client header, collecting version information.\nServices automatically add the API library version to this.\nMost users will never need to configure this, but higher level abstraction Google libraries\nmay add their own version here.\n\nExtension Method\n----------------\n\n[Utilities.ThrowIfNull\\\u003cT\\\u003e(T, string)](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Util.Utilities#Google_Apis_Util_Utilities_ThrowIfNull__1___0_System_String_)"]]