about summary refs log tree commit diff
path: root/LibMatrix/Responses/CreationContentBaseType.cs
blob: 073bb604cc29b12db32dcf1b068642f6f047e45c (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) => this._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;
        }
    }
}