1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2024-11-23 19:42:51 +01:00
Minecraft-Phantom-Panel/Common/Phantom.Common.Data.Web/Users/CreateUserResult.cs
2023-12-05 14:27:55 +01:00

24 lines
847 B
C#

using MemoryPack;
using Phantom.Common.Data.Web.Users.CreateUserResults;
namespace Phantom.Common.Data.Web.Users {
[MemoryPackable]
[MemoryPackUnion(0, typeof(Success))]
[MemoryPackUnion(1, typeof(CreationFailed))]
[MemoryPackUnion(2, typeof(UnknownError))]
public abstract partial record CreateUserResult {
internal CreateUserResult() {}
}
}
namespace Phantom.Common.Data.Web.Users.CreateUserResults {
[MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record Success([property: MemoryPackOrder(0)] UserInfo User) : CreateUserResult;
[MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record CreationFailed([property: MemoryPackOrder(0)] AddUserError Error) : CreateUserResult;
[MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record UnknownError : CreateUserResult;
}