Class EnumConverter
- Namespace
- AssemblyAI
- Assembly
- AssemblyAI.dll
Convert an AssemblyAI enum to a string and vice versa.
public static class EnumConverter
- Inheritance
-
EnumConverter
- Inherited Members
Methods
ToEnum<T>(string)
Convert a string value to an enum. For example, "en_us" to TranscriptLanguageCode.EnUs.
public static T ToEnum<T>(string value) where T : Enum
Parameters
value
stringString value of the enum
Returns
- T
An enum value of the given enum type
Type Parameters
T
The enum type to convert into
Remarks
This method uses the Value property of EnumMemberAttribute on the given enum value.
ToString<T>(T)
Convert an enum value to a string value. For example, TranscriptLanguageCode.EnUs to "en_us".
public static string ToString<T>(T value) where T : Enum
Parameters
value
TEnum value
Returns
- string
The string value of the given enum
Type Parameters
T
Remarks
This method uses the Value property of EnumMemberAttribute on the given enum value.