about summary refs log tree commit diff
path: root/Utilities/LibMatrix.Utilities.Bot/AppServices/AppServiceConfiguration.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Utilities/LibMatrix.Utilities.Bot/AppServices/AppServiceConfiguration.cs (renamed from Utilities/LibMatrix.Utilities.Bot/AppServiceConfiguration.cs)44
1 files changed, 34 insertions, 10 deletions
diff --git a/Utilities/LibMatrix.Utilities.Bot/AppServiceConfiguration.cs b/Utilities/LibMatrix.Utilities.Bot/AppServices/AppServiceConfiguration.cs

index afda89e..6dc76f6 100644 --- a/Utilities/LibMatrix.Utilities.Bot/AppServiceConfiguration.cs +++ b/Utilities/LibMatrix.Utilities.Bot/AppServices/AppServiceConfiguration.cs
@@ -1,24 +1,48 @@ -namespace LibMatrix.Utilities.Bot; +using System.Text.Json.Serialization; + +namespace LibMatrix.Utilities.Bot.AppServices; public class AppServiceConfiguration { - public string Id { get; set; } = null!; - public string? Url { get; set; } = null!; - public string SenderLocalpart { get; set; } = null!; - public string AppserviceToken { get; set; } = null!; - public string HomeserverToken { get; set; } = null!; - public List<string>? Protocols { get; set; } = null!; - public bool? RateLimited { get; set; } = null!; + [JsonPropertyName("id")] + public string Id { get; set; } + + [JsonPropertyName("url")] + public string? Url { get; set; } + + [JsonPropertyName("sender_localpart")] + public string SenderLocalpart { get; set; } + + [JsonPropertyName("as_token")] + public string AppserviceToken { get; set; } + + [JsonPropertyName("hs_token")] + public string HomeserverToken { get; set; } - public AppserviceNamespaces Namespaces { get; set; } = null!; + [JsonPropertyName("protocols")] + public List<string>? Protocols { get; set; } + + [JsonPropertyName("rate_limited")] + public bool? RateLimited { get; set; } + + [JsonPropertyName("namespaces")] + public AppserviceNamespaces Namespaces { get; set; } public class AppserviceNamespaces { + [JsonPropertyName("users")] public List<AppserviceNamespace>? Users { get; set; } = null; + + [JsonPropertyName("aliases")] public List<AppserviceNamespace>? Aliases { get; set; } = null; + + [JsonPropertyName("rooms")] public List<AppserviceNamespace>? Rooms { get; set; } = null; public class AppserviceNamespace { + [JsonPropertyName("exclusive")] public bool Exclusive { get; set; } - public string Regex { get; set; } = null!; + + [JsonPropertyName("regex")] + public string Regex { get; set; } } }