<commit_before>var CreateSend = require('../createsend');


/**
 * # .subscriberAdd(listId, subscriber, [callback])
 *
 * Adds a subscriber to an existing subscriber list, including custom
 * field data if supplied. If the subscriber (email address) already
 * exists, their name and any custom field values are updated with
 * whatever is passed in.
 *
 * @name subscriberAdd
 * @param {String} ListId
 * @param {Object} subscriber details
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#adding_a_subscriber
 * @api public
 */

CreateSend.prototype.subscriberAdd = function (listId, subscriber, callback) {
  this.execute('POST', 'subscribers/' + listId, null, subscriber, callback);
};

/**
 * # .subscriberUpdate(listId, email, subscriber, [callback])
 *
 * Updates any aspect of an existing subscriber, including
 * email address, name, and custom field data if supplied.
 *
 * @name subscriberUpdate
 * @param {String} ListId
 * @param {String} email
 * @param {Object} subscriber details
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#updating_a_subscriber
 * @api public
 */

CreateSend.prototype.subscriberUpdate = function (listId, email, subscriber, callback) {
  this.execute('PUT', 'subscribers/' + listId, { 'email': email }, subscriber, callback);
};

/**
 * # .subscribersImport(listId, subscribers, [callback])
 *
 * Allows you to add many subscribers to a subscriber list in one
 * API request, including custom field data if supplied. If a
 * subscriber (email address) already exists, their name and any
 * custom field values are updated with whatever is passed in.
 *
 * @name subscribersImport
 * @param {String} ListId
 * @param {Object} subscribers list
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#importing_subscribers
 * @api public
 */

CreateSend.prototype.subscribersImport = function (listId, subscribers, callback) {
  this.execute('POST', 'subscribers/' + listId + '/import', null, subscribers, callback);
};

/**
 * # .subscriberDetails(listId, subscribers, [callback])
 *
 * Retrieves a subscriber's details including their email address,
 * name, active/inactive state, and any custom field data.
 *
 * @name subscriberDetails
 * @param {String} ListId
 * @param {String} email
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#getting_subscriber_details
 * @api public
 */

CreateSend.prototype.subscriberDetails = function (listId, email, callback) {
  this.execute('GET', 'subscribers/' + listId, { 'email': email }, null, callback);
};

/**
 * # .subscriberHistory(listId, email, [callback])
 *
 * Retrieves a list of campaigns and or autoresponder emails,
 * in response to which a subscriber has made some trackable action.
 *
 * @name subscriberHistory
 * @param {String} ListId
 * @param {String} email
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#getting_subscriber_history
 * @api public
 */

CreateSend.prototype.subscriberHistory = function (listId, email, callback) {
  this.execute('GET', 'subscribers/' + listId + '/history', { 'email': email }, null, callback);
};

};<commit_msg>[feature] #subscriberUnsubscribe / #subscriberDelete<commit_after>var CreateSend = require('../createsend');


/**
 * # .subscriberAdd(listId, subscriber, [callback])
 *
 * Adds a subscriber to an existing subscriber list, including custom
 * field data if supplied. If the subscriber (email address) already
 * exists, their name and any custom field values are updated with
 * whatever is passed in.
 *
 * @name subscriberAdd
 * @param {String} ListId
 * @param {Object} subscriber details
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#adding_a_subscriber
 * @api public
 */

CreateSend.prototype.subscriberAdd = function (listId, subscriber, callback) {
  this.execute('POST', 'subscribers/' + listId, null, subscriber, callback);
};

/**
 * # .subscriberUpdate(listId, email, subscriber, [callback])
 *
 * Updates any aspect of an existing subscriber, including
 * email address, name, and custom field data if supplied.
 *
 * @name subscriberUpdate
 * @param {String} ListId
 * @param {String} email
 * @param {Object} subscriber details
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#updating_a_subscriber
 * @api public
 */

CreateSend.prototype.subscriberUpdate = function (listId, email, subscriber, callback) {
  this.execute('PUT', 'subscribers/' + listId, { 'email': email }, subscriber, callback);
};

/**
 * # .subscribersImport(listId, subscribers, [callback])
 *
 * Allows you to add many subscribers to a subscriber list in one
 * API request, including custom field data if supplied. If a
 * subscriber (email address) already exists, their name and any
 * custom field values are updated with whatever is passed in.
 *
 * @name subscribersImport
 * @param {String} ListId
 * @param {Object} subscribers list
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#importing_subscribers
 * @api public
 */

CreateSend.prototype.subscribersImport = function (listId, subscribers, callback) {
  this.execute('POST', 'subscribers/' + listId + '/import', null, subscribers, callback);
};

/**
 * # .subscriberDetails(listId, subscribers, [callback])
 *
 * Retrieves a subscriber's details including their email address,
 * name, active/inactive state, and any custom field data.
 *
 * @name subscriberDetails
 * @param {String} ListId
 * @param {String} email
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#getting_subscriber_details
 * @api public
 */

CreateSend.prototype.subscriberDetails = function (listId, email, callback) {
  this.execute('GET', 'subscribers/' + listId, { 'email': email }, null, callback);
};

/**
 * # .subscriberHistory(listId, email, [callback])
 *
 * Retrieves a list of campaigns and or autoresponder emails,
 * in response to which a subscriber has made some trackable action.
 *
 * @name subscriberHistory
 * @param {String} ListId
 * @param {String} email
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#getting_subscriber_history
 * @api public
 */

CreateSend.prototype.subscriberHistory = function (listId, email, callback) {
  this.execute('GET', 'subscribers/' + listId + '/history', { 'email': email }, null, callback);
};

/**
 * # .subscriberUnsubscribe(listId, email, [callback])
 *
 * Changes the status of an Active Subscriber to an Unsubscribed
 * Subscriber who will no longer receive campaigns sent to the subscriber
 * list to which they belong.
 *
 * @name subscriberUnsubscribe
 * @param {String} ListId
 * @param {String} email
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#unsubscribing_a_subscriber
 * @api public
 */

CreateSend.prototype.subscriberUnsubscribe = function (listId, email, callback) {
  this.execute('POST', 'subscribers/' + listId + '/unsubscribe', null, { 'EmailAddress': email }, callback);
};

/**
 * # .subscriberDelete(listId, email, [callback])
 *
 * Changes the status of an Active Subscriber to a Deleted Subscriber
 * who will no longer receive campaigns sent to the subscriber list to which they belong.
 *
 * @name subscriberDelete
 * @param {String} ListId
 * @param {String} email
 * @param {Function} callback (optional)
 * @see http://www.campaignmonitor.com/api/subscribers/#deleting_a_subscriber
 * @api public
 */

CreateSend.prototype.subscriberDelete = function (listId, email, callback) {
  this.execute('DELETE', 'subscribers/' + listId, { email: email }, null, callback);
};
{'fraction_non_alphanumeric': 0.12881873727087575, 'fraction_numerical': 0.0, 'mean_word_length': 4.7687224669603525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, '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': '2947066', 'n_tokens_mistral': 2317, 'n_tokens_neox': 2225, 'n_words': 707}