ReplicationRule.fromXml constructor
ReplicationRule.fromXml(
- XmlElement? xml
Implementation
ReplicationRule.fromXml(XmlElement? xml) {
deleteMarkerReplication = DeleteMarkerReplication.fromXml(
getProp(xml, 'DeleteMarkerReplication'));
destination = Destination.fromXml(getProp(xml, 'Destination'));
existingObjectReplication = ExistingObjectReplication.fromXml(
getProp(xml, 'ExistingObjectReplication'));
filter = ReplicationRuleFilter.fromXml(getProp(xml, 'Filter'));
iD = getProp(xml, 'ID')?.value;
prefix = getProp(xml, 'Prefix')?.value;
// Safely parse the priority only if the value is not null
final priorityValue = getProp(xml, 'Priority')?.value;
priority = priorityValue != null ? int.tryParse(priorityValue) : null;
sourceSelectionCriteria = SourceSelectionCriteria.fromXml(
getProp(xml, 'SourceSelectionCriteria'));
status = getProp(xml, 'Status')?.value;
}