www/UrbanAirship.js
/**
 * Helper object to edit tag groups.
 *
 * Normally not created directly. Instead use [UrbanAirship.editNamedUserTagGroups]{@link module:UrbanAirship.editNamedUserTagGroups}
 * or [UrbanAirship.editChannelTagGroups]{@link module:UrbanAirship.editChannelTagGroups}.
 *
 * @class TagGroupEditor
 * @param nativeMethod The native method to call on apply.
 */
Helper object to edit tag groups.
Normally not created directly.

@class TagGroupEditor
@param nativeMethod The native method to call on apply.
Helper object to edit tag groups . Normally not created directly . @class TagGroupEditor @param nativeMethod The native method to call on apply .
function TagGroupEditor(nativeMethod) {
    var operations = []
    var editor = {}
    editor.addTags = function(tagGroup, tags) {
      argscheck.checkArgs('sa', "TagGroupEditor#addTags", arguments)
      var operation = { "operation": "add", "group": tagGroup, "tags": tags }
      operations.push(operation)
      return editor
    }
    editor.removeTags = function(tagGroup, tags) {
      argscheck.checkArgs('sa', "TagGroupEditor#removeTags", arguments)
      var operation = { "operation": "remove", "group": tagGroup, "tags": tags }
      operations.push(operation)
      return editor
    }
    editor.apply = function(success, failure) {
      argscheck.checkArgs('FF', "TagGroupEditor#apply", arguments)
      callNative(success, failure, nativeMethod, [operations])
      operations = []
      return editor
    }
    return editor
}
function TagGroupEditor ( nativeMethod ) { var operations = [ ] var editor = { } editor . addTags = function ( tagGroup , tags ) { argscheck . checkArgs ( 'sa' , "TagGroupEditor#addTags" , arguments ) var operation = { "operation" : "add" , "group" : tagGroup , "tags" : tags } operations . push ( operation ) return editor } editor . removeTags = function ( tagGroup , tags ) { argscheck . checkArgs ( 'sa' , "TagGroupEditor#removeTags" , arguments ) var operation = { "operation" : "remove" , "group" : tagGroup , "tags" : tags } operations . push ( operation ) return editor } editor . apply = function ( success , failure ) { argscheck . checkArgs ( 'FF' , "TagGroupEditor#apply" , arguments ) callNative ( success , failure , nativeMethod , [ operations ] ) operations = [ ] return editor } return editor }
Helper object to edit tag groups.
Helper object to edit tag groups .
// Store the raw operations and let the SDK combine them /**
     * Adds tags to a tag group.
     * @instance
     * @memberof TagGroupEditor
     * @function addTags
     *
     * @param {string} tagGroup The tag group.
     * @param {array<string>} tags Tags to add.
     * @return {TagGroupEditor} The tag group editor instance.
     */ /**
     * Removes a tag from the tag group.
     * @instance
     * @memberof TagGroupEditor
     * @function removeTags
     *
     * @param {string} tagGroup The tag group.
     * @param {array<string>} tags Tags to remove.
     * @return {TagGroupEditor} The tag group editor instance.
     */ /**
     * Applies the tag changes.
     * @instance
     * @memberof TagGroupEditor
     * @function apply
     *
     * @param {function} [success] Success callback.
     * @param {function(message)} [failure] Failure callback.
     * @param {string} failure.message The failure message.
     * @return {TagGroupEditor} The tag group editor instance.
     */