toXml method

XmlElement toXml(
  1. String elemName,
  2. {List<XmlAttribute> attributes}
)

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute> attributes}) {
  final $children = <_s.XmlNode>[
    _s.encodeXmlStringValue('CallerReference', callerReference),
    s3Origin?.toXml('S3Origin'),
    if (aliases != null) aliases?.toXml('Aliases'),
    _s.encodeXmlStringValue('Comment', comment),
    if (logging != null) logging?.toXml('Logging'),
    trustedSigners?.toXml('TrustedSigners'),
    if (priceClass != null)
      _s.encodeXmlStringValue('PriceClass', priceClass.toValue()),
    _s.encodeXmlBoolValue('Enabled', enabled),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children.where((e) => e != null),
  );
}