summary refs log tree commit diff
path: root/extra/admin-api/Models
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-02-06 05:21:31 +0100
committerRory& <root@rory.gay>2026-02-06 05:21:31 +0100
commit862bfd78038e0f35581ebe5d5416bb6f9bca999e (patch)
tree04c765c5a3cbacce67df0a73a1d970082985fdc2 /extra/admin-api/Models
parentshoot, screwed up the merge conflict (diff)
downloadserver-ts-862bfd78038e0f35581ebe5d5416bb6f9bca999e.tar.xz
C# gw offload work, schema-izing stuff
Diffstat (limited to 'extra/admin-api/Models')
-rw-r--r--extra/admin-api/Models/Spacebar.Models.Gateway/IdentifyRequest.cs89
-rw-r--r--extra/admin-api/Models/Spacebar.Models.Gateway/LazyRequest.cs24
2 files changed, 113 insertions, 0 deletions
diff --git a/extra/admin-api/Models/Spacebar.Models.Gateway/IdentifyRequest.cs b/extra/admin-api/Models/Spacebar.Models.Gateway/IdentifyRequest.cs
new file mode 100644

index 00000000..a956655e --- /dev/null +++ b/extra/admin-api/Models/Spacebar.Models.Gateway/IdentifyRequest.cs
@@ -0,0 +1,89 @@ +using System.Text.Json.Nodes; +using System.Text.Json.Serialization; + +namespace Spacebar.Models.Gateway; + +public class IdentifyRequest +{ + [JsonPropertyName("token")] + public string Token { get; set; } + + [JsonPropertyName("properties")] + public JsonObject ClientProperties { get; set; } + + [JsonPropertyName("compress")] + public bool? Compress { get; set; } + + [JsonPropertyName("large_threshold")] + public int? LargeTreshold { get; set; } + + [JsonPropertyName("shard")] + public int[]? Shard { get; set; } + + [JsonPropertyName("presence")] + public JsonObject? Presence { get; set; } + + [JsonPropertyName("intents")] + public GatewayIntentFlags? Intents { get; set; } + + [JsonPropertyName("capabilities")] + public GatewayCapabilityFlags? Capabilities { get; set; } + + [JsonPropertyName("client_state")] + public JsonObject? ClientState { get; set; } +} + +[Flags] +public enum GatewayIntentFlags +{ + Guilds = 1, + GuildMembers = 1 << 1, + GuildModeration = 1 << 2, + GuildEmojisAndStickers = 1 << 3, + GuildIntegrations = 1 << 4, + GuildWebhooks = 1 << 5, + GuildInvites = 1 << 6, + GuildVoiceStates = 1 << 7, + GuildPresences = 1 << 8, + GuildMessages = 1 << 9, + GuildMessageReactions = 1 << 10, + GuildMessageTyping = 1 << 11, + DirectMessages = 1 << 12, + DirectMessageReactions = 1 << 13, + DirectMessageTyping = 1 << 14, + MessageContent = 1 << 15, + GuildScheduledEvents = 1 << 16, + PrivateEmbeddedActivities = 1 << 17, + PrivateChannels = 1 << 18, + Calls = 1 << 19, + AutoModerationConfiguration = 1 << 20, + AutoModerationExecution = 1 << 21, + UserRelationships = 1 << 22, + UserPresence = 1 << 23, + GuildMessagePolls = 1 << 24, + DirectMessagePolls = 1 << 25, + DirectEmbeddedActivities = 1 << 26, + Lobbies = 1 << 27, + LobbyDelete = 1 << 28 +} + +[Flags] +public enum GatewayCapabilityFlags +{ + LazyUserNotes = 1, + NoAffineUserIds = 1 << 1, + VersionedReadStates = 1 << 2, + VersionedUserGuildSettings = 1 << 3, + DedupeUserObjects = 1 << 4, + PrioritizedReadyPayload = 1 << 5, + MultipleGuildExperimentPopulations = 1 << 6, + NonChannelReadStates = 1 << 7, + AuthTokenRefresh = 1 << 8, + UserSettingsProto = 1 << 9, + ClientStateV2 = 1 << 10, + PassiveGuildUpdate = 1 << 11, + AutoCallConnect = 1 << 12, + DebounceMessageReactions = 1 << 13, + PassiveGuildUpdateV2 = 1 << 14, + AutoLobbyConnect = 1 << 16 +} \ No newline at end of file diff --git a/extra/admin-api/Models/Spacebar.Models.Gateway/LazyRequest.cs b/extra/admin-api/Models/Spacebar.Models.Gateway/LazyRequest.cs new file mode 100644
index 00000000..200dccea --- /dev/null +++ b/extra/admin-api/Models/Spacebar.Models.Gateway/LazyRequest.cs
@@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; + +namespace Spacebar.Models.Gateway; + +public class LazyRequest +{ + [JsonPropertyName("guild_id")] + public string GuildId { get; set; } + + [JsonPropertyName("channels")] + public Dictionary<string, List<List<int>>> Channels { get; set; } + + [JsonPropertyName("members")] + public bool Members { get; set; } + + [JsonPropertyName("threads")] + public bool Threads { get; set; } + + [JsonPropertyName("activities")] + public bool Activities { get; set; } + + [JsonPropertyName("typing")] + public bool Typing { get; set; } +} \ No newline at end of file