toXml method
XmlElement
toXml(
- String elemName, {
- List<XmlAttribute>? attributes,
})
Implementation
_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
final cacheControl = this.cacheControl;
final contentDisposition = this.contentDisposition;
final contentEncoding = this.contentEncoding;
final contentLanguage = this.contentLanguage;
final contentLength = this.contentLength;
final contentMD5 = this.contentMD5;
final contentType = this.contentType;
final httpExpiresDate = this.httpExpiresDate;
final requesterCharged = this.requesterCharged;
final sSEAlgorithm = this.sSEAlgorithm;
final userMetadata = this.userMetadata;
final $children = <_s.XmlNode>[
if (cacheControl != null)
_s.encodeXmlStringValue('CacheControl', cacheControl),
if (contentDisposition != null)
_s.encodeXmlStringValue('ContentDisposition', contentDisposition),
if (contentEncoding != null)
_s.encodeXmlStringValue('ContentEncoding', contentEncoding),
if (contentLanguage != null)
_s.encodeXmlStringValue('ContentLanguage', contentLanguage),
if (userMetadata != null)
_s.XmlElement(
_s.XmlName('UserMetadata'),
[],
userMetadata.entries.map((e) => _s.XmlElement(
_s.XmlName('entry'), [], <_s.XmlNode>[
_s.encodeXmlStringValue('key', e.key),
_s.encodeXmlStringValue('value', e.value)
]))),
if (contentLength != null)
_s.encodeXmlIntValue('ContentLength', contentLength),
if (contentMD5 != null) _s.encodeXmlStringValue('ContentMD5', contentMD5),
if (contentType != null)
_s.encodeXmlStringValue('ContentType', contentType),
if (httpExpiresDate != null)
_s.encodeXmlDateTimeValue('HttpExpiresDate', httpExpiresDate),
if (requesterCharged != null)
_s.encodeXmlBoolValue('RequesterCharged', requesterCharged),
if (sSEAlgorithm != null)
_s.encodeXmlStringValue('SSEAlgorithm', sSEAlgorithm.toValue()),
];
final $attributes = <_s.XmlAttribute>[
...?attributes,
];
return _s.XmlElement(
_s.XmlName(elemName),
$attributes,
$children,
);
}