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