using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class GenericAccessProfileAssignedNumbersInfo
{
	public static GenericAccessProfileAssignedNumbersEnum ValueToGenericAccessProfileAssignedNumbers(uint value)
	{
		return value switch
		{
			1u => GenericAccessProfileAssignedNumbersEnum.FLAGS, 
			2u => GenericAccessProfileAssignedNumbersEnum.INCOMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS, 
			3u => GenericAccessProfileAssignedNumbersEnum.COMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS, 
			4u => GenericAccessProfileAssignedNumbersEnum.INCOMPLETE_LIST_OF_32_BIT_SERVICE_CLASS_UUIDS, 
			5u => GenericAccessProfileAssignedNumbersEnum.COMPLETE_LIST_OF_32_BIT_SERVICE_CLASS_UUIDS, 
			6u => GenericAccessProfileAssignedNumbersEnum.INCOMPLETE_LIST_OF_128_BIT_SERVICE_CLASS_UUIDS, 
			7u => GenericAccessProfileAssignedNumbersEnum.COMPLETE_LIST_OF_128_BIT_SERVICE_CLASS_UUIDS, 
			8u => GenericAccessProfileAssignedNumbersEnum.SHORTENED_LOCAL_NAME, 
			9u => GenericAccessProfileAssignedNumbersEnum.COMPLETE_LOCAL_NAME, 
			_ => GenericAccessProfileAssignedNumbersEnum.InvalidGenericAccessProfileAssignedNumbersValue, 
		};
	}

	public static uint GenericAccessProfileAssignedNumbersToValue(GenericAccessProfileAssignedNumbersEnum enumItem)
	{
		return enumItem switch
		{
			GenericAccessProfileAssignedNumbersEnum.FLAGS => 1u, 
			GenericAccessProfileAssignedNumbersEnum.INCOMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS => 2u, 
			GenericAccessProfileAssignedNumbersEnum.COMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS => 3u, 
			GenericAccessProfileAssignedNumbersEnum.INCOMPLETE_LIST_OF_32_BIT_SERVICE_CLASS_UUIDS => 4u, 
			GenericAccessProfileAssignedNumbersEnum.COMPLETE_LIST_OF_32_BIT_SERVICE_CLASS_UUIDS => 5u, 
			GenericAccessProfileAssignedNumbersEnum.INCOMPLETE_LIST_OF_128_BIT_SERVICE_CLASS_UUIDS => 6u, 
			GenericAccessProfileAssignedNumbersEnum.COMPLETE_LIST_OF_128_BIT_SERVICE_CLASS_UUIDS => 7u, 
			GenericAccessProfileAssignedNumbersEnum.SHORTENED_LOCAL_NAME => 8u, 
			GenericAccessProfileAssignedNumbersEnum.COMPLETE_LOCAL_NAME => 9u, 
			_ => uint.MaxValue, 
		};
	}

	public static string GenericAccessProfileAssignedNumbersToString(GenericAccessProfileAssignedNumbersEnum enumItem)
	{
		return enumItem switch
		{
			GenericAccessProfileAssignedNumbersEnum.FLAGS => "Flags", 
			GenericAccessProfileAssignedNumbersEnum.INCOMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS => "Incomplete List of 16-bit Service Class UUIDs", 
			GenericAccessProfileAssignedNumbersEnum.COMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS => "Complete List of 16-bit Service Class UUIDs", 
			GenericAccessProfileAssignedNumbersEnum.INCOMPLETE_LIST_OF_32_BIT_SERVICE_CLASS_UUIDS => "Incomplete List of 32-bit Service Class UUIDs", 
			GenericAccessProfileAssignedNumbersEnum.COMPLETE_LIST_OF_32_BIT_SERVICE_CLASS_UUIDS => "Complete List of 32-bit Service Class UUIDs", 
			GenericAccessProfileAssignedNumbersEnum.INCOMPLETE_LIST_OF_128_BIT_SERVICE_CLASS_UUIDS => "Incomplete List of 128-bit Service Class UUIDs", 
			GenericAccessProfileAssignedNumbersEnum.COMPLETE_LIST_OF_128_BIT_SERVICE_CLASS_UUIDS => "Complete List of 128-bit Service Class UUIDs", 
			GenericAccessProfileAssignedNumbersEnum.SHORTENED_LOCAL_NAME => "Shortened Local Name", 
			GenericAccessProfileAssignedNumbersEnum.COMPLETE_LOCAL_NAME => "Complete Local Name", 
			_ => "Invalid GenericAccessProfileAssignedNumbers Value", 
		};
	}

	public static string GenericAccessProfileAssignedNumbersToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x1 = Flags");
		stringBuilder.AppendLine("0x2 = Incomplete List of 16-bit Service Class UUIDs");
		stringBuilder.AppendLine("0x3 = Complete List of 16-bit Service Class UUIDs");
		stringBuilder.AppendLine("0x4 = Incomplete List of 32-bit Service Class UUIDs");
		stringBuilder.AppendLine("0x5 = Complete List of 32-bit Service Class UUIDs");
		stringBuilder.AppendLine("0x6 = Incomplete List of 128-bit Service Class UUIDs");
		stringBuilder.AppendLine("0x7 = Complete List of 128-bit Service Class UUIDs");
		stringBuilder.AppendLine("0x8 = Shortened Local Name");
		stringBuilder.AppendLine("0x9 = Complete Local Name");
		return stringBuilder.ToString();
	}
}
