<commit_before>
var Notification = function(alert) {

    this.json = {
        'message': {
            'alert': alert
        },
        'target': {},
        'settings': {}
    };

    this.setUrl = function(url) {
        if (url !== null) {
            this.json.message.url = url;
        }
    };

    this.setTarget = function(deviceIds, platforms, tagNames, userIds) {
        var targetJson = {
            'deviceIds': deviceIds,
            'platforms': platforms,
            'tagNames': tagNames,
            'userIds': userIds
        };
        this.json.target = removeNullValues(targetJson);
    };

    this.setApnsSettings = function(badge, category, iosActionKey, sound, type, payload) {
        var apnsJson = {
            'badge': badge,
            'category': category,
            'iosActionKey': iosActionKey,
            'sound': sound,
            'type': type,
            'payload': payload
        };
        this.json.settings.apns = removeNullValues(apnsJson);
    };

    this.setGcmSettings = function(collapseKey, delayWhileIdle, payload, priority, sound, timeToLive) {
        var gcmJson = {
            'collapseKey': collapseKey,
            'delayWhileIdle': delayWhileIdle,
            'payload': payload,
            'priority': priority,
            'sound': sound,
            'timeToLive': timeToLive
        };
        this.json.settings.gcm = removeNullValues(gcmJson);
    };
};


// The Bluemix Push service cannot handle null values, so we need to remove them before sending.
var removeNullValues = function(json) {

    for (var key in json) {
        if (json.hasOwnProperty(key)) {
            if (json[key] === null) {
                delete json[key];
            }
        }
    }
    return json;
};


module.exports = Notification;<commit_msg>Added enums to use in Notification setters<commit_after>
var Notification = function(alert) {

    this.json = {
        'message': {
            'alert': alert
        },
        'target': {},
        'settings': {}
    };

    this.setUrl = function(url) {
        if (url !== null) {
            this.json.message.url = url;
        }
    };

    this.setTarget = function(deviceIds, platforms, tagNames, userIds) {
        var targetJson = {
            'deviceIds': deviceIds,
            'platforms': platforms,
            'tagNames': tagNames,
            'userIds': userIds
        };
        this.json.target = removeNullValues(targetJson);
    };

    this.setApnsSettings = function(badge, category, iosActionKey, sound, type, payload) {
        var apnsJson = {
            'badge': badge,
            'category': category,
            'iosActionKey': iosActionKey,
            'sound': sound,
            'type': type,
            'payload': payload
        };
        this.json.settings.apns = removeNullValues(apnsJson);
    };

    this.setGcmSettings = function(collapseKey, delayWhileIdle, payload, priority, sound, timeToLive) {
        var gcmJson = {
            'collapseKey': collapseKey,
            'delayWhileIdle': delayWhileIdle,
            'payload': payload,
            'priority': priority,
            'sound': sound,
            'timeToLive': timeToLive
        };
        this.json.settings.gcm = removeNullValues(gcmJson);
    };
};


Notification.TargetPlatform = {
    Apple: "A",
    Google: "G",
    Microsoft: "M"
};


Notification.ApnsType = {
    DEFAULT: "DEFAULT",
    MIXED: "MIXED",
    SILENT: "SILENT"
}


Notification.GcmPriority = {
    DEFAULT: "DEFAULT",
    MIN: "MIN",
    LOW: "LOW",
    HIGH: "HIGH",
    MAX: "MAX"
}


// The Bluemix Push service cannot handle null values, so we need to remove them before sending.
var removeNullValues = function(json) {

    for (var key in json) {
        if (json.hasOwnProperty(key)) {
            if (json[key] === null) {
                delete json[key];
            }
        }
    }
    return json;
};


module.exports = Notification;
{'fraction_non_alphanumeric': 0.12376363175247274, 'fraction_numerical': 0.0, 'mean_word_length': 1.8746355685131195, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4359144', 'n_tokens_mistral': 1162, 'n_tokens_neox': 1132, 'n_words': 262}