ObjectVersion.fromXml constructor

ObjectVersion.fromXml(
  1. XmlElement xml
)

Implementation

ObjectVersion.fromXml(XmlElement xml) {
  eTag = getProp(xml, 'ETag')?.innerText;
  isLatest = getProp(xml, 'IsLatest')?.innerText.toUpperCase() == 'TRUE';
  key = getProp(xml, 'Key')?.innerText;
  lastModified = DateTime.parse(getProp(xml, 'LastModified')!.innerText);
  owner = Owner.fromXml(getProp(xml, 'Owner'));
  size = int.tryParse(getProp(xml, 'Size')!.innerText);
  storageClass = getProp(xml, 'StorageClass')?.innerText;
  versionId = getProp(xml, 'VersionId')?.innerText;
}