From c0fb0f8a39d5848f1c38402957a8b6477b77f6e3 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Mon, 6 May 2024 23:22:18 +0100 Subject: [PATCH] Fixed some nullability issues --- src/UniversalDiveDataFormat/Models/Camera.cs | 2 +- src/UniversalDiveDataFormat/Models/Guide.cs | 2 +- .../Models/SetDiveComputerAlarmTime.cs | 4 ++-- .../Models/SetDiveComputerDiveSiteData.cs | 2 +- .../Models/SetDiveComputerPartialPressureOfO2Alarm.cs | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/UniversalDiveDataFormat/Models/Camera.cs b/src/UniversalDiveDataFormat/Models/Camera.cs index 5a66bcd..a873d5f 100644 --- a/src/UniversalDiveDataFormat/Models/Camera.cs +++ b/src/UniversalDiveDataFormat/Models/Camera.cs @@ -6,7 +6,7 @@ namespace UniversalDiveDataFormat.Models; public class Camera: UddfModel, ILinkable { [XmlAttribute("id")] - public required string Id{ get; init; } + public string? Id { get; init; } [XmlElement("body")] public required Body Body { get; init; } diff --git a/src/UniversalDiveDataFormat/Models/Guide.cs b/src/UniversalDiveDataFormat/Models/Guide.cs index 6ebc2b8..e66c34c 100644 --- a/src/UniversalDiveDataFormat/Models/Guide.cs +++ b/src/UniversalDiveDataFormat/Models/Guide.cs @@ -7,7 +7,7 @@ namespace UniversalDiveDataFormat.Models; public class Guide: UddfModel, ILinkable { [XmlAttribute("id")] - public string Id { get; init; } + public string? Id { get; init; } [XmlElement("link")] public Link? Link { get; init; } diff --git a/src/UniversalDiveDataFormat/Models/SetDiveComputerAlarmTime.cs b/src/UniversalDiveDataFormat/Models/SetDiveComputerAlarmTime.cs index b95c061..60f5def 100644 --- a/src/UniversalDiveDataFormat/Models/SetDiveComputerAlarmTime.cs +++ b/src/UniversalDiveDataFormat/Models/SetDiveComputerAlarmTime.cs @@ -6,8 +6,8 @@ namespace UniversalDiveDataFormat.Models; public class SetDiveComputerAlarmTime: UddfModel { [XmlElement("datetime")] - public DateTime DateTime { get; init; } + public required DateTime DateTime { get; init; } [XmlElement("dcalarm")] - public DiveComputerAlarm DiveComputerAlarm { get; init; } + public required DiveComputerAlarm DiveComputerAlarm { get; init; } } \ No newline at end of file diff --git a/src/UniversalDiveDataFormat/Models/SetDiveComputerDiveSiteData.cs b/src/UniversalDiveDataFormat/Models/SetDiveComputerDiveSiteData.cs index 95c3318..fa7293b 100644 --- a/src/UniversalDiveDataFormat/Models/SetDiveComputerDiveSiteData.cs +++ b/src/UniversalDiveDataFormat/Models/SetDiveComputerDiveSiteData.cs @@ -6,5 +6,5 @@ namespace UniversalDiveDataFormat.Models; public class SetDiveComputerDiveSiteData: UddfModel { [XmlAttribute("divesite")] - public string DiveSiteId { get; init; } + public required string DiveSiteId { get; init; } } \ No newline at end of file diff --git a/src/UniversalDiveDataFormat/Models/SetDiveComputerPartialPressureOfO2Alarm.cs b/src/UniversalDiveDataFormat/Models/SetDiveComputerPartialPressureOfO2Alarm.cs index a9d0cce..8cf26f2 100644 --- a/src/UniversalDiveDataFormat/Models/SetDiveComputerPartialPressureOfO2Alarm.cs +++ b/src/UniversalDiveDataFormat/Models/SetDiveComputerPartialPressureOfO2Alarm.cs @@ -6,8 +6,8 @@ namespace UniversalDiveDataFormat.Models; public class SetDiveComputerPartialPressureOfO2Alarm: UddfModel { [XmlElement("dcalarm")] - public DiveComputerAlarm DiveComputerAlarm { get; init; } + public required DiveComputerAlarm DiveComputerAlarm { get; init; } [XmlElement("maximumpo2")] - public float? MaximumPartialPressureOfO2InBars { get; init; } + public required float MaximumPartialPressureOfO2InBars { get; init; } } \ No newline at end of file