Basic federation, move some response classes to the right namespace
4 files changed, 50 insertions, 0 deletions
diff --git a/LibMatrix/Responses/EventIdResponse.cs b/LibMatrix/Responses/EventIdResponse.cs
new file mode 100644
index 0000000..9e23210
--- /dev/null
+++ b/LibMatrix/Responses/EventIdResponse.cs
@@ -0,0 +1,8 @@
+using System.Text.Json.Serialization;
+
+namespace LibMatrix.Responses;
+
+public class EventIdResponse {
+ [JsonPropertyName("event_id")]
+ public required string EventId { get; set; }
+}
\ No newline at end of file
diff --git a/LibMatrix/Responses/MessagesResponse.cs b/LibMatrix/Responses/MessagesResponse.cs
new file mode 100644
index 0000000..4912add
--- /dev/null
+++ b/LibMatrix/Responses/MessagesResponse.cs
@@ -0,0 +1,17 @@
+using System.Text.Json.Serialization;
+
+namespace LibMatrix.Responses;
+
+public class MessagesResponse {
+ [JsonPropertyName("start")]
+ public string Start { get; set; }
+
+ [JsonPropertyName("end")]
+ public string? End { get; set; }
+
+ [JsonPropertyName("chunk")]
+ public List<StateEventResponse> Chunk { get; set; } = new();
+
+ [JsonPropertyName("state")]
+ public List<StateEventResponse> State { get; set; } = new();
+}
\ No newline at end of file
diff --git a/LibMatrix/Responses/UserIdAndReason.cs b/LibMatrix/Responses/UserIdAndReason.cs
new file mode 100644
index 0000000..176cf7c
--- /dev/null
+++ b/LibMatrix/Responses/UserIdAndReason.cs
@@ -0,0 +1,11 @@
+using System.Text.Json.Serialization;
+
+namespace LibMatrix.Responses;
+
+internal class UserIdAndReason(string userId = null!, string reason = null!) {
+ [JsonPropertyName("user_id")]
+ public string UserId { get; set; } = userId;
+
+ [JsonPropertyName("reason")]
+ public string? Reason { get; set; } = reason;
+}
\ No newline at end of file
diff --git a/LibMatrix/Responses/WhoAmIResponse.cs b/LibMatrix/Responses/WhoAmIResponse.cs
new file mode 100644
index 0000000..db47152
--- /dev/null
+++ b/LibMatrix/Responses/WhoAmIResponse.cs
@@ -0,0 +1,14 @@
+using System.Text.Json.Serialization;
+
+namespace LibMatrix.Responses;
+
+public class WhoAmIResponse {
+ [JsonPropertyName("user_id")]
+ public required string UserId { get; set; }
+
+ [JsonPropertyName("device_id")]
+ public string? DeviceId { get; set; }
+
+ [JsonPropertyName("is_guest")]
+ public bool? IsGuest { get; set; }
+}
\ No newline at end of file
|