setPreset static method

XmlDocumentFragment setPreset(
  1. String profileToken, {
  2. String? presetName,
  3. String? presetToken,
})

XML for the setPreset, requires a profileToken and optionally presetName and/or presetToken

Implementation

static XmlDocumentFragment setPreset(String profileToken,
    {String? presetName, String? presetToken}) {
  Transport.builder.element('SetPreset', nest: () {
    Transport.builder.namespace(Xmlns.tptz);

    ReferenceToken(profileToken).buildXml(Transport.builder);

    if (presetName != null) {
      Transport.builder.element('PresetName', nest: () {
        Transport.builder.namespace(Xmlns.tptz);
        Transport.builder.text(presetName);
      });
    }

    if (presetToken != null) {
      Transport.builder.element('PresetToken', nest: () {
        Transport.builder.namespace(Xmlns.tptz);
        Transport.builder.text(presetToken);
      });
    }
  });

  return Transport.builder.buildFragment();
}