ApplicationStopCommandRequest.fromXML constructor

ApplicationStopCommandRequest.fromXML(
  1. String xmlSTR
)

Implementation

factory ApplicationStopCommandRequest.fromXML(String xmlSTR) {
  final document = XmlDocument.parse(xmlSTR);
  String stopMessage = document.rootElement.childElements.first.attributes
      .firstWhere((p0) => p0.name.toString() == "stopMessage",
          orElse: orElseEmpty)
      .value;
  String canDefer = document.rootElement.childElements.first.attributes
      .firstWhere((p0) => p0.name.toString() == "canDefer",
          orElse: orElseEmpty)
      .value;
  String messageID = document.rootElement.attributes
      .firstWhere((p0) => p0.name.toString() == "messageID")
      .value;

  return ApplicationStopCommandRequest(
      canDefer: canDefer,
      stopMessage: stopMessage,
      messageID: int.parse(messageID));
}