Snapshot.fromXml constructor

Snapshot.fromXml(
  1. XmlElement elem
)

Implementation

factory Snapshot.fromXml(_s.XmlElement elem) {
  return Snapshot(
    arn: _s.extractXmlStringValue(elem, 'ARN'),
    autoMinorVersionUpgrade:
        _s.extractXmlBoolValue(elem, 'AutoMinorVersionUpgrade'),
    automaticFailover: _s
        .extractXmlStringValue(elem, 'AutomaticFailover')
        ?.toAutomaticFailoverStatus(),
    cacheClusterCreateTime:
        _s.extractXmlDateTimeValue(elem, 'CacheClusterCreateTime'),
    cacheClusterId: _s.extractXmlStringValue(elem, 'CacheClusterId'),
    cacheNodeType: _s.extractXmlStringValue(elem, 'CacheNodeType'),
    cacheParameterGroupName:
        _s.extractXmlStringValue(elem, 'CacheParameterGroupName'),
    cacheSubnetGroupName:
        _s.extractXmlStringValue(elem, 'CacheSubnetGroupName'),
    engine: _s.extractXmlStringValue(elem, 'Engine'),
    engineVersion: _s.extractXmlStringValue(elem, 'EngineVersion'),
    kmsKeyId: _s.extractXmlStringValue(elem, 'KmsKeyId'),
    nodeSnapshots: _s.extractXmlChild(elem, 'NodeSnapshots')?.let((elem) =>
        elem
            .findElements('NodeSnapshot')
            .map((c) => NodeSnapshot.fromXml(c))
            .toList()),
    numCacheNodes: _s.extractXmlIntValue(elem, 'NumCacheNodes'),
    numNodeGroups: _s.extractXmlIntValue(elem, 'NumNodeGroups'),
    port: _s.extractXmlIntValue(elem, 'Port'),
    preferredAvailabilityZone:
        _s.extractXmlStringValue(elem, 'PreferredAvailabilityZone'),
    preferredMaintenanceWindow:
        _s.extractXmlStringValue(elem, 'PreferredMaintenanceWindow'),
    preferredOutpostArn:
        _s.extractXmlStringValue(elem, 'PreferredOutpostArn'),
    replicationGroupDescription:
        _s.extractXmlStringValue(elem, 'ReplicationGroupDescription'),
    replicationGroupId: _s.extractXmlStringValue(elem, 'ReplicationGroupId'),
    snapshotName: _s.extractXmlStringValue(elem, 'SnapshotName'),
    snapshotRetentionLimit:
        _s.extractXmlIntValue(elem, 'SnapshotRetentionLimit'),
    snapshotSource: _s.extractXmlStringValue(elem, 'SnapshotSource'),
    snapshotStatus: _s.extractXmlStringValue(elem, 'SnapshotStatus'),
    snapshotWindow: _s.extractXmlStringValue(elem, 'SnapshotWindow'),
    topicArn: _s.extractXmlStringValue(elem, 'TopicArn'),
    vpcId: _s.extractXmlStringValue(elem, 'VpcId'),
  );
}