sendgrid_webapi 0.0.3 → 0.1.0

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