Interface IProxyClient
- Namespace
- Tudormobile.Airthings.Proxy
- Assembly
- Tudormobile.Airthings.dll
Defines a client for interacting with the Airthings Proxy Service.
public interface IProxyClient
Methods
Create(string, string, HttpClient)
Creates a new instance of the Airthings Proxy Client.
public static IProxyClient Create(string apiKey, string baseAddress, HttpClient httpClient)
Parameters
apiKeystringThe API key for authenticating with the proxy service.
baseAddressstringThe base address of the proxy service. Must be an absolute URI.
httpClientHttpClientThe HTTP client used for API requests.
Returns
- IProxyClient
A new instance of IProxyClient.
Remarks
The caller is responsible for disposing of the httpClient instance.
The baseAddress must be an absolute URI (e.g., "https://example.com/api/").
ReadStatus(CancellationToken)
Reads the status information from the Airthings Proxy Service.
Task<ProxyResponse> ReadStatus(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token that can be used to cancel the asynchronous operation.
Returns
- Task<ProxyResponse>
A ProxyResponse containing the status information.
ReadSummary(UnitsType, CancellationToken)
Reads the summary of sensor data from the Airthings Proxy Service.
Task<ProxyResponse> ReadSummary(UnitsType unitsType = UnitsType.Metric, CancellationToken cancellationToken = default)
Parameters
unitsTypeUnitsTypeThe unit system to use for the response data. Defaults to Metric.
cancellationTokenCancellationTokenA cancellation token that can be used to cancel the asynchronous operation.
Returns
- Task<ProxyResponse>
A ProxyResponse containing the sensor data summary.