Instance.fromXml constructor

Instance.fromXml(
  1. XmlElement elem
)

Implementation

factory Instance.fromXml(_s.XmlElement elem) {
  return Instance(
    availabilityZone: _s.extractXmlStringValue(elem, 'AvailabilityZone')!,
    healthStatus: _s.extractXmlStringValue(elem, 'HealthStatus')!,
    instanceId: _s.extractXmlStringValue(elem, 'InstanceId')!,
    lifecycleState:
        _s.extractXmlStringValue(elem, 'LifecycleState')!.toLifecycleState(),
    protectedFromScaleIn:
        _s.extractXmlBoolValue(elem, 'ProtectedFromScaleIn')!,
    instanceType: _s.extractXmlStringValue(elem, 'InstanceType'),
    launchConfigurationName:
        _s.extractXmlStringValue(elem, 'LaunchConfigurationName'),
    launchTemplate: _s
        .extractXmlChild(elem, 'LaunchTemplate')
        ?.let((e) => LaunchTemplateSpecification.fromXml(e)),
    weightedCapacity: _s.extractXmlStringValue(elem, 'WeightedCapacity'),
  );
}