This repository contains a Canister for managing air quality data. The service provides functionalities to add, delete, update, and retrieve information about air quality entries. It includes features like querying data by pollutant level, timestamp range, weather conditions, and location.
A struct representing air quality data with attributes such as ID, pollutant levels, air quality index, weather conditions, timestamp, location, and health recommendations.
A payload structure for updating air quality data, including pollutant levels, air quality index, weather conditions, location, and health recommendations.
Represents error types, including a NotFound
variant with a descriptive message.
A variant representing the result of operations. Includes an Ok
variant with AirQualityData
or Result_1
(a vector of AirQualityData
), or an Err
variant with an Error
.
A struct representing weather conditions with attributes such as wind speed, temperature, and humidity.
-
add_air_quality_data:
- Adds air quality data based on the provided
AirQualityUpdatePayload
.
- Adds air quality data based on the provided
-
delete_air_quality_data:
- Deletes air quality data by ID.
-
get_air_quality_data:
- Retrieves detailed information about air quality data by ID.
-
get_air_quality_data_by_pollutant_level:
- Retrieves air quality data based on pollutant levels.
-
get_air_quality_data_by_timestamp_range:
- Retrieves air quality data within a specified timestamp range.
-
get_air_quality_data_by_weather_conditions:
- Retrieves air quality data based on weather conditions.
-
get_all_air_quality_data:
- Retrieves all air quality data.
-
search_air_quality_data_by_location:
- Searches air quality data by location.
-
update_air_quality_data:
- Updates air quality data by ID using the provided
AirQualityUpdatePayload
.
- Updates air quality data by ID using the provided
The canister exports its Candid interface definitions using the ic_cdk::export_candid!()
macro.
Errors are represented using the Error
enum, which includes a NotFound
variant with a descriptive message.
Feel free to explore and integrate this canister into your Internet Computer project for efficient air quality data management!