sendgrid_webapi 0.0.6 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +132 -0
  3. data/.circleci/setup-rubygems.sh +5 -0
  4. data/.gitignore +27 -1
  5. data/.rspec +2 -2
  6. data/.ruby-version +1 -0
  7. data/.tool-versions +1 -0
  8. data/MIT-LICENSE +20 -0
  9. data/README.rdoc +27 -2
  10. data/lib/api_key/management.rb +33 -0
  11. data/lib/api_key/modules.rb +10 -0
  12. data/lib/apikey_client.rb +11 -0
  13. data/lib/base.rb +39 -8
  14. data/lib/helper.rb +8 -8
  15. data/lib/sendgrid_webapi.rb +1 -0
  16. data/lib/sub_user/modules.rb +15 -15
  17. data/lib/version.rb +1 -1
  18. data/lib/web_api/modules.rb +15 -11
  19. data/sendgrid_webapi.gemspec +10 -9
  20. data/spec/cassettes/client/_modules/_block/should_get_block_emails.yml +1 -1
  21. data/spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml +1 -1
  22. data/spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml +1 -1
  23. data/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml +1 -1
  24. data/spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml +1 -1
  25. data/spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml +1 -1
  26. data/spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml +1 -1
  27. data/spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml +1 -1
  28. data/spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml +1 -1
  29. data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml +1 -1
  30. data/spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml +1 -1
  31. data/spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml +2 -2
  32. data/spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml +1 -1
  33. data/spec/cassettes/client/_modules/_parse_email/should_set_parse_email.yml +1 -1
  34. data/spec/cassettes/client/_modules/_profile/should_get_profile.yml +1 -1
  35. data/spec/cassettes/client/_modules/_profile/should_set_first_name.yml +3 -3
  36. data/spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml +1 -1
  37. data/spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml +1 -1
  38. data/spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml +1 -1
  39. data/spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml +1 -1
  40. data/spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml +1 -1
  41. data/spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml +1 -1
  42. data/spec/cassettes/helper/_create_sub_user_account/should_create_sub_user_account.yml +6 -6
  43. data/spec/cassettes/helper/_run_sendgrid_query/should_raise_with_unsucessfull_request.yml +1 -1
  44. data/spec/cassettes/helper/_run_sendgrid_query/should_run_sendgrid_request.yml +1 -1
  45. data/spec/cassettes/sub_user/_apps/should_activate_app.yml +1 -1
  46. data/spec/cassettes/sub_user/_apps/should_deactivate_app.yml +1 -1
  47. data/spec/cassettes/sub_user/_apps/should_get_current_setting_from_one_app.yml +1 -1
  48. data/spec/cassettes/sub_user/_apps/should_return_available_apps.yml +1 -1
  49. data/spec/cassettes/sub_user/_apps/should_set_current_app.yml +1 -1
  50. data/spec/cassettes/sub_user/_authentication/should_auth_a_sub_user.yml +1 -1
  51. data/spec/cassettes/sub_user/_authentication/should_return_error_with_a_bad_sub_user.yml +1 -1
  52. data/spec/cassettes/sub_user/_bounces/should_returns_bounce_emails.yml +1 -1
  53. data/spec/cassettes/sub_user/_bounces/should_tries_to_delete_unexisting_bounce_emails.yml +1 -1
  54. data/spec/cassettes/sub_user/_event_notification/should_add_event_notification_url.yml +1 -1
  55. data/spec/cassettes/sub_user/_event_notification/should_delete_event_notification_url.yml +1 -1
  56. data/spec/cassettes/sub_user/_event_notification/should_get_event_notification_url.yml +1 -1
  57. data/spec/cassettes/sub_user/_invalid_emails/should_return_invalid_emails.yml +1 -1
  58. data/spec/cassettes/sub_user/_invalid_emails/should_tries_to_delete_unexisting_invalid_mail.yml +1 -1
  59. data/spec/cassettes/sub_user/_ip_management/should_return_all_ips_available.yml +1 -1
  60. data/spec/cassettes/sub_user/_ip_management/should_show_ip_subuser.yml +1 -1
  61. data/spec/cassettes/sub_user/_limits/should_decrements_credits_for_a_sub_user.yml +2 -2
  62. data/spec/cassettes/sub_user/_limits/should_delete_all_limits_for_a_sub_user.yml +2 -2
  63. data/spec/cassettes/sub_user/_limits/should_increments_credits_for_a_sub_user.yml +2 -2
  64. data/spec/cassettes/sub_user/_limits/should_list_the_limits_for_a_sub_user.yml +1 -1
  65. data/spec/cassettes/sub_user/_limits/should_reset_all_limits_for_a_sub_user.yml +2 -2
  66. data/spec/cassettes/sub_user/_limits/should_returns_limits_for_a_sub_user.yml +1 -1
  67. data/spec/cassettes/sub_user/_limits/should_set_total_credits.yml +1 -1
  68. data/spec/cassettes/sub_user/_management/should_add_new_subuser.yml +1 -1
  69. data/spec/cassettes/sub_user/_management/should_disable_sub_user_for_send_email.yml +1 -1
  70. data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_access_to_website.yml +1 -1
  71. data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_send_email.yml +1 -1
  72. data/spec/cassettes/sub_user/_management/should_update_sub_user.yml +1 -1
  73. data/spec/cassettes/sub_user/_monitor_records/should_add_existing_sub_user_to_monitor_record.yml +2 -2
  74. data/spec/cassettes/sub_user/_monitor_records/should_create_a_new_monitor_record.yml +2 -2
  75. data/spec/cassettes/sub_user/_monitor_records/should_delete_a_monitor_record.yml +2 -2
  76. data/spec/cassettes/sub_user/_monitor_records/should_edit_a_monitor_record.yml +2 -2
  77. data/spec/cassettes/sub_user/_monitor_records/should_remove_existing_sub_user_from_monitor_record.yml +2 -2
  78. data/spec/cassettes/sub_user/_parse_email/should_delete_parse_email.yml +2 -2
  79. data/spec/cassettes/sub_user/_parse_email/should_get_parse_email.yml +1 -1
  80. data/spec/cassettes/sub_user/_parse_email/should_set_parse_email.yml +1 -1
  81. data/spec/cassettes/sub_user/_spam/should_return_spam_mails.yml +1 -1
  82. data/spec/cassettes/sub_user/_spam/should_tries_to_delete_unexisting_spam_mail.yml +1 -1
  83. data/spec/cassettes/sub_user/_unsubscribes/should_add_bounce_email.yml +1 -1
  84. data/spec/cassettes/sub_user/_unsubscribes/should_delete_existing_bounce_email.yml +1 -1
  85. data/spec/cassettes/sub_user/_unsubscribes/should_delete_unexisting_bounce_email.yml +1 -1
  86. data/spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml +1 -1
  87. data/spec/client_spec.rb +2 -2
  88. data/spec/helper_spec.rb +4 -4
  89. data/spec/sub_user_spec.rb +1 -1
  90. data/test.rb +1 -1
  91. metadata +76 -49
  92. data/.travis.yml +0 -2
@@ -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,100 +1,120 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid_webapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kylejginavan
8
8
  - chebyte
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-21 00:00:00.000000000 Z
12
+ date: 2021-07-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rspec
15
+ name: faraday
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 2.10.0
21
- type: :development
20
+ version: '1.0'
21
+ type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 2.10.0
27
+ version: '1.0'
28
28
  - !ruby/object:Gem::Dependency
29
- name: webmock
29
+ name: faraday_middleware
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ~>
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 1.8.7
35
- type: :development
34
+ version: '1.0'
35
+ type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ~>
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 1.8.7
41
+ version: '1.0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: vcr
43
+ name: json
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ~>
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '2.0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
47
54
  - !ruby/object:Gem::Version
48
- version: 2.8.0
55
+ version: '2.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '3.4'
49
63
  type: :development
50
64
  prerelease: false
51
65
  version_requirements: !ruby/object:Gem::Requirement
52
66
  requirements:
53
- - - ~>
67
+ - - "~>"
54
68
  - !ruby/object:Gem::Version
55
- version: 2.8.0
69
+ version: '3.4'
56
70
  - !ruby/object:Gem::Dependency
57
- name: faraday
71
+ name: webmock
58
72
  requirement: !ruby/object:Gem::Requirement
59
73
  requirements:
60
- - - ~>
74
+ - - "~>"
61
75
  - !ruby/object:Gem::Version
62
- version: 0.9.0
63
- type: :runtime
76
+ version: '3.12'
77
+ type: :development
64
78
  prerelease: false
65
79
  version_requirements: !ruby/object:Gem::Requirement
66
80
  requirements:
67
- - - ~>
81
+ - - "~>"
68
82
  - !ruby/object:Gem::Version
69
- version: 0.9.0
83
+ version: '3.12'
70
84
  - !ruby/object:Gem::Dependency
71
- name: faraday_middleware
85
+ name: vcr
72
86
  requirement: !ruby/object:Gem::Requirement
73
87
  requirements:
74
- - - ~>
88
+ - - "~>"
75
89
  - !ruby/object:Gem::Version
76
- version: 0.9.0
77
- type: :runtime
90
+ version: '6.0'
91
+ type: :development
78
92
  prerelease: false
79
93
  version_requirements: !ruby/object:Gem::Requirement
80
94
  requirements:
81
- - - ~>
95
+ - - "~>"
82
96
  - !ruby/object:Gem::Version
83
- version: 0.9.0
97
+ version: '6.0'
84
98
  - !ruby/object:Gem::Dependency
85
- name: json
99
+ name: rspec_junit_formatter
86
100
  requirement: !ruby/object:Gem::Requirement
87
101
  requirements:
88
- - - ~>
102
+ - - "~>"
89
103
  - !ruby/object:Gem::Version
90
- version: 1.8.0
91
- type: :runtime
104
+ version: '0.3'
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: 0.3.0
108
+ type: :development
92
109
  prerelease: false
93
110
  version_requirements: !ruby/object:Gem::Requirement
94
111
  requirements:
95
- - - ~>
112
+ - - "~>"
113
+ - !ruby/object:Gem::Version
114
+ version: '0.3'
115
+ - - ">="
96
116
  - !ruby/object:Gem::Version
97
- version: 1.8.0
117
+ version: 0.3.0
98
118
  description: Gem for access to SendGrid WEB API from rails
99
119
  email:
100
120
  - kylejginavan@gmail.com
@@ -103,12 +123,19 @@ executables: []
103
123
  extensions: []
104
124
  extra_rdoc_files: []
105
125
  files:
106
- - .gitignore
107
- - .rspec
108
- - .travis.yml
126
+ - ".circleci/config.yml"
127
+ - ".circleci/setup-rubygems.sh"
128
+ - ".gitignore"
129
+ - ".rspec"
130
+ - ".ruby-version"
131
+ - ".tool-versions"
109
132
  - Gemfile
133
+ - MIT-LICENSE
110
134
  - README.rdoc
111
135
  - Rakefile
136
+ - lib/api_key/management.rb
137
+ - lib/api_key/modules.rb
138
+ - lib/apikey_client.rb
112
139
  - lib/base.rb
113
140
  - lib/helper.rb
114
141
  - lib/middlewares/sendgrid_response.rb
@@ -217,27 +244,27 @@ files:
217
244
  - spec/spec_helper.rb
218
245
  - spec/sub_user_spec.rb
219
246
  - test.rb
220
- homepage: https://github.com/kylejginavan/sendgrid_smtpapi
221
- licenses: []
247
+ homepage: https://github.com/kylejginavan/sendgrid_webapi
248
+ licenses:
249
+ - MIT
222
250
  metadata: {}
223
- post_install_message:
251
+ post_install_message:
224
252
  rdoc_options: []
225
253
  require_paths:
226
254
  - lib
227
255
  required_ruby_version: !ruby/object:Gem::Requirement
228
256
  requirements:
229
- - - '>='
257
+ - - ">="
230
258
  - !ruby/object:Gem::Version
231
259
  version: '0'
232
260
  required_rubygems_version: !ruby/object:Gem::Requirement
233
261
  requirements:
234
- - - '>='
262
+ - - ">="
235
263
  - !ruby/object:Gem::Version
236
264
  version: '0'
237
265
  requirements: []
238
- rubyforge_project: sendgrid_webapi
239
- rubygems_version: 2.0.14
240
- signing_key:
266
+ rubygems_version: 3.2.3
267
+ signing_key:
241
268
  specification_version: 4
242
269
  summary: SendGrid WEB API gem fo Rails
243
270
  test_files:
data/.travis.yml DELETED
@@ -1,2 +0,0 @@
1
- rvm: "2.2.2"
2
- script: rake spec