From 8af110873b14e1f9a79f72da32cb473a705f8a04 Mon Sep 17 00:00:00 2001 From: Michael DiLeo Date: Thu, 6 Aug 2026 12:58:41 -0500 Subject: [PATCH] add dtos for the open api spec --- dotnet/SafelyYou/Api/ErrorResponse.cs | 7 +++++++ dotnet/SafelyYou/Api/GetDeviceStatsResponse.cs | 8 ++++++++ dotnet/SafelyYou/Api/HeartbeatRequest.cs | 7 +++++++ dotnet/SafelyYou/Api/NotFoundResponse.cs | 7 +++++++ dotnet/SafelyYou/Api/UploadStatsRequest.cs | 8 ++++++++ 5 files changed, 37 insertions(+) create mode 100644 dotnet/SafelyYou/Api/ErrorResponse.cs create mode 100644 dotnet/SafelyYou/Api/GetDeviceStatsResponse.cs create mode 100644 dotnet/SafelyYou/Api/HeartbeatRequest.cs create mode 100644 dotnet/SafelyYou/Api/NotFoundResponse.cs create mode 100644 dotnet/SafelyYou/Api/UploadStatsRequest.cs diff --git a/dotnet/SafelyYou/Api/ErrorResponse.cs b/dotnet/SafelyYou/Api/ErrorResponse.cs new file mode 100644 index 0000000..4d8041a --- /dev/null +++ b/dotnet/SafelyYou/Api/ErrorResponse.cs @@ -0,0 +1,7 @@ +using System.Text.Json.Serialization; + +namespace SafelyYou.Api; + +public record ErrorResponse( + [property: JsonPropertyName("msg")] string Msg +); diff --git a/dotnet/SafelyYou/Api/GetDeviceStatsResponse.cs b/dotnet/SafelyYou/Api/GetDeviceStatsResponse.cs new file mode 100644 index 0000000..696a895 --- /dev/null +++ b/dotnet/SafelyYou/Api/GetDeviceStatsResponse.cs @@ -0,0 +1,8 @@ +using System.Text.Json.Serialization; + +namespace SafelyYou.Api; + +public record GetDeviceStatsResponse( + [property: JsonPropertyName("avg_upload_time")] string AvgUploadTime, + [property: JsonPropertyName("uptime")] double Uptime +); diff --git a/dotnet/SafelyYou/Api/HeartbeatRequest.cs b/dotnet/SafelyYou/Api/HeartbeatRequest.cs new file mode 100644 index 0000000..1b0a43f --- /dev/null +++ b/dotnet/SafelyYou/Api/HeartbeatRequest.cs @@ -0,0 +1,7 @@ +using System.Text.Json.Serialization; + +namespace SafelyYou.Api; + +public record HeartbeatRequest( + [property: JsonPropertyName("sent_at")] DateTimeOffset SentAt +); diff --git a/dotnet/SafelyYou/Api/NotFoundResponse.cs b/dotnet/SafelyYou/Api/NotFoundResponse.cs new file mode 100644 index 0000000..3e82848 --- /dev/null +++ b/dotnet/SafelyYou/Api/NotFoundResponse.cs @@ -0,0 +1,7 @@ +using System.Text.Json.Serialization; + +namespace SafelyYou.Api; + +public record NotFoundResponse( + [property: JsonPropertyName("msg")] string Msg +); diff --git a/dotnet/SafelyYou/Api/UploadStatsRequest.cs b/dotnet/SafelyYou/Api/UploadStatsRequest.cs new file mode 100644 index 0000000..bd2e1c2 --- /dev/null +++ b/dotnet/SafelyYou/Api/UploadStatsRequest.cs @@ -0,0 +1,8 @@ +using System.Text.Json.Serialization; + +namespace SafelyYou.Api; + +public record UploadStatsRequest( + [property: JsonPropertyName("sent_at")] DateTimeOffset SentAt, + [property: JsonPropertyName("upload_time")] long UploadTime +);