about summary refs log tree commit diff
path: root/LibMatrix/Homeservers/ImplementationDetails/Synapse/Models/Responses/Destinations.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-08-23 02:55:07 +0200
committerRory& <root@rory.gay>2024-08-23 02:55:07 +0200
commitf50ed7ccc4347907d3c5ec6b68e1b84c4e0a7a0e (patch)
treed77d1d1f30e0ea01051561d8caaadeed2fdcf439 /LibMatrix/Homeservers/ImplementationDetails/Synapse/Models/Responses/Destinations.cs
parentMinor cleanup (diff)
downloadLibMatrix-f50ed7ccc4347907d3c5ec6b68e1b84c4e0a7a0e.tar.xz
Synapse admin API stuff, a mass of other changes
Diffstat (limited to 'LibMatrix/Homeservers/ImplementationDetails/Synapse/Models/Responses/Destinations.cs')
-rw-r--r--LibMatrix/Homeservers/ImplementationDetails/Synapse/Models/Responses/Destinations.cs56
1 files changed, 56 insertions, 0 deletions
diff --git a/LibMatrix/Homeservers/ImplementationDetails/Synapse/Models/Responses/Destinations.cs b/LibMatrix/Homeservers/ImplementationDetails/Synapse/Models/Responses/Destinations.cs
new file mode 100644
index 0000000..646a4b5
--- /dev/null
+++ b/LibMatrix/Homeservers/ImplementationDetails/Synapse/Models/Responses/Destinations.cs
@@ -0,0 +1,56 @@
+using System.Text.Json.Serialization;
+
+namespace LibMatrix.Homeservers.ImplementationDetails.Synapse.Models.Responses;
+
+public class SynapseAdminDestinationListResult : SynapseNextTokenTotalCollectionResult {
+    [JsonPropertyName("destinations")]
+    public List<SynapseAdminDestinationListResultDestination> Destinations { get; set; } = new();
+
+    public class SynapseAdminDestinationListResultDestination {
+        [JsonPropertyName("destination")]
+        public string Destination { get; set; }
+
+        [JsonPropertyName("retry_last_ts")]
+        public long RetryLastTs { get; set; }
+
+        [JsonPropertyName("retry_interval")]
+        public long RetryInterval { get; set; }
+
+        [JsonPropertyName("failure_ts")]
+        public long? FailureTs { get; set; }
+
+        [JsonPropertyName("last_successful_stream_ordering")]
+        public long? LastSuccessfulStreamOrdering { get; set; }
+
+        [JsonIgnore]
+        public DateTime? FailureTsDateTime {
+            get => FailureTs.HasValue ? DateTimeOffset.FromUnixTimeMilliseconds(FailureTs.Value).DateTime : null;
+            set => FailureTs = value.HasValue ? new DateTimeOffset(value.Value).ToUnixTimeMilliseconds() : null;
+        }
+
+        [JsonIgnore]
+        public DateTime? RetryLastTsDateTime {
+            get => DateTimeOffset.FromUnixTimeMilliseconds(RetryLastTs).DateTime;
+            set => RetryLastTs = new DateTimeOffset(value.Value).ToUnixTimeMilliseconds();
+        }
+
+        [JsonIgnore]
+        public TimeSpan RetryIntervalTimeSpan {
+            get => TimeSpan.FromMilliseconds(RetryInterval);
+            set => RetryInterval = (long)value.TotalMilliseconds;
+        }
+    }
+}
+
+public class SynapseAdminDestinationRoomListResult : SynapseNextTokenTotalCollectionResult {
+    [JsonPropertyName("rooms")]
+    public List<SynapseAdminDestinationRoomListResultRoom> Rooms { get; set; } = new();
+
+    public class SynapseAdminDestinationRoomListResultRoom {
+        [JsonPropertyName("room_id")]
+        public string RoomId { get; set; }
+
+        [JsonPropertyName("stream_ordering")]
+        public int StreamOrdering { get; set; }
+    }
+}
\ No newline at end of file