about summary refs log tree commit diff
path: root/LibMatrix/Responses/CreationContentBaseType.cs
blob: b4fd8499eb5e91ce75a00473ed28a0fee5682137 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System.Text.Json.Serialization;

namespace LibMatrix.Responses;

public class CreationContentBaseType {
    private readonly CreateRoomRequest _createRoomRequest;

    public CreationContentBaseType(CreateRoomRequest createRoomRequest) => _createRoomRequest = createRoomRequest;

    [JsonPropertyName("type")]
    public string Type {
        get => (string)_createRoomRequest.CreationContent["type"];
        set {
            if (value is "null" or "") _createRoomRequest.CreationContent.Remove("type");
            else _createRoomRequest.CreationContent["type"] = value;
        }
    }
}