From 70387a10e434b5d32390e314d5f00e614df6185a Mon Sep 17 00:00:00 2001 From: cu3x Date: Tue, 7 May 2024 17:57:51 +0200 Subject: [PATCH] fix: added Pop field support. --- src/Indiko.OpenWeatherClient/Models/Day.cs | 8 ++++++++ src/Indiko.OpenWeatherClient/Models/Hour.cs | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/Indiko.OpenWeatherClient/Models/Day.cs b/src/Indiko.OpenWeatherClient/Models/Day.cs index 18f2e10..a9618c5 100644 --- a/src/Indiko.OpenWeatherClient/Models/Day.cs +++ b/src/Indiko.OpenWeatherClient/Models/Day.cs @@ -88,4 +88,12 @@ public sealed class Day : Weather [JsonPropertyName("snow")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public float? Snow { get; init; } + + /// + /// Gets the Probability Of Precipitation for the specific hour unit specified. + /// This property will be ignored when writing to JSON if the value is null. + /// + [JsonPropertyName("pop")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public float? ProbabilityOfPrecipitation { get; init; } } diff --git a/src/Indiko.OpenWeatherClient/Models/Hour.cs b/src/Indiko.OpenWeatherClient/Models/Hour.cs index 40324e4..dedb6bf 100644 --- a/src/Indiko.OpenWeatherClient/Models/Hour.cs +++ b/src/Indiko.OpenWeatherClient/Models/Hour.cs @@ -31,4 +31,12 @@ public sealed class Hour : Weather [JsonPropertyName("snow")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public OneHour Snow { get; init; } + + /// + /// Gets the Probability Of Precipitation for the specific hour unit specified. + /// This property will be ignored when writing to JSON if the value is null. + /// + [JsonPropertyName("pop")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public float? ProbabilityOfPrecipitation { get; init; } }