Skip to content

TemperatureDataClient

Namespace: IntegrationTests.ApiClient

public class TemperatureDataClient

Inheritance ObjectTemperatureDataClient

Properties

BaseUrl

public string BaseUrl { get; set; }

Property Value

String

ReadResponseAsString

public bool ReadResponseAsString { get; set; }

Property Value

Boolean

Constructors

TemperatureDataClient(String, HttpClient)

public TemperatureDataClient(string baseUrl, HttpClient httpClient)

Parameters

baseUrl String

httpClient HttpClient

Methods

GetTemperatureAsync(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, String, Nullable<Boolean>)

Retrieves comprehensive temperature data for a specified time range and location.

public Task<TemperatureDataOverview> GetTemperatureAsync(Nullable<DateTimeOffset> start, Nullable<DateTimeOffset> end, string place, Nullable<Boolean> isFahrenheit)

Parameters

start Nullable<DateTimeOffset>

Start date and time for the data range (ISO 8601 format).

end Nullable<DateTimeOffset>

End date and time for the data range (ISO 8601 format).

place String

Location name for external weather data (e.g., "Berlin", "Munich").

isFahrenheit Nullable<Boolean>

Optional. If true, converts all temperatures to Fahrenheit. Default is false (Celsius).

Returns

Successfully retrieved temperature data. Returns comprehensive temperature overview.

Exceptions

ApiException

A server side error occurred.

Remarks:

This endpoint provides temperature readings from multiple sources:

- Indoor sensors: North and South sensor locations

- External weather data: Outside temperature for the specified location

Authorization Required: Bearer token with User or Admin role

Time Range Requirements:

- Start date must be before end date

- Maximum time range is recommended to be 30 days for optimal performance

- Dates should be in ISO 8601 format (e.g., "2024-01-15T10:30:00Z")

Temperature Unit Conversion:

- Default: Celsius (°C)

- Optional: Fahrenheit (°F) by setting isFahrenheit=true

Example Usage:

<br>GET /api/v1/TemperatureData/GetTemperature?start=2024-01-15T00:00:00Z&amp;end=2024-01-16T00:00:00Z&amp;place=Berlin <br>&amp;isFahrenheit=false <br>

Data Quality:

- Automatic plausibility checks are performed on all temperature readings

- Suspicious readings (outside -30°C to 45°C for outdoor, -10°C to 35°C for indoor) are logged as warnings

- Large temperature jumps (>10°C between consecutive readings) are flagged

GetTemperatureAsync(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, String, Nullable<Boolean>, CancellationToken)

Retrieves comprehensive temperature data for a specified time range and location.

public Task<TemperatureDataOverview> GetTemperatureAsync(Nullable<DateTimeOffset> start, Nullable<DateTimeOffset> end, string place, Nullable<Boolean> isFahrenheit, CancellationToken cancellationToken)

Parameters

start Nullable<DateTimeOffset>

Start date and time for the data range (ISO 8601 format).

end Nullable<DateTimeOffset>

End date and time for the data range (ISO 8601 format).

place String

Location name for external weather data (e.g., "Berlin", "Munich").

isFahrenheit Nullable<Boolean>

Optional. If true, converts all temperatures to Fahrenheit. Default is false (Celsius).

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Successfully retrieved temperature data. Returns comprehensive temperature overview.

Exceptions

ApiException

A server side error occurred.

Remarks:

This endpoint provides temperature readings from multiple sources:

- Indoor sensors: North and South sensor locations

- External weather data: Outside temperature for the specified location

Authorization Required: Bearer token with User or Admin role

Time Range Requirements:

- Start date must be before end date

- Maximum time range is recommended to be 30 days for optimal performance

- Dates should be in ISO 8601 format (e.g., "2024-01-15T10:30:00Z")

Temperature Unit Conversion:

- Default: Celsius (°C)

- Optional: Fahrenheit (°F) by setting isFahrenheit=true

Example Usage:

<br>GET /api/v1/TemperatureData/GetTemperature?start=2024-01-15T00:00:00Z&amp;end=2024-01-16T00:00:00Z&amp;place=Berlin <br>&amp;isFahrenheit=false <br>

Data Quality:

- Automatic plausibility checks are performed on all temperature readings

- Suspicious readings (outside -30°C to 45°C for outdoor, -10°C to 35°C for indoor) are logged as warnings

- Large temperature jumps (>10°C between consecutive readings) are flagged

ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<String, IEnumerable<String>>, CancellationToken)

protected Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<String, IEnumerable<String>> headers, CancellationToken cancellationToken)

Type Parameters

T

Parameters

response HttpResponseMessage

headers IReadOnlyDictionary<String, IEnumerable<String>>

cancellationToken CancellationToken

Returns

Task<ObjectResponseResult<T>>