Commits

MailChimp committed dd47090

Add subaccount filters to rejection blacklists

Comments (0)

Files changed (3)

     port:   443,
     prefix: '/api/1.0/',
     method: 'POST',
-    headers: {'Content-Type': 'application/json', 'User-Agent': 'Mandrill-Node/1.0.33'}
+    headers: {'Content-Type': 'application/json', 'User-Agent': 'Mandrill-Node/1.0.34'}
 }
 
 class exports.Mandrill
 address that has been whitelisted will have no effect.
     @param {Object} params the hash of the parameters to pass to the request
     @option params {String} email an email address to block
+    @option params {String} comment an optional comment describing the rejection
+    @option params {String} subaccount an optional unique identifier for the subaccount to limit the blacklist entry
     @param {Function} onsuccess an optional callback to execute when the API call is successfully made
     @param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception
     ###
             onsuccess = params
             params = {}
 
+        params["comment"] ?= null
+        params["subaccount"] ?= null
 
         @master.call('rejects/add', params, onsuccess, onerror)
 
     @param {Object} params the hash of the parameters to pass to the request
     @option params {String} email an optional email address to search by
     @option params {Boolean} include_expired whether to include rejections that have already expired.
+    @option params {String} subaccount an optional unique identifier for the subaccount to limit the blacklist
     @param {Function} onsuccess an optional callback to execute when the API call is successfully made
     @param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception
     ###
 
         params["email"] ?= null
         params["include_expired"] ?= false
+        params["subaccount"] ?= null
 
         @master.call('rejects/list', params, onsuccess, onerror)
 
 has an affect on your reputation.
     @param {Object} params the hash of the parameters to pass to the request
     @option params {String} email an email address
+    @option params {String} subaccount an optional unique identifier for the subaccount to limit the blacklist deletion
     @param {Function} onsuccess an optional callback to execute when the API call is successfully made
     @param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception
     ###
             onsuccess = params
             params = {}
 
+        params["subaccount"] ?= null
 
         @master.call('rejects/delete', params, onsuccess, onerror)
 class Inbound
     method: 'POST',
     headers: {
       'Content-Type': 'application/json',
-      'User-Agent': 'Mandrill-Node/1.0.33'
+      'User-Agent': 'Mandrill-Node/1.0.34'
     }
   };
 
     address that has been whitelisted will have no effect.
         @param {Object} params the hash of the parameters to pass to the request
         @option params {String} email an email address to block
+        @option params {String} comment an optional comment describing the rejection
+        @option params {String} subaccount an optional unique identifier for the subaccount to limit the blacklist entry
         @param {Function} onsuccess an optional callback to execute when the API call is successfully made
         @param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception
     */
 
 
     Rejects.prototype.add = function(params, onsuccess, onerror) {
+      var _ref, _ref1;
       if (params == null) {
         params = {};
       }
         onsuccess = params;
         params = {};
       }
+      if ((_ref = params["comment"]) == null) {
+        params["comment"] = null;
+      }
+      if ((_ref1 = params["subaccount"]) == null) {
+        params["subaccount"] = null;
+      }
       return this.master.call('rejects/add', params, onsuccess, onerror);
     };
 
         @param {Object} params the hash of the parameters to pass to the request
         @option params {String} email an optional email address to search by
         @option params {Boolean} include_expired whether to include rejections that have already expired.
+        @option params {String} subaccount an optional unique identifier for the subaccount to limit the blacklist
         @param {Function} onsuccess an optional callback to execute when the API call is successfully made
         @param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception
     */
 
 
     Rejects.prototype.list = function(params, onsuccess, onerror) {
-      var _ref, _ref1;
+      var _ref, _ref1, _ref2;
       if (params == null) {
         params = {};
       }
       if ((_ref1 = params["include_expired"]) == null) {
         params["include_expired"] = false;
       }
+      if ((_ref2 = params["subaccount"]) == null) {
+        params["subaccount"] = null;
+      }
       return this.master.call('rejects/list', params, onsuccess, onerror);
     };
 
     has an affect on your reputation.
         @param {Object} params the hash of the parameters to pass to the request
         @option params {String} email an email address
+        @option params {String} subaccount an optional unique identifier for the subaccount to limit the blacklist deletion
         @param {Function} onsuccess an optional callback to execute when the API call is successfully made
         @param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception
     */
 
 
     Rejects.prototype["delete"] = function(params, onsuccess, onerror) {
+      var _ref;
       if (params == null) {
         params = {};
       }
         onsuccess = params;
         params = {};
       }
+      if ((_ref = params["subaccount"]) == null) {
+        params["subaccount"] = null;
+      }
       return this.master.call('rejects/delete', params, onsuccess, onerror);
     };
 
   "author": "Mandrill Devs <community@mandrill.com> (http://mandrill.com)",
   "name": "mandrill-api",
   "description": "The official API client for the Mandrill email as a service product.",
-  "version": "1.0.33",
+  "version": "1.0.34",
   "homepage": "https://bitbucket.org/mailchimp/mandrill-api-node",
   "repository": {
     "type": "git",