protected TransportConfigurationBase(IConnectionPool connectionPool, IConnection connection, ITransportSerializer requestResponseSerializer, IProductRegistration productRegistration)
        {
            _connectionPool      = connectionPool;
            _connection          = connection ?? new HttpConnection();
            _productRegistration = productRegistration ?? ProductRegistration.Default;
            var serializer = requestResponseSerializer ?? new LowLevelRequestResponseSerializer();

            UseThisRequestResponseSerializer = new DiagnosticsSerializerProxy(serializer);

            _connectionLimit        = TransportConfiguration.DefaultConnectionLimit;
            _requestTimeout         = TransportConfiguration.DefaultTimeout;
            _dnsRefreshTimeout      = TransportConfiguration.DefaultDnsRefreshTimeout;
            _memoryStreamFactory    = TransportConfiguration.DefaultMemoryStreamFactory;
            _sniffOnConnectionFault = true;
            _sniffOnStartup         = true;
            _sniffLifeSpan          = TimeSpan.FromHours(1);

            _urlFormatter = new UrlFormatter(this);
            _statusCodeToResponseSuccess = (m, i) => HttpStatusCodeClassifier(m, i);
            _userAgent = Elastic.Transport.UserAgent.Create(_productRegistration.Name, _productRegistration.GetType());

            if (connectionPool is CloudConnectionPool cloudPool)
            {
                _basicAuthCredentials  = cloudPool.BasicCredentials;
                _apiKeyAuthCredentials = cloudPool.ApiKeyCredentials;
                _enableHttpCompression = true;
            }
        }
 /// <summary>
 /// Sets up the client to communicate to Elastic Cloud using <paramref name="cloudId"/>,
 /// <para><see cref="CloudConnectionPool"/> documentation for more information on how to obtain your Cloud Id</para>
 /// </summary>
 public TransportConfiguration(string cloudId, BasicAuthenticationCredentials credentials) : this(new CloudConnectionPool(cloudId, credentials))
 {
 }
 /// <summary>
 /// An <see cref="IConnectionPool"/> implementation that can be seeded with a cloud id
 /// and will signal the right defaults for the client to use for Elastic Cloud to <see cref="ITransportConfigurationValues"/>.
 ///
 /// <para>Read more about Elastic Cloud Id here</para>
 /// <para>https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html</para>
 /// </summary>
 /// <param name="cloudId">
 /// The Cloud Id, this is available on your cluster's dashboard and is a string in the form of <c>cluster_name:base_64_encoded_string<c>
 /// <para>Base64 encoded string contains the following tokens in order separated by $:</para>
 /// <para>* Host Name (mandatory)</para>
 /// <para>* Elasticsearch UUID (mandatory)</para>
 /// <para>* Kibana UUID</para>
 /// <para>* APM UUID</para>
 /// <para></para>
 /// <para> We then use these tokens to create the URI to your Elastic Cloud cluster!</para>
 /// <para></para>
 /// <para> Read more here: https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html</para>
 /// </param>
 public CloudConnectionPool(string cloudId, BasicAuthenticationCredentials credentials, IDateTimeProvider dateTimeProvider = null) : this(ParseCloudId(cloudId), dateTimeProvider) =>