diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-25 03:07:05 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-25 03:07:05 +0200 |
commit | f866946fbbe962c712049327ade9dcbd43900295 (patch) | |
tree | 3400fcce20f68a6ef3eb130f4ef57733e346d0e9 /MatrixRoomUtils.Core/Responses/CreationContentBaseType.cs | |
parent | Working sync (diff) | |
download | MatrixUtils-f866946fbbe962c712049327ade9dcbd43900295.tar.xz |
Working state, refactored Rory&::LibMatrix
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 |