diff --git a/CHANGELOG.md b/CHANGELOG.md index 77a6eeac..8a621d81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # Change Log All notable changes to this project will be documented in this file. +## [4.0.2] - 2016-07-26 ## +### Fixed +- Example and USAGE DELETE calls were missing example payloads + +## [4.0.1] - 2016-07-25 ## +### Added +- [Troubleshooting](https://github.com/sendgrid/sendgrid-ruby/blob/master/TROUBLESHOOTING.md) section + ## [4.0.0] - 2016-07-23 ## ### BREAKING CHANGE - Update dependency to [ruby-http-client](https://github.com/sendgrid/ruby-http-client/releases/tag/v3.0.0) diff --git a/USAGE.md b/USAGE.md index cc2ae65e..832fc11a 100644 --- a/USAGE.md +++ b/USAGE.md @@ -122,6 +122,13 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ ```ruby +data = JSON.parse('{ + "ids": [ + 1, + 2, + 3 + ] +}') response = sg.client.access_settings.whitelist.delete(request_body: data) puts response.status_code puts response.body @@ -1192,6 +1199,12 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ```ruby +data = JSON.parse('[ + 1, + 2, + 3, + 4 +]') response = sg.client.contactdb.lists.delete(request_body: data) puts response.status_code puts response.body @@ -1414,6 +1427,10 @@ The contactdb is a database of your contacts for [SendGrid Marketing Campaigns]( ```ruby +data = JSON.parse('[ + "recipient_id1", + "recipient_id2" +]') response = sg.client.contactdb.recipients.delete(request_body: data) puts response.status_code puts response.body @@ -3165,6 +3182,13 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/User ```ruby +data = JSON.parse('{ + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] +}') response = sg.client.suppression.blocks.delete(request_body: data) puts response.status_code puts response.body @@ -3245,6 +3269,13 @@ Note: the `delete_all` and `emails` parameters should be used independently of e ```ruby +data = JSON.parse('{ + "delete_all": true, + "emails": [ + "example@example.com", + "example2@example.com" + ] +}') response = sg.client.suppression.bounces.delete(request_body: data) puts response.status_code puts response.body @@ -3334,6 +3365,13 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/User ```ruby +data = JSON.parse('{ + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] +}') response = sg.client.suppression.invalid_emails.delete(request_body: data) puts response.status_code puts response.body @@ -3450,6 +3488,13 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/User ```ruby +data = JSON.parse('{ + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] +}') response = sg.client.suppression.spam_reports.delete(request_body: data) puts response.status_code puts response.body diff --git a/examples/accesssettings/accesssettings.rb b/examples/accesssettings/accesssettings.rb index 61e0b0bf..9b832e85 100644 --- a/examples/accesssettings/accesssettings.rb +++ b/examples/accesssettings/accesssettings.rb @@ -49,6 +49,13 @@ # Remove one or more IPs from the whitelist # # DELETE /access_settings/whitelist # +data = JSON.parse('{ + "ids": [ + 1, + 2, + 3 + ] +}') response = sg.client.access_settings.whitelist.delete(request_body: data) puts response.status_code puts response.body diff --git a/examples/contactdb/contactdb.rb b/examples/contactdb/contactdb.rb index 71f3cc8f..856549c1 100644 --- a/examples/contactdb/contactdb.rb +++ b/examples/contactdb/contactdb.rb @@ -71,6 +71,12 @@ # Delete Multiple lists # # DELETE /contactdb/lists # +data = JSON.parse('[ + 1, + 2, + 3, + 4 +]') response = sg.client.contactdb.lists.delete(request_body: data) puts response.status_code puts response.body @@ -213,6 +219,10 @@ # Delete Recipient # # DELETE /contactdb/recipients # +data = JSON.parse('[ + "recipient_id1", + "recipient_id2" +]') response = sg.client.contactdb.recipients.delete(request_body: data) puts response.status_code puts response.body diff --git a/examples/suppression/suppression.rb b/examples/suppression/suppression.rb index fef7b079..a42bc17f 100644 --- a/examples/suppression/suppression.rb +++ b/examples/suppression/suppression.rb @@ -18,6 +18,13 @@ # Delete blocks # # DELETE /suppression/blocks # +data = JSON.parse('{ + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] +}') response = sg.client.suppression.blocks.delete(request_body: data) puts response.status_code puts response.body @@ -57,6 +64,13 @@ # Delete bounces # # DELETE /suppression/bounces # +data = JSON.parse('{ + "delete_all": true, + "emails": [ + "example@example.com", + "example2@example.com" + ] +}') response = sg.client.suppression.bounces.delete(request_body: data) puts response.status_code puts response.body @@ -97,6 +111,13 @@ # Delete invalid emails # # DELETE /suppression/invalid_emails # +data = JSON.parse('{ + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] +}') response = sg.client.suppression.invalid_emails.delete(request_body: data) puts response.status_code puts response.body @@ -156,6 +177,13 @@ # Delete spam reports # # DELETE /suppression/spam_reports # +data = JSON.parse('{ + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] +}') response = sg.client.suppression.spam_reports.delete(request_body: data) puts response.status_code puts response.body diff --git a/lib/sendgrid/version.rb b/lib/sendgrid/version.rb index 44833fbd..5fc9df4b 100644 --- a/lib/sendgrid/version.rb +++ b/lib/sendgrid/version.rb @@ -1,3 +1,3 @@ module SendGrid - VERSION = '4.0.1' + VERSION = '4.0.2' end \ No newline at end of file diff --git a/test/sendgrid/test_sendgrid-ruby.rb b/test/sendgrid/test_sendgrid-ruby.rb index 4e6023f4..a5a0660d 100644 --- a/test/sendgrid/test_sendgrid-ruby.rb +++ b/test/sendgrid/test_sendgrid-ruby.rb @@ -30,7 +30,7 @@ def test_init ') assert_equal(test_headers, sg.request_headers) assert_equal("v3", sg.version) - assert_equal("4.0.1", SendGrid::VERSION) + assert_equal("4.0.2", SendGrid::VERSION) assert_instance_of(SendGrid::Client, sg.client) end