Commits

MailChimp  committed dbfe39d

Add description field to webhooks

  • Participants
  • Parent commits 92297f8
  • Tags 1.0.17

Comments (0)

Files changed (3)

File mandrill.coffee

     port:   443,
     prefix: '/api/1.0/',
     method: 'POST',
-    headers: {'Content-Type': 'application/json', 'User-Agent': 'Mandrill-Node/1.0.16'}
+    headers: {'Content-Type': 'application/json', 'User-Agent': 'Mandrill-Node/1.0.17'}
 }
 
 class exports.Mandrill
     Add a new webhook
     @param {Object} params the hash of the parameters to pass to the request
     @option params {String} url the URL to POST batches of events
+    @option params {String} description an optional description of the webhook
     @option params {Array} events an optional list of events that will be posted to the webhook
          - events[] {String} the individual event to listen for
     @param {Function} onsuccess an optional callback to execute when the API call is successfully made
             onsuccess = params
             params = {}
 
+        params["description"] ?= null
         params["events"] ?= []
 
         @master.call('webhooks/add', params, onsuccess, onerror)
     @param {Object} params the hash of the parameters to pass to the request
     @option params {Integer} id the unique identifier of a webhook belonging to this account
     @option params {String} url the URL to POST batches of events
+    @option params {String} description an optional description of the webhook
     @option params {Array} events an optional list of events that will be posted to the webhook
          - events[] {String} the individual event to listen for
     @param {Function} onsuccess an optional callback to execute when the API call is successfully made
             onsuccess = params
             params = {}
 
+        params["description"] ?= null
         params["events"] ?= []
 
         @master.call('webhooks/update', params, onsuccess, onerror)
     method: 'POST',
     headers: {
       'Content-Type': 'application/json',
-      'User-Agent': 'Mandrill-Node/1.0.16'
+      'User-Agent': 'Mandrill-Node/1.0.17'
     }
   };
 
         Add a new webhook
         @param {Object} params the hash of the parameters to pass to the request
         @option params {String} url the URL to POST batches of events
+        @option params {String} description an optional description of the webhook
         @option params {Array} events an optional list of events that will be posted to the webhook
              - events[] {String} the individual event to listen for
         @param {Function} onsuccess an optional callback to execute when the API call is successfully made
 
 
     Webhooks.prototype.add = function(params, onsuccess, onerror) {
-      var _ref;
+      var _ref, _ref1;
       if (params == null) {
         params = {};
       }
         onsuccess = params;
         params = {};
       }
-      if ((_ref = params["events"]) == null) {
+      if ((_ref = params["description"]) == null) {
+        params["description"] = null;
+      }
+      if ((_ref1 = params["events"]) == null) {
         params["events"] = [];
       }
       return this.master.call('webhooks/add', params, onsuccess, onerror);
         @param {Object} params the hash of the parameters to pass to the request
         @option params {Integer} id the unique identifier of a webhook belonging to this account
         @option params {String} url the URL to POST batches of events
+        @option params {String} description an optional description of the webhook
         @option params {Array} events an optional list of events that will be posted to the webhook
              - events[] {String} the individual event to listen for
         @param {Function} onsuccess an optional callback to execute when the API call is successfully made
 
 
     Webhooks.prototype.update = function(params, onsuccess, onerror) {
-      var _ref;
+      var _ref, _ref1;
       if (params == null) {
         params = {};
       }
         onsuccess = params;
         params = {};
       }
-      if ((_ref = params["events"]) == null) {
+      if ((_ref = params["description"]) == null) {
+        params["description"] = null;
+      }
+      if ((_ref1 = params["events"]) == null) {
         params["events"] = [];
       }
       return this.master.call('webhooks/update', params, onsuccess, onerror);

File package.json

   "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.16",
+  "version": "1.0.17",
   "homepage": "https://bitbucket.org/mailchimp/mandrill-api-node",
   "repository": {
     "type": "git",