SignalBotClient
Namespace: Signal.Bot
Full Name: Signal.Bot.SignalBotClient
Summary
Defines the core interface for interacting with the Signal Bot API, providing methods for sending requests and observing API interactions.
Properties
BaseUrl
Gets the base URL of the Signal Bot API endpoint.
Number
Gets the Signal phone number associated with this bot client.
JsonSerializerOptions
Gets the JSON serialization options used for request and response serialization.
OnApiRequest
Observable stream of outgoing API request events for monitoring and logging purposes.
OnApiResponse
Observable stream of incoming API response events for monitoring and logging purposes.
OnException
Observable stream of exceptions that occur during API interactions.
Methods
#ctor
#ctor(configure)Initializes a new instance of the SignalBotClient with optional configuration.
Parameters:
configure- Optional action to configure the client options via a builder.
SendAsync
SendAsync(request, queryParameters, cancellationToken)Sends an HTTP request to the Signal Bot API and returns the raw HTTP response.
Parameters:
request- The request to send.queryParameters- Optional query parameters to append to the request URL.cancellationToken- Cancellation token to cancel the operation.
Returns: The HTTP response message.
SendRequestAsync
SendRequestAsync(request, queryParameters, cancellationToken)Sends a request to the Signal Bot API without expecting a response body.
Parameters:
request- The request to send.queryParameters- Optional query parameters to append to the request URL.cancellationToken- Cancellation token to cancel the operation.
Returns: A task that completes when the request is sent successfully.
SendRequestAsync``1
SendRequestAsync``1(request, queryParameters, cancellationToken)Sends a request to the Signal Bot API and deserializes the response to the specified type.
Parameters:
request- The request to send.queryParameters- Optional query parameters to append to the request URL.cancellationToken- Cancellation token to cancel the operation.
Returns: The deserialized response of type TResponse.
Dispose
Dispose(disposing)Releases the unmanaged resources used by the SignalBotClient and optionally releases the managed resources.
Parameters:
disposing- True to release both managed and unmanaged resources; false to release only unmanaged resources.
Dispose
Dispose()