about summary refs log tree commit diff
path: root/MatrixRoomUtils.Core/StateEventTypes/Spec/PowerLevelEventData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixRoomUtils.Core/StateEventTypes/Spec/PowerLevelEventData.cs')
-rw-r--r--MatrixRoomUtils.Core/StateEventTypes/Spec/PowerLevelEventData.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Core/StateEventTypes/Spec/PowerLevelEventData.cs b/MatrixRoomUtils.Core/StateEventTypes/Spec/PowerLevelEventData.cs
new file mode 100644
index 0000000..6846db4
--- /dev/null
+++ b/MatrixRoomUtils.Core/StateEventTypes/Spec/PowerLevelEventData.cs
@@ -0,0 +1,48 @@
+using System.Text.Json.Serialization;
+using MatrixRoomUtils.Core.Extensions;
+using MatrixRoomUtils.Core.Interfaces;
+
+namespace MatrixRoomUtils.Core.StateEventTypes.Spec;
+
+[MatrixEvent(EventName = "m.room.power_levels")]
+public class PowerLevelEventData : IStateEventType {
+    [JsonPropertyName("ban")]
+    public int Ban { get; set; } // = 50;
+
+    [JsonPropertyName("events_default")]
+    public int EventsDefault { get; set; } // = 0;
+
+    [JsonPropertyName("events")]
+    public Dictionary<string, int> Events { get; set; } // = null!;
+
+    [JsonPropertyName("invite")]
+    public int Invite { get; set; } // = 50;
+
+    [JsonPropertyName("kick")]
+    public int Kick { get; set; } // = 50;
+
+    [JsonPropertyName("notifications")]
+    public NotificationsPL NotificationsPl { get; set; } // = null!;
+
+    [JsonPropertyName("redact")]
+    public int Redact { get; set; } // = 50;
+
+    [JsonPropertyName("state_default")]
+    public int StateDefault { get; set; } // = 50;
+
+    [JsonPropertyName("users")]
+    public Dictionary<string, int> Users { get; set; } // = null!;
+
+    [JsonPropertyName("users_default")]
+    public int UsersDefault { get; set; } // = 0;
+    
+    [Obsolete("Historical was a key related to MSC2716, a spec change on backfill that was dropped!", true)]
+    [JsonIgnore]
+    [JsonPropertyName("historical")]
+    public int Historical { get; set; } // = 50;
+    
+    public class NotificationsPL {
+        [JsonPropertyName("room")]
+        public int Room { get; set; } = 50;
+    }
+}
\ No newline at end of file