1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2024-10-17 03:42:50 +02:00
Minecraft-Phantom-Panel/Common/Phantom.Common.Data.Web/Instance/CreateOrUpdateInstanceResult.cs
2023-12-05 14:27:55 +01:00

24 lines
1.0 KiB
C#

namespace Phantom.Common.Data.Web.Instance;
public enum CreateOrUpdateInstanceResult : byte {
UnknownError,
Success,
InstanceNameMustNotBeEmpty,
InstanceMemoryMustNotBeZero,
MinecraftVersionDownloadInfoNotFound,
AgentNotFound
}
public static class CreateOrUpdateInstanceResultExtensions {
public static string ToSentence(this CreateOrUpdateInstanceResult reason) {
return reason switch {
CreateOrUpdateInstanceResult.Success => "Success.",
CreateOrUpdateInstanceResult.InstanceNameMustNotBeEmpty => "Instance name must not be empty.",
CreateOrUpdateInstanceResult.InstanceMemoryMustNotBeZero => "Memory must not be 0 MB.",
CreateOrUpdateInstanceResult.MinecraftVersionDownloadInfoNotFound => "Could not find download information for the selected Minecraft version.",
CreateOrUpdateInstanceResult.AgentNotFound => "Agent not found.",
_ => "Unknown error."
};
}
}