Table of Contents

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

apiKey string

The API key for authenticating with the proxy service.

baseAddress string

The base address of the proxy service. Must be an absolute URI.

httpClient HttpClient

The 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

cancellationToken CancellationToken

A 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

unitsType UnitsType

The unit system to use for the response data. Defaults to Metric.

cancellationToken CancellationToken

A cancellation token that can be used to cancel the asynchronous operation.

Returns

Task<ProxyResponse>

A ProxyResponse containing the sensor data summary.