about summary refs log tree commit diff
path: root/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomCreateEventContent.cs
blob: 85198892b721a8d898bb2d0f7b0ed9f8da1b8d7d (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
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;

namespace LibMatrix.EventTypes.Spec.State.RoomInfo;

[MatrixEvent(EventName = EventId)]
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global", Justification = "Deserialization, public API")]
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global", Justification = "Deserialization, public API")]
public class RoomCreateEventContent : EventContent {
    public const string EventId = "m.room.create";

    [JsonPropertyName("room_version")]
    public string? RoomVersion { get; set; }

    // missing in room version 11+
    [JsonPropertyName("creator")]
    public string? Creator { get; set; }

    // v12+
    [JsonPropertyName("additional_creators")]
    public List<string>? AdditionalCreators { get; set; }

    [JsonPropertyName("m.federate")]
    public bool? Federate { get; set; }

    // [JsonPropertyName("predecessor")]
    // public RoomCreatePredecessor? Predecessor { get; set; }

    [JsonPropertyName("type")]
    public string? Type { get; set; }
}

public class RoomCreatePredecessor {
    [JsonPropertyName("room_id")]
    public string? RoomId { get; set; }

    [JsonPropertyName("event_id")]
    public string? EventId { get; set; }
}