method static method
Gets an APIMethod enum value from a string path.
Returns the corresponding enum value if found. Throws if no matching method is found.
Implementation
static APIMethod method(String path) {
return APIMethod.values.firstWhere((element) => element.name == path);
}