summary refs log tree commit diff
path: root/extra/admin-api/Models/Spacebar.Models.Generic/PresenceResponse.cs
blob: 0374a2bb13277e80649c680c1a49f83e550707e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using Spacebar.Models.Generic;

namespace Spacebar.Models.Generic;

public class Presence {
    [JsonPropertyName("user")]
    public required PartialUser User { get; set; }

    [JsonPropertyName("guild_id"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
    public long? GuildId { get; set; }

    [JsonPropertyName("status")]
    public string Status { get; set; } = "unknown";

    // TODO
    [JsonPropertyName("activities")]
    public List<JsonObject> Activities { get; set; }

    // TODO
    [JsonPropertyName("hidden_activities")]
    public List<JsonObject> HiddenActivities { get; set; }

    [JsonPropertyName("client_status")]
    public ClientStatuses ClientStatus { get; set; }

    [JsonPropertyName("has_played_game")]
    public bool? HasPlayedGame { get; set; }

    // Unsure if this is used outside of op14
    [JsonPropertyName("game")]
    public JsonObject? Game { get; set; }

    // Unsure if used outside of op14
    [JsonPropertyName("processed_at_timestamp")]
    public ulong? ProcessedAtTimestamp { get; set; }

    [SuppressMessage("ReSharper", "UnusedMember.Local")]
    public class ClientStatuses {
        [JsonPropertyName("desktop"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public string? Desktop { get; set; }

        [JsonPropertyName("mobile"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public string? Mobile { get; set; }

        [JsonPropertyName("web"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public string? Web { get; set; }

        [JsonPropertyName("embedded"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public string? Embedded { get; set; }

        [JsonPropertyName("vr"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public string? Vr { get; set; }
    }
}