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 +);