SignalBotClientOptionsBuilder
Namespace: Signal.Bot
Full Name: Signal.Bot.SignalBotClientOptionsBuilder
Summary
Provides a fluent interface for constructing SignalBotClientOptions with validation.
Methods
Create
Create()Creates a new instance of the SignalBotClientOptionsBuilder.
Returns: A new SignalBotClientOptionsBuilder instance.
WithBaseUrl
WithBaseUrl(baseUrl)Sets the base URL of the Signal Bot API endpoint.
Parameters:
baseUrl- The base URL (e.g., "https://signal-api.example.com").
Returns: The builder instance for method chaining.
WithNumber
WithNumber(number)Sets the Signal phone number associated with the bot.
Parameters:
number- The phone number in international format (e.g., "+1234567890").
Returns: The builder instance for method chaining.
WithHttpClient
WithHttpClient(httpClient)Sets a custom HttpClient instance for API requests. If not provided, a default HttpClient will be created with the configured base URL.
Parameters:
httpClient- The HttpClient instance to use.
Returns: The builder instance for method chaining.
Build
Build()Builds and validates the SignalBotClientOptions instance. Creates a default HttpClient if one was not provided.
Returns: The configured and validated SignalBotClientOptions instance.
Exceptions:
System.ArgumentException- Thrown when Number or BaseUrl is null or whitespace.
E164Regex
E164Regex()