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}) {
  builder.element('SetPreset', nest: () {
    builder.namespace(Xmlns.tptz);

    ReferenceToken(profileToken).buildXml(builder);

    presetName
        ?.toString()
        .buildXml(builder, tag: 'PresetName', namespace: Xmlns.tptz);

    if (presetToken != null) {
      ReferenceToken(presetToken).buildXml(
        builder,
        tag: 'PresetToken',
        namespace: Xmlns.tptz,
      );
    }
  });

  return builder.buildFragment();
}