ObjectVersion.fromXml constructor

ObjectVersion.fromXml(
  1. XmlElement xml
)

Implementation

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