diff options
Diffstat (limited to 'MatrixRoomUtils.Core/Responses/CreationContentBaseType.cs')
-rw-r--r-- | MatrixRoomUtils.Core/Responses/CreationContentBaseType.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Core/Responses/CreationContentBaseType.cs b/MatrixRoomUtils.Core/Responses/CreationContentBaseType.cs new file mode 100644 index 0000000..743c552 --- /dev/null +++ b/MatrixRoomUtils.Core/Responses/CreationContentBaseType.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; + +namespace MatrixRoomUtils.Core.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; + } + } +} \ No newline at end of file |