Table of Contents

Interface IAlphaVantageClientBuilder

Namespace
Tudormobile.AlphaVantage
Assembly
Tudormobile.AlphaVantageAPI.dll

Defines a builder for configuring and creating instances of IAlphaVantageClient.

public interface IAlphaVantageClientBuilder : IBuilder<IAlphaVantageClient>
Inherited Members

Remarks

Use this interface to fluently configure API credentials and other options before constructing an IAlphaVantageClient. The builder pattern enables step-by-step configuration and validation prior to client creation.

Properties

ApiKey

Gets or sets the API key used to authenticate with the AlphaVantage service.

string ApiKey { get; set; }

Property Value

string

Methods

AddLogging(ILogger)

Adds the specified logger to the client builder for capturing diagnostic and operational messages.

IAlphaVantageClientBuilder AddLogging(ILogger logger)

Parameters

logger ILogger

The logger instance to use for logging client activity. Cannot be null.

Returns

IAlphaVantageClientBuilder

The current instance of the client builder for method chaining.

WithApiKey(string)

Sets the API key to be used for authenticating requests to the Alpha Vantage service.

IAlphaVantageClientBuilder WithApiKey(string apiKey)

Parameters

apiKey string

The API key provided by Alpha Vantage. Cannot be null or empty.

Returns

IAlphaVantageClientBuilder

The current builder instance with the specified API key configured.

WithHttpClient(HttpClient)

Configures the builder to use the specified HTTP client for sending requests to the Alpha Vantage API.

IAlphaVantageClientBuilder WithHttpClient(HttpClient httpClient)

Parameters

httpClient HttpClient

The HTTP client instance to use for all outgoing API requests. Cannot be null. The caller is responsible for managing the lifetime of the provided client.

Returns

IAlphaVantageClientBuilder

The current builder instance configured to use the specified HTTP client.

Remarks

Use this method to provide a custom-configured HttpClient, for example to set custom headers, proxies, or timeouts. If not set, a default HttpClient may be used by the implementation.