InterfaceLevelsAvailableResponse.fromXML constructor

InterfaceLevelsAvailableResponse.fromXML(
  1. String xmlSTR
)

Implementation

factory InterfaceLevelsAvailableResponse.fromXML(String xmlSTR) {
  final document = XmlDocument.parse(xmlSTR);
  document.findElements("messageName");

  String result = document.rootElement.firstElementChild!.attributes
      .firstWhere((p0) => p0.name.toString() == "result")
      .value;
  List<InterfaceLevel> interfaceLevels = document
      .rootElement.childElements.first.childElements
      .map((e) => InterfaceLevel.fromXML(e.toString()))
      .toList();

  return InterfaceLevelsAvailableResponse(
    interfaceLevels: interfaceLevels,
    result: result,
  );
}