buildXml method

  1. @override
void buildXml(
  1. XmlBuilder builder, {
  2. String tag = 'SetIPAddressFilter',
  3. String? namespace = Xmlns.tds,
})
override

Implementation

@override
void buildXml(
  XmlBuilder builder, {
  String tag = 'SetIPAddressFilter',
  String? namespace = Xmlns.tds,
}) =>
    builder.element(tag, nest: () {
      builder.namespace(namespace!);

      type.name.buildXml(builder, tag: 'Type');

      if (prefixedIpv4Addresses.isNotEmpty) {
        for (var address in prefixedIpv4Addresses) {
          address.buildXml(builder, tag: 'IPv4Address');
        }
      }

      if (prefixedIpv6Addresses.isNotEmpty) {
        for (var address in prefixedIpv6Addresses) {
          address.buildXml(builder, tag: 'IPv6Address');
        }
      }
    });