sendgrid_webapi 0.1.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/.rspec +0 -0
  4. data/.ruby-version +0 -0
  5. data/.tekton/Chart.lock +6 -0
  6. data/.tekton/Chart.yaml +14 -0
  7. data/.tekton/templates/pipelinerun.yaml +53 -0
  8. data/.tekton/values-main.yaml +14 -0
  9. data/.tekton/values-pr.yaml +8 -0
  10. data/.tekton/values.yaml +19 -0
  11. data/.tool-versions +0 -0
  12. data/Gemfile +0 -0
  13. data/MIT-LICENSE +0 -0
  14. data/README.rdoc +69 -20
  15. data/Rakefile +0 -0
  16. data/lib/api_key/management.rb +0 -0
  17. data/lib/api_key/modules.rb +0 -0
  18. data/lib/apikey_client.rb +0 -0
  19. data/lib/base.rb +7 -0
  20. data/lib/helper.rb +0 -0
  21. data/lib/middlewares/sendgrid_response.rb +0 -0
  22. data/lib/sendgrid_webapi.rb +0 -0
  23. data/lib/sub_user/apps.rb +0 -0
  24. data/lib/sub_user/auth.rb +0 -0
  25. data/lib/sub_user/bounces.rb +0 -0
  26. data/lib/sub_user/event_notification.rb +0 -0
  27. data/lib/sub_user/iframe.rb +0 -0
  28. data/lib/sub_user/invalid_emails.rb +0 -0
  29. data/lib/sub_user/ip_management.rb +0 -0
  30. data/lib/sub_user/limits.rb +0 -0
  31. data/lib/sub_user/management.rb +0 -0
  32. data/lib/sub_user/modules.rb +0 -0
  33. data/lib/sub_user/monitor_records.rb +0 -0
  34. data/lib/sub_user/parse.rb +0 -0
  35. data/lib/sub_user/spam.rb +0 -0
  36. data/lib/sub_user/stats.rb +0 -0
  37. data/lib/sub_user/unsubscribes.rb +0 -0
  38. data/lib/sub_user/white_label.rb +0 -0
  39. data/lib/subuser_client.rb +0 -0
  40. data/lib/version.rb +1 -1
  41. data/lib/web_api/address_whitelist.rb +24 -0
  42. data/lib/web_api/blocks.rb +20 -7
  43. data/lib/web_api/bounces.rb +19 -6
  44. data/lib/web_api/event_notification.rb +0 -0
  45. data/lib/web_api/invalid_emails.rb +15 -5
  46. data/lib/web_api/mail.rb +0 -0
  47. data/lib/web_api/modules.rb +5 -1
  48. data/lib/web_api/parse.rb +0 -0
  49. data/lib/web_api/profile.rb +0 -0
  50. data/lib/web_api/spam.rb +14 -4
  51. data/lib/web_api/stats.rb +0 -0
  52. data/lib/web_api/unsubscribes.rb +19 -6
  53. data/lib/web_api/version.rb +0 -0
  54. data/lib/webapi_client.rb +0 -0
  55. data/sendgrid_webapi.gemspec +0 -0
  56. data/spec/cassettes/client/_modules/_address_whitelist/should_add_email_to_whitelist.yml +36 -0
  57. data/spec/cassettes/client/_modules/_address_whitelist/should_delete_email_from_whitelist.yml +36 -0
  58. data/spec/cassettes/client/_modules/_address_whitelist/should_get_address_whitelist.yml +36 -0
  59. data/spec/cassettes/client/_modules/_block/should_get_block_emails.yml +33 -33
  60. data/spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml +33 -33
  61. data/spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml +33 -33
  62. data/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml +33 -33
  63. data/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails_using_params.yml +36 -0
  64. data/spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml +0 -0
  65. data/spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml +33 -33
  66. data/spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml +0 -0
  67. data/spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml +0 -0
  68. data/spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml +0 -0
  69. data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml +33 -33
  70. data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_emails_using_params.yml +37 -0
  71. data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_using_params.yml +36 -0
  72. data/spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml +33 -33
  73. data/spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml +0 -0
  74. data/spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml +0 -0
  75. data/spec/cassettes/client/_modules/_parse_email/should_set_parse_email.yml +0 -0
  76. data/spec/cassettes/client/_modules/_profile/should_get_profile.yml +0 -0
  77. data/spec/cassettes/client/_modules/_profile/should_set_first_name.yml +0 -0
  78. data/spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml +33 -33
  79. data/spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml +33 -33
  80. data/spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml +33 -33
  81. data/spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml +33 -33
  82. data/spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml +33 -33
  83. data/spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml +33 -33
  84. data/spec/cassettes/helper/_create_sub_user_account/should_create_sub_user_account.yml +0 -0
  85. data/spec/cassettes/helper/_run_sendgrid_query/should_raise_with_unsucessfull_request.yml +0 -0
  86. data/spec/cassettes/helper/_run_sendgrid_query/should_run_sendgrid_request.yml +0 -0
  87. data/spec/cassettes/sub_user/_apps/should_activate_app.yml +0 -0
  88. data/spec/cassettes/sub_user/_apps/should_deactivate_app.yml +0 -0
  89. data/spec/cassettes/sub_user/_apps/should_get_current_setting_from_one_app.yml +0 -0
  90. data/spec/cassettes/sub_user/_apps/should_return_available_apps.yml +0 -0
  91. data/spec/cassettes/sub_user/_apps/should_set_current_app.yml +0 -0
  92. data/spec/cassettes/sub_user/_authentication/should_auth_a_sub_user.yml +0 -0
  93. data/spec/cassettes/sub_user/_authentication/should_return_error_with_a_bad_sub_user.yml +0 -0
  94. data/spec/cassettes/sub_user/_bounces/should_returns_bounce_emails.yml +0 -0
  95. data/spec/cassettes/sub_user/_bounces/should_tries_to_delete_unexisting_bounce_emails.yml +0 -0
  96. data/spec/cassettes/sub_user/_event_notification/should_add_event_notification_url.yml +0 -0
  97. data/spec/cassettes/sub_user/_event_notification/should_delete_event_notification_url.yml +0 -0
  98. data/spec/cassettes/sub_user/_event_notification/should_get_event_notification_url.yml +0 -0
  99. data/spec/cassettes/sub_user/_invalid_emails/should_return_invalid_emails.yml +0 -0
  100. data/spec/cassettes/sub_user/_invalid_emails/should_tries_to_delete_unexisting_invalid_mail.yml +0 -0
  101. data/spec/cassettes/sub_user/_ip_management/should_return_all_ips_available.yml +0 -0
  102. data/spec/cassettes/sub_user/_ip_management/should_show_ip_subuser.yml +0 -0
  103. data/spec/cassettes/sub_user/_limits/should_decrements_credits_for_a_sub_user.yml +0 -0
  104. data/spec/cassettes/sub_user/_limits/should_delete_all_limits_for_a_sub_user.yml +0 -0
  105. data/spec/cassettes/sub_user/_limits/should_increments_credits_for_a_sub_user.yml +0 -0
  106. data/spec/cassettes/sub_user/_limits/should_list_the_limits_for_a_sub_user.yml +0 -0
  107. data/spec/cassettes/sub_user/_limits/should_reset_all_limits_for_a_sub_user.yml +0 -0
  108. data/spec/cassettes/sub_user/_limits/should_returns_limits_for_a_sub_user.yml +0 -0
  109. data/spec/cassettes/sub_user/_limits/should_set_total_credits.yml +0 -0
  110. data/spec/cassettes/sub_user/_management/should_add_new_subuser.yml +0 -0
  111. data/spec/cassettes/sub_user/_management/should_disable_sub_user_for_send_email.yml +0 -0
  112. data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_access_to_website.yml +0 -0
  113. data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_send_email.yml +0 -0
  114. data/spec/cassettes/sub_user/_management/should_update_sub_user.yml +0 -0
  115. data/spec/cassettes/sub_user/_monitor_records/should_add_existing_sub_user_to_monitor_record.yml +0 -0
  116. data/spec/cassettes/sub_user/_monitor_records/should_create_a_new_monitor_record.yml +0 -0
  117. data/spec/cassettes/sub_user/_monitor_records/should_delete_a_monitor_record.yml +0 -0
  118. data/spec/cassettes/sub_user/_monitor_records/should_edit_a_monitor_record.yml +0 -0
  119. data/spec/cassettes/sub_user/_monitor_records/should_remove_existing_sub_user_from_monitor_record.yml +0 -0
  120. data/spec/cassettes/sub_user/_parse_email/should_delete_parse_email.yml +0 -0
  121. data/spec/cassettes/sub_user/_parse_email/should_get_parse_email.yml +0 -0
  122. data/spec/cassettes/sub_user/_parse_email/should_set_parse_email.yml +0 -0
  123. data/spec/cassettes/sub_user/_spam/should_return_spam_mails.yml +0 -0
  124. data/spec/cassettes/sub_user/_spam/should_tries_to_delete_unexisting_spam_mail.yml +0 -0
  125. data/spec/cassettes/sub_user/_unsubscribes/should_add_bounce_email.yml +0 -0
  126. data/spec/cassettes/sub_user/_unsubscribes/should_delete_existing_bounce_email.yml +0 -0
  127. data/spec/cassettes/sub_user/_unsubscribes/should_delete_unexisting_bounce_email.yml +0 -0
  128. data/spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml +0 -0
  129. data/spec/client_spec.rb +85 -52
  130. data/spec/helper_spec.rb +2 -3
  131. data/spec/internal/config/database-standard.yml +24 -0
  132. data/spec/spec_helper.rb +0 -4
  133. data/spec/sub_user_spec.rb +0 -0
  134. data/test.rb +0 -0
  135. metadata +21 -80
  136. data/.circleci/config.yml +0 -132
  137. data/.circleci/setup-rubygems.sh +0 -5
data/spec/client_spec.rb CHANGED
@@ -6,128 +6,161 @@ describe "client" do
6
6
 
7
7
  describe "#base", :vcr do
8
8
  it "should return api url" do
9
- client.base_url.should eql "https://api.sendgrid.com/api/"
9
+ expect(client.base_url).to eql "https://api.sendgrid.com/api/"
10
10
  end
11
-
11
+
12
12
  it "should return request url" do
13
- client.make_request_url("blocks.get.json", {:data => 1}).
14
- should eql "blocks.get.json?data=1"
13
+ expect(client.make_request_url("blocks.get.json", {:data => 1})).
14
+ to eql "blocks.get.json?data=1"
15
15
  end
16
-
16
+
17
17
  it "should convert hash to url params" do
18
- client.to_query({:value_one => "foo_one", :value_two => "foo_two"}).
19
- should eql "value_one=foo_one&value_two=foo_two"
18
+ expect(client.to_query({:value_one => "foo_one", :value_two => "foo_two"})).
19
+ to eql "value_one=foo_one&value_two=foo_two"
20
20
  end
21
21
  end
22
22
 
23
23
  describe "#modules", :vcr do
24
+ describe "#address_whitelist", :vcr do
25
+ it "should get address whitelist" do
26
+ response = client.address_whitelist.get
27
+ expect(response["list"]).to eql ["test@example.com", "test2@example.com"]
28
+ end
29
+
30
+ it "should add email to whitelist" do
31
+ response = client.address_whitelist.add({ list: ["new@example.com"] })
32
+ expect(response["list"]).to include("new@example.com")
33
+ end
34
+
35
+ it "should delete email from whitelist" do
36
+ response = client.address_whitelist.delete({ email: "test2@example.com" })
37
+ expect(response["list"]).not_to include("test2@example.com")
38
+ end
39
+ end
40
+
24
41
  describe "#block" do
25
42
  it "should get block emails" do
26
- client.blocks.get.should eql []
43
+ expect(client.blocks.get).to eql []
27
44
  end
45
+
28
46
  it "should try delete not existing block email" do
29
- client.blocks.delete(:email => "test@example.com").should == {"message"=>"Email does not exist"}
47
+ expect(client.blocks.delete({email: "test@example.com"})).to eql ({"message"=>"Email does not exist"})
30
48
  end
49
+
31
50
  it "should get totals blocks" do
32
- client.blocks.count.should eql({"count"=>0})
51
+ expect(client.blocks.count).to eql({:count=>0})
33
52
  end
34
53
  end
35
54
 
36
55
  describe "#bounce", :vcr do
37
56
  it "should get bounce emails" do
38
- client.bounces.get.should eql []
57
+ expect(client.bounces.get).to eql []
39
58
  end
59
+
60
+ it "should get bounce emails using params" do
61
+ expect(client.bounces.get({limit: 2, offset: 1}).count).to eql 2
62
+ end
63
+
40
64
  it "should try delete not existing bounce email" do
41
- client.bounces.delete(:email => "test@example.com").should == {"message"=>"Email does not exist"}
65
+ expect(client.bounces.delete({email: "test@example.com"})).to eql ({"message"=>"Email does not exist"})
42
66
  end
43
67
  end
44
68
 
45
69
  describe "#invalid_email", :vcr do
46
70
  it "should get invalid emails" do
47
- client.invalid_emails.get.should eql []
71
+ expect(client.invalid_emails.get).to eql []
48
72
  end
73
+
74
+ it "should get invalid emails using params" do
75
+ expect(client.invalid_emails.get({limit: 3, offset: 2}).count).to eql 3
76
+ end
77
+
49
78
  it "should try delete not existing invalid emails" do
50
- client.invalid_emails.delete(:email => "test@example.com").should == {"message"=>"Email does not exist"}
79
+ expect(client.invalid_emails.delete(:email => "test@example.com")).to eql ({"message"=>"Email does not exist"})
51
80
  end
52
81
  end
53
82
 
54
83
  describe "#spam" do
55
84
  it "should get spam emails", :vcr do
56
- client.spam.get.should eql []
85
+ expect(client.spam.get).to eql []
57
86
  end
87
+
58
88
  it "should try delete not existing spam emails" do
59
- client.spam.delete(:email => "test@example.com").should == {"message"=>"Email does not exist"}
89
+ expect(client.spam.delete({:email => "test@example.com"})).to eql ({"message"=>"Email does not exist"})
60
90
  end
61
91
  end
62
92
 
63
93
  describe "#unsubscribe", :vcr do
64
94
  it "should add unsubscribe emails" do
65
- client.unsubscribes.add(:email => "test@example.com").
66
- should == {"message"=>"success"}
95
+ expect(client.unsubscribes.add({recipient_emails: ["test@example.com"]})).
96
+ to eql ({"message"=>"success"})
67
97
  end
98
+
68
99
  it "should get unsubscribe emails" do
69
- client.unsubscribes.get.
70
- should eql [{"email"=>"test@example.com"}]
100
+ expect(client.unsubscribes.get).
101
+ to eql [{"email"=>"test@example.com"}]
71
102
  end
103
+
72
104
  it "should delete unsubscribe email" do
73
- client.unsubscribes.delete(:email => "test@example.com").
74
- should == {"message"=>"success"}
105
+ expect(client.unsubscribes.delete(:email => "test@example.com")).
106
+ to eql ({"message"=>"success"})
75
107
  end
108
+
76
109
  it "should try delete not existing unsubscribe emails" do
77
- client.unsubscribes.delete(:email => "test@example.com").
78
- should == {"message"=>"Email does not exist"}
110
+ expect(client.unsubscribes.delete({email: "test@example.com"})).
111
+ to eql ({"errors" => [{"field"=>"null", "message"=>"resource not found"}]})
79
112
  end
80
113
  end
81
-
114
+
82
115
  describe "#parse_email", :vcr do
83
116
  it "should set parse email" do
84
- client.parse_email.set(:hostname => "www.example.com", :url => "www.mydomain.com/parse.php", :spam_check => "1").
85
- should == {"message"=>"success"}
117
+ expect(client.parse_email.set(:hostname => "www.example.com", :url => "www.mydomain.com/parse.php", :spam_check => "1")).
118
+ to eql ({"message"=>"success"})
86
119
  end
87
-
120
+
88
121
  it "should get parse email", :vcr do
89
- client.parse_email.get.
90
- should == {"parse"=>[{"hostname"=>"www.example.com", "url"=>"www.mydomain.com/parse.php", "spam_check"=>1}]}
122
+ expect(client.parse_email.get).
123
+ to eql ({"parse"=>[{"hostname"=>"www.example.com", "url"=>"www.mydomain.com/parse.php", "spam_check"=>1}]})
91
124
  end
92
-
125
+
93
126
  it "should delete parse email", :vcr do
94
- client.parse_email.delete(:hostname => "www.example.com").
95
- should == {"message"=>"success"}
96
- client.parse_email.get.
97
- should == {"parse" => []}
127
+ expect(client.parse_email.delete(:hostname => "www.example.com")).
128
+ to eql ({"message"=>"success"})
129
+ expect(client.parse_email.get).
130
+ to eql ({"parse" => []})
98
131
  end
99
132
  end
100
133
 
101
134
  describe "#event_notification", :vcr do
102
135
  it "should set event notification url" do
103
- client.event_notification.set(:url => "http://www.yourposturlhere.com").
104
- should == {"message"=>"success"}
136
+ expect(client.event_notification.set(:url => "http://www.yourposturlhere.com")).
137
+ to eql ({"message"=>"success"})
105
138
  end
106
-
139
+
107
140
  it "should get event notification url" do
108
- client.event_notification.get.
109
- should == [{"url" => "http:\/\/www.yourposturlhere.com"}]
141
+ expect(client.event_notification.get).
142
+ to eql ([{"url" => "http:\/\/www.yourposturlhere.com"}])
110
143
  end
111
-
144
+
112
145
  it "should delete event notification url" do
113
- client.event_notification.delete.
114
- should == {"message"=>"success"}
146
+ expect(client.event_notification.delete).
147
+ to eql ({"message"=>"success"})
115
148
  end
116
149
  end
117
150
 
118
151
  describe "#profile", :vcr do
119
152
  it "should get profile" do
120
- client.profile.get.
121
- should == [{"username"=>"user", "email"=>"user", "active"=>"true", "first_name"=>"Reseller", "last_name"=>"Customer", "address"=>"555 Any Street", "address2"=>"", "city"=>"City", "state"=>"State", "zip"=>"90000", "country"=>"US", "phone"=>"555-555-5555", "website"=>"http://Website", "website_access"=>"true"}]
153
+ expect(client.profile.get).
154
+ to eql ([{"username"=>"user", "email"=>"user", "active"=>"true", "first_name"=>"Reseller", "last_name"=>"Customer", "address"=>"555 Any Street", "address2"=>"", "city"=>"City", "state"=>"State", "zip"=>"90000", "country"=>"US", "phone"=>"555-555-5555", "website"=>"http://Website", "website_access"=>"true"}])
122
155
  end
123
-
156
+
124
157
  it "should set first name" do
125
- client.profile.set(:first_name => "test").
126
- should == {"message" => "success"}
127
- client.profile.get.first["first_name"].
128
- should == "test"
129
- client.profile.set(:first_name => "Reseller").
130
- should == {"message" => "success"}
158
+ expect(client.profile.set(:first_name => "test")).
159
+ to eql ({"message" => "success"})
160
+ expect(client.profile.get.first["first_name"]).
161
+ to eql "test"
162
+ expect(client.profile.set(:first_name => "Reseller")).
163
+ to eql ({"message" => "success"})
131
164
  end
132
165
  end
133
166
  end
data/spec/helper_spec.rb CHANGED
@@ -30,11 +30,10 @@ describe "helper" do
30
30
  apps = { :opentrack => {:name => "eventnotify", :processed => "0", :dropped => "1", :deferred => "1",
31
31
  :delivered => "0", :bounce => "1", :click => "1", :open => "1", :unsubscribe => "1", :spamreport => "1",
32
32
  :url => "https://example.com"},
33
- :clicktrack => {:enable_text => "1"},
34
- :opentrack => {}
33
+ :clicktrack => {}
35
34
  }
36
35
 
37
- @users = {"test-6" => {:account => user_hash, :applications => apps, :assigned_ips => ["192.254.126.178"]}}
36
+ @users = {"test-6" => {:account => user_hash, :applications => apps, :assigned_ips => []}}
38
37
 
39
38
  end
40
39
 
@@ -0,0 +1,24 @@
1
+ common: &common
2
+ adapter: postgresql
3
+ encoding: utf8
4
+ host: <%= ENV["DBHOST"] || "127.0.0.1" %>
5
+ port: <%= ENV["DBPORT"] || "5432" %>
6
+ database: <%= ENV["DBNAME"] || "has_helpers_test" %>
7
+ username: <%= ENV["DBUSER"] || "postgres" %>
8
+ password: <%= ENV["DBPASSWORD"] || "" %>
9
+ pool: 5
10
+ reconnect: true
11
+ timeout: 5000
12
+
13
+ development:
14
+ <<: *common
15
+
16
+ test:
17
+ <<: *common
18
+
19
+ staging:
20
+ <<: *common
21
+
22
+ production:
23
+ <<: *common
24
+ pool: 10
data/spec/spec_helper.rb CHANGED
@@ -7,7 +7,3 @@ VCR.configure do |c|
7
7
  c.hook_into :webmock
8
8
  c.configure_rspec_metadata!
9
9
  end
10
-
11
- RSpec.configure do |c|
12
- c.treat_symbols_as_metadata_keys_with_true_values = true
13
- end
File without changes
data/test.rb CHANGED
File without changes
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid_webapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.1
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: 2021-07-22 00:00:00.000000000 Z
12
+ date: 2025-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -123,11 +123,15 @@ executables: []
123
123
  extensions: []
124
124
  extra_rdoc_files: []
125
125
  files:
126
- - ".circleci/config.yml"
127
- - ".circleci/setup-rubygems.sh"
128
126
  - ".gitignore"
129
127
  - ".rspec"
130
128
  - ".ruby-version"
129
+ - ".tekton/Chart.lock"
130
+ - ".tekton/Chart.yaml"
131
+ - ".tekton/templates/pipelinerun.yaml"
132
+ - ".tekton/values-main.yaml"
133
+ - ".tekton/values-pr.yaml"
134
+ - ".tekton/values.yaml"
131
135
  - ".tool-versions"
132
136
  - Gemfile
133
137
  - MIT-LICENSE
@@ -158,6 +162,7 @@ files:
158
162
  - lib/sub_user/white_label.rb
159
163
  - lib/subuser_client.rb
160
164
  - lib/version.rb
165
+ - lib/web_api/address_whitelist.rb
161
166
  - lib/web_api/blocks.rb
162
167
  - lib/web_api/bounces.rb
163
168
  - lib/web_api/event_notification.rb
@@ -172,16 +177,22 @@ files:
172
177
  - lib/web_api/version.rb
173
178
  - lib/webapi_client.rb
174
179
  - sendgrid_webapi.gemspec
180
+ - spec/cassettes/client/_modules/_address_whitelist/should_add_email_to_whitelist.yml
181
+ - spec/cassettes/client/_modules/_address_whitelist/should_delete_email_from_whitelist.yml
182
+ - spec/cassettes/client/_modules/_address_whitelist/should_get_address_whitelist.yml
175
183
  - spec/cassettes/client/_modules/_block/should_get_block_emails.yml
176
184
  - spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml
177
185
  - spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml
178
186
  - spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml
187
+ - spec/cassettes/client/_modules/_bounce/should_get_bounce_emails_using_params.yml
179
188
  - spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml
180
189
  - spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml
181
190
  - spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml
182
191
  - spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml
183
192
  - spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml
184
193
  - spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml
194
+ - spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_emails_using_params.yml
195
+ - spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_using_params.yml
185
196
  - spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml
186
197
  - spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml
187
198
  - spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml
@@ -241,6 +252,7 @@ files:
241
252
  - spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml
242
253
  - spec/client_spec.rb
243
254
  - spec/helper_spec.rb
255
+ - spec/internal/config/database-standard.yml
244
256
  - spec/spec_helper.rb
245
257
  - spec/sub_user_spec.rb
246
258
  - test.rb
@@ -248,7 +260,7 @@ homepage: https://github.com/kylejginavan/sendgrid_webapi
248
260
  licenses:
249
261
  - MIT
250
262
  metadata: {}
251
- post_install_message:
263
+ post_install_message:
252
264
  rdoc_options: []
253
265
  require_paths:
254
266
  - lib
@@ -263,79 +275,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
275
  - !ruby/object:Gem::Version
264
276
  version: '0'
265
277
  requirements: []
266
- rubygems_version: 3.2.3
267
- signing_key:
278
+ rubygems_version: 3.2.22
279
+ signing_key:
268
280
  specification_version: 4
269
281
  summary: SendGrid WEB API gem fo Rails
270
- test_files:
271
- - spec/cassettes/client/_modules/_block/should_get_block_emails.yml
272
- - spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml
273
- - spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml
274
- - spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml
275
- - spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml
276
- - spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml
277
- - spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml
278
- - spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml
279
- - spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml
280
- - spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml
281
- - spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml
282
- - spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml
283
- - spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml
284
- - spec/cassettes/client/_modules/_parse_email/should_set_parse_email.yml
285
- - spec/cassettes/client/_modules/_profile/should_get_profile.yml
286
- - spec/cassettes/client/_modules/_profile/should_set_first_name.yml
287
- - spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml
288
- - spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml
289
- - spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml
290
- - spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml
291
- - spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml
292
- - spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml
293
- - spec/cassettes/helper/_create_sub_user_account/should_create_sub_user_account.yml
294
- - spec/cassettes/helper/_run_sendgrid_query/should_raise_with_unsucessfull_request.yml
295
- - spec/cassettes/helper/_run_sendgrid_query/should_run_sendgrid_request.yml
296
- - spec/cassettes/sub_user/_apps/should_activate_app.yml
297
- - spec/cassettes/sub_user/_apps/should_deactivate_app.yml
298
- - spec/cassettes/sub_user/_apps/should_get_current_setting_from_one_app.yml
299
- - spec/cassettes/sub_user/_apps/should_return_available_apps.yml
300
- - spec/cassettes/sub_user/_apps/should_set_current_app.yml
301
- - spec/cassettes/sub_user/_authentication/should_auth_a_sub_user.yml
302
- - spec/cassettes/sub_user/_authentication/should_return_error_with_a_bad_sub_user.yml
303
- - spec/cassettes/sub_user/_bounces/should_returns_bounce_emails.yml
304
- - spec/cassettes/sub_user/_bounces/should_tries_to_delete_unexisting_bounce_emails.yml
305
- - spec/cassettes/sub_user/_event_notification/should_add_event_notification_url.yml
306
- - spec/cassettes/sub_user/_event_notification/should_delete_event_notification_url.yml
307
- - spec/cassettes/sub_user/_event_notification/should_get_event_notification_url.yml
308
- - spec/cassettes/sub_user/_invalid_emails/should_return_invalid_emails.yml
309
- - spec/cassettes/sub_user/_invalid_emails/should_tries_to_delete_unexisting_invalid_mail.yml
310
- - spec/cassettes/sub_user/_ip_management/should_return_all_ips_available.yml
311
- - spec/cassettes/sub_user/_ip_management/should_show_ip_subuser.yml
312
- - spec/cassettes/sub_user/_limits/should_decrements_credits_for_a_sub_user.yml
313
- - spec/cassettes/sub_user/_limits/should_delete_all_limits_for_a_sub_user.yml
314
- - spec/cassettes/sub_user/_limits/should_increments_credits_for_a_sub_user.yml
315
- - spec/cassettes/sub_user/_limits/should_list_the_limits_for_a_sub_user.yml
316
- - spec/cassettes/sub_user/_limits/should_reset_all_limits_for_a_sub_user.yml
317
- - spec/cassettes/sub_user/_limits/should_returns_limits_for_a_sub_user.yml
318
- - spec/cassettes/sub_user/_limits/should_set_total_credits.yml
319
- - spec/cassettes/sub_user/_management/should_add_new_subuser.yml
320
- - spec/cassettes/sub_user/_management/should_disable_sub_user_for_send_email.yml
321
- - spec/cassettes/sub_user/_management/should_enable_sub_user_for_access_to_website.yml
322
- - spec/cassettes/sub_user/_management/should_enable_sub_user_for_send_email.yml
323
- - spec/cassettes/sub_user/_management/should_update_sub_user.yml
324
- - spec/cassettes/sub_user/_monitor_records/should_add_existing_sub_user_to_monitor_record.yml
325
- - spec/cassettes/sub_user/_monitor_records/should_create_a_new_monitor_record.yml
326
- - spec/cassettes/sub_user/_monitor_records/should_delete_a_monitor_record.yml
327
- - spec/cassettes/sub_user/_monitor_records/should_edit_a_monitor_record.yml
328
- - spec/cassettes/sub_user/_monitor_records/should_remove_existing_sub_user_from_monitor_record.yml
329
- - spec/cassettes/sub_user/_parse_email/should_delete_parse_email.yml
330
- - spec/cassettes/sub_user/_parse_email/should_get_parse_email.yml
331
- - spec/cassettes/sub_user/_parse_email/should_set_parse_email.yml
332
- - spec/cassettes/sub_user/_spam/should_return_spam_mails.yml
333
- - spec/cassettes/sub_user/_spam/should_tries_to_delete_unexisting_spam_mail.yml
334
- - spec/cassettes/sub_user/_unsubscribes/should_add_bounce_email.yml
335
- - spec/cassettes/sub_user/_unsubscribes/should_delete_existing_bounce_email.yml
336
- - spec/cassettes/sub_user/_unsubscribes/should_delete_unexisting_bounce_email.yml
337
- - spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml
338
- - spec/client_spec.rb
339
- - spec/helper_spec.rb
340
- - spec/spec_helper.rb
341
- - spec/sub_user_spec.rb
282
+ test_files: []
data/.circleci/config.yml DELETED
@@ -1,132 +0,0 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- defaults: &defaults
6
- working_directory: ~/repo
7
- docker:
8
- - image: circleci/ruby:2.3.6-stretch-node
9
- environment:
10
- # - DBHOST: localhost
11
- # - DBNAME: sendgrid_webapi_test
12
- # - DBPASSWORD: Vdm9omJt8Z3MCV4N
13
- # - DBUSER: test_user
14
- - RACK_ENV: test
15
- - RAILS_ENV: test
16
- # - image: circleci/postgres:10.3-alpine-ram
17
- # environment:
18
- # - POSTGRES_DB: sendgrid_webapi_test
19
- # - POSTGRES_USER: test_user
20
- # - POSTGRES_PASSWORD: Vdm9omJt8Z3MCV4N
21
-
22
- version: 2
23
- jobs:
24
- run_specs:
25
- <<: *defaults
26
-
27
- steps:
28
- - run:
29
- name: Set up environment
30
- command: |
31
- sudo apt-get update && sudo apt-get install -y apt-transport-https apt-utils
32
-
33
- - checkout
34
-
35
- - restore_cache:
36
- keys:
37
- - sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
38
- - sendgrid_webapi-dependencies-v1-
39
-
40
- - run:
41
- name: Install dependencies
42
- command: |
43
- # curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
44
- # echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
45
- # sudo apt-get update && sudo apt-get install postgresql-client-10
46
- bundle check --path=./vendor/bundle || bundle install --path=./vendor/bundle --jobs=4 --retry=3
47
-
48
- - save_cache:
49
- key: sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
50
- paths:
51
- - ./vendor/bundle
52
-
53
- # - run:
54
- # name: Set up database
55
- # command: |
56
- # cp spec/internal/config/database.docker.yml spec/internal/config/database.yml
57
-
58
- - run:
59
- name: Run tests
60
- command: |
61
- mkdir /tmp/test-results
62
- TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
63
- bundle exec rspec --format progress --format RspecJunitFormatter --out /tmp/test-results/rspec.xml $TEST_FILES
64
-
65
- - store_test_results:
66
- path: /tmp/test-results
67
-
68
- - store_artifacts:
69
- path: /tmp/test-results
70
- destination: test-results
71
-
72
- build_gem:
73
- <<: *defaults
74
-
75
- steps:
76
- - run:
77
- name: Set up environment
78
- command: |
79
- sudo apt-get update && sudo apt-get install -y apt-transport-https apt-utils
80
-
81
- - checkout
82
-
83
- - restore_cache:
84
- keys:
85
- - sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
86
- - sendgrid_webapi-dependencies-v1-
87
-
88
- - run:
89
- name: Install dependencies
90
- command: |
91
- gem install gemfury
92
- bundle check --path=./vendor/bundle || bundle install --path=./vendor/bundle --jobs=4 --retry=3
93
-
94
- - save_cache:
95
- key: sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
96
- paths:
97
- - ./vendor/bundle
98
-
99
- - run:
100
- name: Build gem
101
- command: |
102
- gem build sendgrid_webapi.gemspec
103
-
104
- - run:
105
- name: Push gem
106
- command: |
107
- if [[ "${CIRCLE_PROJECT_USERNAME}" == "OneHQ" && "${CIRCLE_BRANCH}" == "master" && -n "${RUBYGEMS_API_KEY}" ]]; then
108
- bash .circleci/setup-rubygems.sh
109
- version=$(ruby -e 'load "lib/version.rb"; puts SendGridWebApi::VERSION')
110
- grep -q "${version}" <(gem search sendgrid_api) || EXIT_CODE=$? && true
111
- if [[ $EXIT_CODE == 1 ]]; then
112
- gem push sendgrid_webapi-${version}.gem
113
- git tag ${version}
114
- git push --tags
115
-
116
- [[ -n "$SLACK_TOKEN" ]] && curl -s -d "sendgrid_webapi ($version) released." "https://onehq.slack.com/services/hooks/slackbot?token=${SLACK_TOKEN}&channel=%23machines"
117
- fi
118
- fi
119
-
120
- workflows:
121
- version: 2
122
- build-deploy:
123
- jobs:
124
- - run_specs
125
- - build_gem:
126
- requires:
127
- - run_specs
128
- filters:
129
- branches:
130
- only:
131
- - master
132
- - staging
@@ -1,5 +0,0 @@
1
- #!/bin/sh
2
-
3
- mkdir -p ~/.gem
4
- echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
5
- chmod 0600 /home/circleci/.gem/credentials