Skip to content

Commit

Permalink
Merge pull request #129 from sabakugaara/feature/mailing-page-api
Browse files Browse the repository at this point in the history
feat add mailing page api
  • Loading branch information
bojand committed Feb 16, 2017
2 parents 2963489 + b9eb9d5 commit 4f38fe6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
22 changes: 21 additions & 1 deletion lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ module.exports = {
"description": "Removes a given spam complaint.",
"href": "/complaints/{address}",
"method": "DELETE",
"title": "delete",
"title": "delete"
}
]
},
Expand Down Expand Up @@ -445,6 +445,26 @@ module.exports = {
}
}
},
{
"description": "Paginate over list members in the given mailing list",
"href": "/lists/{address}/members/pages",
"method": "GET",
"title": "page",
"properties": {
"subscribed": {
"type": "boolean"
},
"limit": {
"type": "number"
},
"page": {
"type": "string"
},
"address": {
"type": "string"
}
}
},
{
"description": "Retrieves a mailing list member.",
"href": "/lists/{address}/members/{member_address}",
Expand Down
9 changes: 9 additions & 0 deletions test/mailgun.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,15 @@ module.exports = {
});
},

'test lists().members().pages().page()': function (done) {
mailgun.lists(fixture.mailingList.address).members().pages().page({page: 'first'}, function (err, body) {
assert.ifError(err);
assert.ok(Array.isArray(body.items));
assert.ok(typeof body.paging === 'object');
done();
});
},

'test lists.members().info()': function (done) {
var data = {
subscribed: true,
Expand Down

0 comments on commit 4f38fe6

Please sign in to comment.