sendgrid_webapi 0.0.8 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/setup-rubygems.sh +1 -1
  3. data/.rspec +0 -1
  4. data/README.rdoc +27 -2
  5. data/lib/api_key/management.rb +33 -0
  6. data/lib/api_key/modules.rb +10 -0
  7. data/lib/apikey_client.rb +11 -0
  8. data/lib/base.rb +39 -8
  9. data/lib/helper.rb +8 -8
  10. data/lib/sendgrid_webapi.rb +1 -0
  11. data/lib/sub_user/modules.rb +15 -15
  12. data/lib/version.rb +1 -1
  13. data/lib/web_api/modules.rb +15 -11
  14. data/spec/cassettes/client/_modules/_block/should_get_block_emails.yml +1 -1
  15. data/spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml +1 -1
  16. data/spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml +1 -1
  17. data/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml +1 -1
  18. data/spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml +1 -1
  19. data/spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml +1 -1
  20. data/spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml +1 -1
  21. data/spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml +1 -1
  22. data/spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml +1 -1
  23. data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml +1 -1
  24. data/spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml +1 -1
  25. data/spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml +2 -2
  26. data/spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml +1 -1
  27. data/spec/cassettes/client/_modules/_parse_email/should_set_parse_email.yml +1 -1
  28. data/spec/cassettes/client/_modules/_profile/should_get_profile.yml +1 -1
  29. data/spec/cassettes/client/_modules/_profile/should_set_first_name.yml +3 -3
  30. data/spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml +1 -1
  31. data/spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml +1 -1
  32. data/spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml +1 -1
  33. data/spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml +1 -1
  34. data/spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml +1 -1
  35. data/spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml +1 -1
  36. data/spec/cassettes/helper/_create_sub_user_account/should_create_sub_user_account.yml +6 -6
  37. data/spec/cassettes/helper/_run_sendgrid_query/should_raise_with_unsucessfull_request.yml +1 -1
  38. data/spec/cassettes/helper/_run_sendgrid_query/should_run_sendgrid_request.yml +1 -1
  39. data/spec/cassettes/sub_user/_apps/should_activate_app.yml +1 -1
  40. data/spec/cassettes/sub_user/_apps/should_deactivate_app.yml +1 -1
  41. data/spec/cassettes/sub_user/_apps/should_get_current_setting_from_one_app.yml +1 -1
  42. data/spec/cassettes/sub_user/_apps/should_return_available_apps.yml +1 -1
  43. data/spec/cassettes/sub_user/_apps/should_set_current_app.yml +1 -1
  44. data/spec/cassettes/sub_user/_authentication/should_auth_a_sub_user.yml +1 -1
  45. data/spec/cassettes/sub_user/_authentication/should_return_error_with_a_bad_sub_user.yml +1 -1
  46. data/spec/cassettes/sub_user/_bounces/should_returns_bounce_emails.yml +1 -1
  47. data/spec/cassettes/sub_user/_bounces/should_tries_to_delete_unexisting_bounce_emails.yml +1 -1
  48. data/spec/cassettes/sub_user/_event_notification/should_add_event_notification_url.yml +1 -1
  49. data/spec/cassettes/sub_user/_event_notification/should_delete_event_notification_url.yml +1 -1
  50. data/spec/cassettes/sub_user/_event_notification/should_get_event_notification_url.yml +1 -1
  51. data/spec/cassettes/sub_user/_invalid_emails/should_return_invalid_emails.yml +1 -1
  52. data/spec/cassettes/sub_user/_invalid_emails/should_tries_to_delete_unexisting_invalid_mail.yml +1 -1
  53. data/spec/cassettes/sub_user/_ip_management/should_return_all_ips_available.yml +1 -1
  54. data/spec/cassettes/sub_user/_ip_management/should_show_ip_subuser.yml +1 -1
  55. data/spec/cassettes/sub_user/_limits/should_decrements_credits_for_a_sub_user.yml +2 -2
  56. data/spec/cassettes/sub_user/_limits/should_delete_all_limits_for_a_sub_user.yml +2 -2
  57. data/spec/cassettes/sub_user/_limits/should_increments_credits_for_a_sub_user.yml +2 -2
  58. data/spec/cassettes/sub_user/_limits/should_list_the_limits_for_a_sub_user.yml +1 -1
  59. data/spec/cassettes/sub_user/_limits/should_reset_all_limits_for_a_sub_user.yml +2 -2
  60. data/spec/cassettes/sub_user/_limits/should_returns_limits_for_a_sub_user.yml +1 -1
  61. data/spec/cassettes/sub_user/_limits/should_set_total_credits.yml +1 -1
  62. data/spec/cassettes/sub_user/_management/should_add_new_subuser.yml +1 -1
  63. data/spec/cassettes/sub_user/_management/should_disable_sub_user_for_send_email.yml +1 -1
  64. data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_access_to_website.yml +1 -1
  65. data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_send_email.yml +1 -1
  66. data/spec/cassettes/sub_user/_management/should_update_sub_user.yml +1 -1
  67. data/spec/cassettes/sub_user/_monitor_records/should_add_existing_sub_user_to_monitor_record.yml +2 -2
  68. data/spec/cassettes/sub_user/_monitor_records/should_create_a_new_monitor_record.yml +2 -2
  69. data/spec/cassettes/sub_user/_monitor_records/should_delete_a_monitor_record.yml +2 -2
  70. data/spec/cassettes/sub_user/_monitor_records/should_edit_a_monitor_record.yml +2 -2
  71. data/spec/cassettes/sub_user/_monitor_records/should_remove_existing_sub_user_from_monitor_record.yml +2 -2
  72. data/spec/cassettes/sub_user/_parse_email/should_delete_parse_email.yml +2 -2
  73. data/spec/cassettes/sub_user/_parse_email/should_get_parse_email.yml +1 -1
  74. data/spec/cassettes/sub_user/_parse_email/should_set_parse_email.yml +1 -1
  75. data/spec/cassettes/sub_user/_spam/should_return_spam_mails.yml +1 -1
  76. data/spec/cassettes/sub_user/_spam/should_tries_to_delete_unexisting_spam_mail.yml +1 -1
  77. data/spec/cassettes/sub_user/_unsubscribes/should_add_bounce_email.yml +1 -1
  78. data/spec/cassettes/sub_user/_unsubscribes/should_delete_existing_bounce_email.yml +1 -1
  79. data/spec/cassettes/sub_user/_unsubscribes/should_delete_unexisting_bounce_email.yml +1 -1
  80. data/spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml +1 -1
  81. data/spec/client_spec.rb +2 -2
  82. data/spec/helper_spec.rb +4 -4
  83. data/spec/sub_user_spec.rb +1 -1
  84. data/test.rb +1 -1
  85. metadata +84 -11
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.limit.json?api_key=pass&api_user=user&credits=400&task=decrement&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.limit.json?credits=400&task=decrement&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -46,7 +46,7 @@ http_interactions:
46
46
  recorded_at: Fri, 17 Jan 2014 01:24:59 GMT
47
47
  - request:
48
48
  method: get
49
- uri: https://sendgrid.com/apiv2/customer.limit.json?api_key=pass&api_user=user&task=retrieve&user=sendgrid_testuser3
49
+ uri: https://sendgrid.com/apiv2/customer.limit.json?task=retrieve&user=sendgrid_testuser3
50
50
  body:
51
51
  encoding: US-ASCII
52
52
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.limit.json?api_key=pass&api_user=user&task=none&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.limit.json?task=none&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -46,7 +46,7 @@ http_interactions:
46
46
  recorded_at: Fri, 17 Jan 2014 01:25:03 GMT
47
47
  - request:
48
48
  method: get
49
- uri: https://sendgrid.com/apiv2/customer.limit.json?api_key=pass&api_user=user&task=retrieve&user=sendgrid_testuser3
49
+ uri: https://sendgrid.com/apiv2/customer.limit.json?task=retrieve&user=sendgrid_testuser3
50
50
  body:
51
51
  encoding: US-ASCII
52
52
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.limit.json?api_key=pass&api_user=user&credits=400&task=increment&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.limit.json?credits=400&task=increment&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -46,7 +46,7 @@ http_interactions:
46
46
  recorded_at: Fri, 17 Jan 2014 01:24:55 GMT
47
47
  - request:
48
48
  method: get
49
- uri: https://sendgrid.com/apiv2/customer.limit.json?api_key=pass&api_user=user&task=retrieve&user=sendgrid_testuser3
49
+ uri: https://sendgrid.com/apiv2/customer.limit.json?task=retrieve&user=sendgrid_testuser3
50
50
  body:
51
51
  encoding: US-ASCII
52
52
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.limit.json?api_key=pass&api_user=user&task=retrieve&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.limit.json?task=retrieve&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.limit.json?api_key=pass&api_user=user&credits=400&period=daily&task=recurring&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.limit.json?credits=400&period=daily&task=recurring&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -46,7 +46,7 @@ http_interactions:
46
46
  recorded_at: Fri, 17 Jan 2014 01:24:49 GMT
47
47
  - request:
48
48
  method: get
49
- uri: https://sendgrid.com/apiv2/customer.limit.json?api_key=pass&api_user=user&task=retrieve&user=sendgrid_testuser3
49
+ uri: https://sendgrid.com/apiv2/customer.limit.json?task=retrieve&user=sendgrid_testuser3
50
50
  body:
51
51
  encoding: US-ASCII
52
52
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.limit.json?api_key=pass&api_user=user&task=retrieve&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.limit.json?task=retrieve&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.limit.json?api_key=pass&api_user=user&credits=200&period=daily&task=total&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.limit.json?credits=200&period=daily&task=total&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.add.json?address=555%20anystreet&api_key=pass&api_user=user&city=any%20city&confirm_password=somepass&country=US&email=sendgrid_testuser3@example.com&first_name=homero&last_name=simpson&password=somepass&phone=555-555&state=CA&username=sendgrid_testuser3&website=example.com&zip=91234
5
+ uri: https://sendgrid.com/apiv2/customer.add.json?address=555%20anystreet&city=any%20city&confirm_password=somepass&country=US&email=sendgrid_testuser3@example.com&first_name=homero&last_name=simpson&password=somepass&phone=555-555&state=CA&username=sendgrid_testuser3&website=example.com&zip=91234
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.disable.json?api_key=pass&api_user=user&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.disable.json?user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.website_enable.json?api_key=pass&api_user=user&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.website_enable.json?user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.enable.json?api_key=pass&api_user=user&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.enable.json?user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.profile.json?api_key=pass&api_user=user&first_name=change_named&task=set&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.profile.json?first_name=change_named&task=set&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.monitor.json?api_key=pass&api_user=user&name=testmonitor&task=append&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.monitor.json?name=testmonitor&task=append&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -46,7 +46,7 @@ http_interactions:
46
46
  recorded_at: Fri, 17 Jan 2014 01:26:02 GMT
47
47
  - request:
48
48
  method: get
49
- uri: https://sendgrid.com/apiv2/customer.monitor.json?api_key=pass&api_user=user&task=list
49
+ uri: https://sendgrid.com/apiv2/customer.monitor.json?task=list
50
50
  body:
51
51
  encoding: US-ASCII
52
52
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.monitor.json?api_key=pass&api_user=user&email=test@email.com&frequency=10000&name=testmonitor&task=create
5
+ uri: https://sendgrid.com/apiv2/customer.monitor.json?email=test@email.com&frequency=10000&name=testmonitor&task=create
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -46,7 +46,7 @@ http_interactions:
46
46
  recorded_at: Fri, 17 Jan 2014 01:25:53 GMT
47
47
  - request:
48
48
  method: get
49
- uri: https://sendgrid.com/apiv2/customer.monitor.json?api_key=pass&api_user=user&task=list
49
+ uri: https://sendgrid.com/apiv2/customer.monitor.json?task=list
50
50
  body:
51
51
  encoding: US-ASCII
52
52
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.monitor.json?api_key=pass&api_user=user&name=testmonitor&task=delete
5
+ uri: https://sendgrid.com/apiv2/customer.monitor.json?name=testmonitor&task=delete
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -46,7 +46,7 @@ http_interactions:
46
46
  recorded_at: Fri, 17 Jan 2014 01:26:12 GMT
47
47
  - request:
48
48
  method: get
49
- uri: https://sendgrid.com/apiv2/customer.monitor.json?api_key=pass&api_user=user&task=list
49
+ uri: https://sendgrid.com/apiv2/customer.monitor.json?task=list
50
50
  body:
51
51
  encoding: US-ASCII
52
52
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.monitor.json?api_key=pass&api_user=user&name=testmonitor&new_frequency=10&task=edit
5
+ uri: https://sendgrid.com/apiv2/customer.monitor.json?name=testmonitor&new_frequency=10&task=edit
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -46,7 +46,7 @@ http_interactions:
46
46
  recorded_at: Fri, 17 Jan 2014 01:25:57 GMT
47
47
  - request:
48
48
  method: get
49
- uri: https://sendgrid.com/apiv2/customer.monitor.json?api_key=pass&api_user=user&task=list
49
+ uri: https://sendgrid.com/apiv2/customer.monitor.json?task=list
50
50
  body:
51
51
  encoding: US-ASCII
52
52
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.monitor.json?api_key=pass&api_user=user&name=testmonitor&task=detach&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.monitor.json?name=testmonitor&task=detach&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -46,7 +46,7 @@ http_interactions:
46
46
  recorded_at: Fri, 17 Jan 2014 01:26:07 GMT
47
47
  - request:
48
48
  method: get
49
- uri: https://sendgrid.com/apiv2/customer.monitor.json?api_key=pass&api_user=user&task=list
49
+ uri: https://sendgrid.com/apiv2/customer.monitor.json?task=list
50
50
  body:
51
51
  encoding: US-ASCII
52
52
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.parse.json?api_key=pass&api_user=user&hostname=www.example.com&task=delete&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.parse.json?hostname=www.example.com&task=delete&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -46,7 +46,7 @@ http_interactions:
46
46
  recorded_at: Fri, 17 Jan 2014 01:26:57 GMT
47
47
  - request:
48
48
  method: get
49
- uri: https://sendgrid.com/apiv2/customer.parse.json?api_key=pass&api_user=user&task=get&user=sendgrid_testuser3
49
+ uri: https://sendgrid.com/apiv2/customer.parse.json?task=get&user=sendgrid_testuser3
50
50
  body:
51
51
  encoding: US-ASCII
52
52
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.parse.json?api_key=pass&api_user=user&task=get&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.parse.json?task=get&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/apiv2/customer.parse.json?api_key=pass&api_user=user&hostname=www.example.com&spam_check=1&task=set&url=www.mydomain.com/parse.php&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/apiv2/customer.parse.json?hostname=www.example.com&spam_check=1&task=set&url=www.mydomain.com/parse.php&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/api/user.spamreports.json?api_key=pass&api_user=user&task=get&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/api/user.spamreports.json?task=get&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/api/user.spamreports.json?api_key=pass&api_user=user&email=test@email.com&task=delete&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/api/user.spamreports.json?email=test@email.com&task=delete&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/api/user.unsubscribes.json?api_key=pass&api_user=user&email=test@email.com&task=add&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/api/user.unsubscribes.json?email=test@email.com&task=add&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/api/user.unsubscribes.json?api_key=pass&api_user=user&email=test@email.com&task=delete&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/api/user.unsubscribes.json?email=test@email.com&task=delete&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/api/user.unsubscribes.json?api_key=pass&api_user=user&email=test@email.com&task=delete&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/api/user.unsubscribes.json?email=test@email.com&task=delete&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://sendgrid.com/api/user.unsubscribes.json?api_key=pass&api_user=user&task=get&user=sendgrid_testuser3
5
+ uri: https://sendgrid.com/api/user.unsubscribes.json?task=get&user=sendgrid_testuser3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
data/spec/client_spec.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe "client" do
4
- let(:client) { SendGridWebApi::Client.new("user", "pass") }
4
+ let(:client) { SendGridWebApi::Client.new("apikey") }
5
5
 
6
6
 
7
7
  describe "#base", :vcr do
@@ -11,7 +11,7 @@ describe "client" do
11
11
 
12
12
  it "should return request url" do
13
13
  client.make_request_url("blocks.get.json", {:data => 1}).
14
- should eql "blocks.get.json?api_key=pass&api_user=user&data=1"
14
+ should eql "blocks.get.json?data=1"
15
15
  end
16
16
 
17
17
  it "should convert hash to url params" do
data/spec/helper_spec.rb CHANGED
@@ -3,18 +3,18 @@ require 'spec_helper'
3
3
  describe "helper" do
4
4
  include SendGridWebApi::Helper
5
5
 
6
- let(:client) { SendGridWebApi::Client.new("user", "pass") }
6
+ let(:client) { SendGridWebApi::Client.new("apikey") }
7
7
 
8
8
  describe "#run_sendgrid_query" do
9
9
  it "should run sendgrid request", :vcr do
10
- run_sendgrid_query("user", "pass") do
10
+ run_sendgrid_query("apikey") do
11
11
  @client.sub_user.apps.activate(:user => "sendgrid_testuser3", :name => "clicktrack")
12
12
  end
13
13
  end
14
14
 
15
15
  it "should raise with unsucessfull request", :vcr do
16
16
  lambda do
17
- run_sendgrid_query("user", "pass") do
17
+ run_sendgrid_query("apikey") do
18
18
  @client.sub_user.apps.activate(:user => "sendgrid_testuser3", :name => "badappname")
19
19
  end
20
20
  end.should raise_error
@@ -39,7 +39,7 @@ describe "helper" do
39
39
  end
40
40
 
41
41
  it "should create sub_user_account" do
42
- create_sub_user_account("user", "pass", @users)
42
+ create_sub_user_account("apikey", @users)
43
43
  client.sub_user.auth.login(:user => "test-6", :password => "somepass").
44
44
  should == {"message" => "success"}
45
45
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe "sub_user" do
4
- let(:client) { SendGridWebApi::Client.new("user", "pass") }
4
+ let(:client) { SendGridWebApi::Client.new("apikey") }
5
5
 
6
6
  describe "#management", :vcr do
7
7
  it "should add new subuser" do
data/test.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require "sendgrid_webapi"
2
2
 
3
- client = SendGridWebApi::Client.new("app12240625@heroku.com", "dpj7k9hq")
3
+ client = SendGridWebApi::Client.new("dpj7k9hq")
4
4
 
5
5
  puts client.blocks.get.inspect
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid_webapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kylejginavan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-31 00:00:00.000000000 Z
12
+ date: 2021-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -99,22 +99,22 @@ dependencies:
99
99
  name: rspec_junit_formatter
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - "~>"
103
- - !ruby/object:Gem::Version
104
- version: '0.3'
105
102
  - - ">="
106
103
  - !ruby/object:Gem::Version
107
104
  version: 0.3.0
105
+ - - "~>"
106
+ - !ruby/object:Gem::Version
107
+ version: '0.3'
108
108
  type: :development
109
109
  prerelease: false
110
110
  version_requirements: !ruby/object:Gem::Requirement
111
111
  requirements:
112
- - - "~>"
113
- - !ruby/object:Gem::Version
114
- version: '0.3'
115
112
  - - ">="
116
113
  - !ruby/object:Gem::Version
117
114
  version: 0.3.0
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.3'
118
118
  description: Gem for access to SendGrid WEB API from rails
119
119
  email:
120
120
  - kylejginavan@gmail.com
@@ -131,6 +131,9 @@ files:
131
131
  - Gemfile
132
132
  - README.rdoc
133
133
  - Rakefile
134
+ - lib/api_key/management.rb
135
+ - lib/api_key/modules.rb
136
+ - lib/apikey_client.rb
134
137
  - lib/base.rb
135
138
  - lib/helper.rb
136
139
  - lib/middlewares/sendgrid_response.rb
@@ -257,9 +260,79 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
260
  - !ruby/object:Gem::Version
258
261
  version: '0'
259
262
  requirements: []
260
- rubyforge_project: sendgrid_webapi
261
- rubygems_version: 2.7.6
263
+ rubygems_version: 3.0.3
262
264
  signing_key:
263
265
  specification_version: 4
264
266
  summary: SendGrid WEB API gem fo Rails
265
- test_files: []
267
+ test_files:
268
+ - spec/cassettes/client/_modules/_block/should_get_block_emails.yml
269
+ - spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml
270
+ - spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml
271
+ - spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml
272
+ - spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml
273
+ - spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml
274
+ - spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml
275
+ - spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml
276
+ - spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml
277
+ - spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml
278
+ - spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml
279
+ - spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml
280
+ - spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml
281
+ - spec/cassettes/client/_modules/_parse_email/should_set_parse_email.yml
282
+ - spec/cassettes/client/_modules/_profile/should_get_profile.yml
283
+ - spec/cassettes/client/_modules/_profile/should_set_first_name.yml
284
+ - spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml
285
+ - spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml
286
+ - spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml
287
+ - spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml
288
+ - spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml
289
+ - spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml
290
+ - spec/cassettes/helper/_create_sub_user_account/should_create_sub_user_account.yml
291
+ - spec/cassettes/helper/_run_sendgrid_query/should_raise_with_unsucessfull_request.yml
292
+ - spec/cassettes/helper/_run_sendgrid_query/should_run_sendgrid_request.yml
293
+ - spec/cassettes/sub_user/_apps/should_activate_app.yml
294
+ - spec/cassettes/sub_user/_apps/should_deactivate_app.yml
295
+ - spec/cassettes/sub_user/_apps/should_get_current_setting_from_one_app.yml
296
+ - spec/cassettes/sub_user/_apps/should_return_available_apps.yml
297
+ - spec/cassettes/sub_user/_apps/should_set_current_app.yml
298
+ - spec/cassettes/sub_user/_authentication/should_auth_a_sub_user.yml
299
+ - spec/cassettes/sub_user/_authentication/should_return_error_with_a_bad_sub_user.yml
300
+ - spec/cassettes/sub_user/_bounces/should_returns_bounce_emails.yml
301
+ - spec/cassettes/sub_user/_bounces/should_tries_to_delete_unexisting_bounce_emails.yml
302
+ - spec/cassettes/sub_user/_event_notification/should_add_event_notification_url.yml
303
+ - spec/cassettes/sub_user/_event_notification/should_delete_event_notification_url.yml
304
+ - spec/cassettes/sub_user/_event_notification/should_get_event_notification_url.yml
305
+ - spec/cassettes/sub_user/_invalid_emails/should_return_invalid_emails.yml
306
+ - spec/cassettes/sub_user/_invalid_emails/should_tries_to_delete_unexisting_invalid_mail.yml
307
+ - spec/cassettes/sub_user/_ip_management/should_return_all_ips_available.yml
308
+ - spec/cassettes/sub_user/_ip_management/should_show_ip_subuser.yml
309
+ - spec/cassettes/sub_user/_limits/should_decrements_credits_for_a_sub_user.yml
310
+ - spec/cassettes/sub_user/_limits/should_delete_all_limits_for_a_sub_user.yml
311
+ - spec/cassettes/sub_user/_limits/should_increments_credits_for_a_sub_user.yml
312
+ - spec/cassettes/sub_user/_limits/should_list_the_limits_for_a_sub_user.yml
313
+ - spec/cassettes/sub_user/_limits/should_reset_all_limits_for_a_sub_user.yml
314
+ - spec/cassettes/sub_user/_limits/should_returns_limits_for_a_sub_user.yml
315
+ - spec/cassettes/sub_user/_limits/should_set_total_credits.yml
316
+ - spec/cassettes/sub_user/_management/should_add_new_subuser.yml
317
+ - spec/cassettes/sub_user/_management/should_disable_sub_user_for_send_email.yml
318
+ - spec/cassettes/sub_user/_management/should_enable_sub_user_for_access_to_website.yml
319
+ - spec/cassettes/sub_user/_management/should_enable_sub_user_for_send_email.yml
320
+ - spec/cassettes/sub_user/_management/should_update_sub_user.yml
321
+ - spec/cassettes/sub_user/_monitor_records/should_add_existing_sub_user_to_monitor_record.yml
322
+ - spec/cassettes/sub_user/_monitor_records/should_create_a_new_monitor_record.yml
323
+ - spec/cassettes/sub_user/_monitor_records/should_delete_a_monitor_record.yml
324
+ - spec/cassettes/sub_user/_monitor_records/should_edit_a_monitor_record.yml
325
+ - spec/cassettes/sub_user/_monitor_records/should_remove_existing_sub_user_from_monitor_record.yml
326
+ - spec/cassettes/sub_user/_parse_email/should_delete_parse_email.yml
327
+ - spec/cassettes/sub_user/_parse_email/should_get_parse_email.yml
328
+ - spec/cassettes/sub_user/_parse_email/should_set_parse_email.yml
329
+ - spec/cassettes/sub_user/_spam/should_return_spam_mails.yml
330
+ - spec/cassettes/sub_user/_spam/should_tries_to_delete_unexisting_spam_mail.yml
331
+ - spec/cassettes/sub_user/_unsubscribes/should_add_bounce_email.yml
332
+ - spec/cassettes/sub_user/_unsubscribes/should_delete_existing_bounce_email.yml
333
+ - spec/cassettes/sub_user/_unsubscribes/should_delete_unexisting_bounce_email.yml
334
+ - spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml
335
+ - spec/client_spec.rb
336
+ - spec/helper_spec.rb
337
+ - spec/spec_helper.rb
338
+ - spec/sub_user_spec.rb