Commits

Dustin Shields-Cloues committed 672d55a

/rejects/list now optionally returns expired rejections

Comments (0)

Files changed (3)

     port:   443,
     prefix: '/api/1.0/',
     method: 'POST',
-    headers: {'Content-Type': 'application/json', 'User-Agent': 'Mandrill-Node/1.0.3'}
+    headers: {'Content-Type': 'application/json', 'User-Agent': 'Mandrill-Node/1.0.4'}
 }
 
 class exports.Mandrill
 
     ###
     Retrieves your email rejection blacklist. You can provide an email
-address to limit the results. Returns up to 1000 results.
+address to limit the results. Returns up to 1000 results. By default,
+entries that have expired are excluded from the results; set
+include_expired to true to include them.
     @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.
     @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 = {}
 
         params["email"] ?= null
+        params["include_expired"] ?= false
 
         @master.call('rejects/list', params, onsuccess, onerror)
 
     method: 'POST',
     headers: {
       'Content-Type': 'application/json',
-      'User-Agent': 'Mandrill-Node/1.0.3'
+      'User-Agent': 'Mandrill-Node/1.0.4'
     }
   };
 
 
     /*
         Retrieves your email rejection blacklist. You can provide an email
-    address to limit the results. Returns up to 1000 results.
+    address to limit the results. Returns up to 1000 results. By default,
+    entries that have expired are excluded from the results; set
+    include_expired to true to include them.
         @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.
         @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;
+      var _ref, _ref1;
       if (params == null) {
         params = {};
       }
       if ((_ref = params["email"]) == null) {
         params["email"] = null;
       }
+      if ((_ref1 = params["include_expired"]) == null) {
+        params["include_expired"] = false;
+      }
       return this.master.call('rejects/list', 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.3",
+  "version": "1.0.4",
   "homepage": "https://bitbucket.org/mailchimp/mandrill-api-node",
   "repository": {
     "type": "git",