-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAirPolutionEntry.cs
More file actions
39 lines (35 loc) · 1.08 KB
/
AirPolutionEntry.cs
File metadata and controls
39 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using OpenWeatherMapSharp.Utils;
using System;
using System.Text.Json.Serialization;
namespace OpenWeatherMapSharp.Models
{
/// <summary>
/// Represents a single entry of air quality data,
/// including AQI, components, and timestamp.
/// </summary>
public class AirPolutionEntry
{
/// <summary>
/// Main air quality index (AQI).
/// </summary>
[JsonPropertyName("main")]
public AirPolutionIndex AQI { get; set; }
/// <summary>
/// Concentrations of individual air components.
/// </summary>
[JsonPropertyName("components")]
public AirPolutionComponents Components { get; set; }
/// <summary>
/// Timestamp of the measurement (Unix time in seconds).
/// </summary>
[JsonPropertyName("dt")]
public long DateUnix { get; set; }
/// <summary>
/// Timestamp of the weather data as a
/// UTC <see cref="DateTime"/>.
/// </summary>
[JsonIgnore]
public DateTime Date
=> DateUnix.ToDateTime();
}
}