ReservedNode.fromXml constructor

ReservedNode.fromXml(
  1. XmlElement elem
)

Implementation

factory ReservedNode.fromXml(_s.XmlElement elem) {
  return ReservedNode(
    currencyCode: _s.extractXmlStringValue(elem, 'CurrencyCode'),
    duration: _s.extractXmlIntValue(elem, 'Duration'),
    fixedPrice: _s.extractXmlDoubleValue(elem, 'FixedPrice'),
    nodeCount: _s.extractXmlIntValue(elem, 'NodeCount'),
    nodeType: _s.extractXmlStringValue(elem, 'NodeType'),
    offeringType: _s.extractXmlStringValue(elem, 'OfferingType'),
    recurringCharges: _s.extractXmlChild(elem, 'RecurringCharges')?.let(
        (elem) => elem
            .findElements('RecurringCharge')
            .map((c) => RecurringCharge.fromXml(c))
            .toList()),
    reservedNodeId: _s.extractXmlStringValue(elem, 'ReservedNodeId'),
    reservedNodeOfferingId:
        _s.extractXmlStringValue(elem, 'ReservedNodeOfferingId'),
    reservedNodeOfferingType: _s
        .extractXmlStringValue(elem, 'ReservedNodeOfferingType')
        ?.toReservedNodeOfferingType(),
    startTime: _s.extractXmlDateTimeValue(elem, 'StartTime'),
    state: _s.extractXmlStringValue(elem, 'State'),
    usagePrice: _s.extractXmlDoubleValue(elem, 'UsagePrice'),
  );
}