httpTransportTypeFromString function

HttpTransportType httpTransportTypeFromString (String value)

Implementation

HttpTransportType httpTransportTypeFromString(String value) {
  if (value == null) {
    return null;
  }

  value = value.toUpperCase();
  switch (value) {
    case "WEBSOCKETS":
      return HttpTransportType.WebSockets;
      break;
    case "SERVERSENTEVENTS":
      return HttpTransportType.ServerSentEvents;
      break;
    case "LONGPOLLING":
      return HttpTransportType.LongPolling;
      break;
    default:
      throw new GeneralError("$value is not a supported HttpTransportType");
  }
}