sendgrid-ruby 6.2.1 → 6.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +1 -1
  3. data/.gitignore +1 -1
  4. data/.rubocop.yml +4 -0
  5. data/.rubocop_todo.yml +109 -0
  6. data/.travis.yml +3 -4
  7. data/CHANGELOG.md +69 -9
  8. data/CONTRIBUTING.md +11 -21
  9. data/FIRST_TIMERS.md +79 -0
  10. data/Gemfile +0 -1
  11. data/ISSUE_TEMPLATE.md +5 -1
  12. data/Makefile +4 -2
  13. data/PULL_REQUEST_TEMPLATE.md +1 -1
  14. data/README.md +22 -27
  15. data/Rakefile +2 -3
  16. data/TROUBLESHOOTING.md +5 -5
  17. data/USAGE.md +145 -38
  18. data/examples/accesssettings/accesssettings.rb +9 -12
  19. data/examples/alerts/alerts.rb +8 -11
  20. data/examples/apikeys/apikeys.rb +12 -15
  21. data/examples/asm/asm.rb +27 -30
  22. data/examples/browsers/browsers.rb +0 -3
  23. data/examples/campaigns/campaigns.rb +29 -32
  24. data/examples/categories/categories.rb +0 -3
  25. data/examples/clients/clients.rb +1 -4
  26. data/examples/contactdb/contactdb.rb +63 -66
  27. data/examples/devices/devices.rb +0 -3
  28. data/examples/emailactivity/emailactivity.rb +52 -0
  29. data/examples/geo/geo.rb +0 -3
  30. data/examples/helpers/eventwebhook/example.rb +16 -0
  31. data/examples/helpers/mail/example.rb +19 -13
  32. data/examples/helpers/settings/example.rb +1 -1
  33. data/examples/helpers/stats/example.rb +4 -4
  34. data/examples/ips/ips.rb +19 -22
  35. data/examples/mail/mail.rb +72 -75
  36. data/examples/mailboxproviders/mailboxproviders.rb +0 -3
  37. data/examples/mailsettings/mailsettings.rb +21 -24
  38. data/examples/partnersettings/partnersettings.rb +3 -6
  39. data/examples/scopes/scopes.rb +7 -9
  40. data/examples/senderauthentication/senderauthentication.rb +41 -44
  41. data/examples/senders/senders.rb +28 -31
  42. data/examples/stats/stats.rb +0 -3
  43. data/examples/subusers/subusers.rb +17 -20
  44. data/examples/suppression/suppression.rb +15 -18
  45. data/examples/templates/templates.rb +29 -31
  46. data/examples/trackingsettings/trackingsettings.rb +14 -17
  47. data/examples/user/user.rb +41 -44
  48. data/lib/rack/sendgrid_webhook_verification.rb +53 -0
  49. data/lib/sendgrid-ruby.rb +2 -0
  50. data/lib/sendgrid/base_interface.rb +1 -1
  51. data/lib/sendgrid/helpers/eventwebhook/eventwebhook.rb +50 -0
  52. data/lib/sendgrid/helpers/inbound/README.md +5 -5
  53. data/lib/sendgrid/helpers/inbound/app.rb +1 -1
  54. data/lib/sendgrid/helpers/inbound/public/index.html +1 -1
  55. data/lib/sendgrid/helpers/inbound/send.rb +2 -2
  56. data/lib/sendgrid/helpers/ip_management/ip_management.rb +1 -1
  57. data/lib/sendgrid/helpers/mail/README.md +3 -3
  58. data/lib/sendgrid/helpers/mail/asm.rb +6 -18
  59. data/lib/sendgrid/helpers/mail/attachment.rb +12 -42
  60. data/lib/sendgrid/helpers/mail/bcc_settings.rb +6 -18
  61. data/lib/sendgrid/helpers/mail/bypass_list_management.rb +8 -18
  62. data/lib/sendgrid/helpers/mail/category.rb +2 -2
  63. data/lib/sendgrid/helpers/mail/click_tracking.rb +6 -18
  64. data/lib/sendgrid/helpers/mail/content.rb +4 -3
  65. data/lib/sendgrid/helpers/mail/custom_arg.rb +6 -10
  66. data/lib/sendgrid/helpers/mail/email.rb +5 -4
  67. data/lib/sendgrid/helpers/mail/footer.rb +7 -27
  68. data/lib/sendgrid/helpers/mail/ganalytics.rb +10 -54
  69. data/lib/sendgrid/helpers/mail/header.rb +6 -10
  70. data/lib/sendgrid/helpers/mail/mail.rb +30 -48
  71. data/lib/sendgrid/helpers/mail/mail_settings.rb +9 -25
  72. data/lib/sendgrid/helpers/mail/open_tracking.rb +6 -18
  73. data/lib/sendgrid/helpers/mail/personalization.rb +34 -27
  74. data/lib/sendgrid/helpers/mail/section.rb +6 -10
  75. data/lib/sendgrid/helpers/mail/spam_check.rb +7 -27
  76. data/lib/sendgrid/helpers/mail/subscription_tracking.rb +8 -36
  77. data/lib/sendgrid/helpers/mail/substitution.rb +6 -10
  78. data/lib/sendgrid/helpers/mail/tracking_settings.rb +7 -20
  79. data/lib/sendgrid/helpers/permissions/scope.rb +1 -1
  80. data/lib/sendgrid/helpers/settings/README.md +2 -2
  81. data/lib/sendgrid/helpers/settings/settings.rb +1 -1
  82. data/lib/sendgrid/helpers/settings/tracking_settings_dto.rb +3 -5
  83. data/lib/sendgrid/helpers/stats/metrics.rb +5 -5
  84. data/lib/sendgrid/sendgrid.rb +1 -1
  85. data/lib/sendgrid/twilio_email.rb +1 -1
  86. data/lib/sendgrid/version.rb +1 -1
  87. data/mail_helper_v3.md +12 -12
  88. data/sendgrid-ruby.gemspec +8 -7
  89. data/spec/fixtures/event_webhook.rb +22 -0
  90. data/spec/rack/sendgrid_webhook_verification_spec.rb +116 -0
  91. data/spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb +105 -0
  92. data/spec/sendgrid/helpers/settings/mail_settings_dto_spec.rb +1 -1
  93. data/spec/sendgrid/helpers/settings/partner_settings_dto_spec.rb +1 -1
  94. data/spec/sendgrid/helpers/settings/settings_spec.rb +2 -2
  95. data/spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb +1 -1
  96. data/spec/sendgrid/helpers/settings/user_settings_dto_spec.rb +1 -1
  97. data/spec/sendgrid/helpers/stats/email_stats_spec.rb +22 -23
  98. data/spec/sendgrid/helpers/stats/metrics_spec.rb +19 -20
  99. data/spec/sendgrid/helpers/stats/stats_response_spec.rb +22 -23
  100. data/spec/spec_helper.rb +3 -1
  101. data/static/img/github-fork.png +0 -0
  102. data/static/img/github-sign-up.png +0 -0
  103. data/test/sendgrid/helpers/mail/test_attachment.rb +4 -6
  104. data/test/sendgrid/helpers/mail/test_category.rb +0 -2
  105. data/test/sendgrid/helpers/mail/test_email.rb +9 -11
  106. data/test/sendgrid/helpers/mail/test_mail.rb +101 -102
  107. data/test/sendgrid/helpers/mail/test_personalizations.rb +106 -93
  108. data/test/sendgrid/permissions/test_scopes.rb +0 -2
  109. data/test/sendgrid/test_sendgrid-ruby.rb +1948 -1958
  110. data/twilio_sendgrid_logo.png +0 -0
  111. data/use-cases/README.md +16 -0
  112. data/use-cases/domain-authentication.md +5 -0
  113. data/use-cases/email-statistics.md +52 -0
  114. data/use-cases/legacy-templates.md +98 -0
  115. data/use-cases/sms.md +39 -0
  116. data/use-cases/transactional-templates.md +111 -0
  117. data/use-cases/twilio-email.md +13 -0
  118. data/use-cases/twilio-setup.md +54 -0
  119. metadata +73 -24
  120. data/USE_CASES.md +0 -405
  121. data/docker/Dockerfile +0 -12
  122. data/docker/README.md +0 -30
@@ -1,9 +1,7 @@
1
1
  require 'sendgrid-ruby'
2
2
 
3
-
4
3
  sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
5
4
 
6
-
7
5
  ##################################################
8
6
  # Retrieve email statistics by mailbox provider. #
9
7
  # GET /mailbox_providers/stats #
@@ -13,4 +11,3 @@ response = sg.client.mailbox_providers.stats.get(query_params: params)
13
11
  puts response.status_code
14
12
  puts response.body
15
13
  puts response.headers
16
-
@@ -1,9 +1,7 @@
1
1
  require 'sendgrid-ruby'
2
2
 
3
-
4
3
  sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
5
4
 
6
-
7
5
  ##################################################
8
6
  # Retrieve all mail settings #
9
7
  # GET /mail_settings #
@@ -19,9 +17,9 @@ puts response.headers
19
17
  # PATCH /mail_settings/address_whitelist #
20
18
 
21
19
  data = JSON.parse('{
22
- "enabled": true,
20
+ "enabled": true,
23
21
  "list": [
24
- "email1@example.com",
22
+ "email1@example.com",
25
23
  "example.com"
26
24
  ]
27
25
  }')
@@ -34,7 +32,7 @@ puts response.headers
34
32
  # Retrieve address whitelist mail settings #
35
33
  # GET /mail_settings/address_whitelist #
36
34
 
37
- response = sg.client.mail_settings.address_whitelist.get()
35
+ response = sg.client.mail_settings.address_whitelist.get
38
36
  puts response.status_code
39
37
  puts response.body
40
38
  puts response.headers
@@ -44,7 +42,7 @@ puts response.headers
44
42
  # PATCH /mail_settings/bcc #
45
43
 
46
44
  data = JSON.parse('{
47
- "email": "email@example.com",
45
+ "email": "email@example.com",
48
46
  "enabled": false
49
47
  }')
50
48
  response = sg.client.mail_settings.bcc.patch(request_body: data)
@@ -56,7 +54,7 @@ puts response.headers
56
54
  # Retrieve all BCC mail settings #
57
55
  # GET /mail_settings/bcc #
58
56
 
59
- response = sg.client.mail_settings.bcc.get()
57
+ response = sg.client.mail_settings.bcc.get
60
58
  puts response.status_code
61
59
  puts response.body
62
60
  puts response.headers
@@ -66,8 +64,8 @@ puts response.headers
66
64
  # PATCH /mail_settings/bounce_purge #
67
65
 
68
66
  data = JSON.parse('{
69
- "enabled": true,
70
- "hard_bounces": 5,
67
+ "enabled": true,
68
+ "hard_bounces": 5,
71
69
  "soft_bounces": 5
72
70
  }')
73
71
  response = sg.client.mail_settings.bounce_purge.patch(request_body: data)
@@ -79,7 +77,7 @@ puts response.headers
79
77
  # Retrieve bounce purge mail settings #
80
78
  # GET /mail_settings/bounce_purge #
81
79
 
82
- response = sg.client.mail_settings.bounce_purge.get()
80
+ response = sg.client.mail_settings.bounce_purge.get
83
81
  puts response.status_code
84
82
  puts response.body
85
83
  puts response.headers
@@ -89,8 +87,8 @@ puts response.headers
89
87
  # PATCH /mail_settings/footer #
90
88
 
91
89
  data = JSON.parse('{
92
- "enabled": true,
93
- "html_content": "...",
90
+ "enabled": true,
91
+ "html_content": "...",
94
92
  "plain_content": "..."
95
93
  }')
96
94
  response = sg.client.mail_settings.footer.patch(request_body: data)
@@ -102,7 +100,7 @@ puts response.headers
102
100
  # Retrieve footer mail settings #
103
101
  # GET /mail_settings/footer #
104
102
 
105
- response = sg.client.mail_settings.footer.get()
103
+ response = sg.client.mail_settings.footer.get
106
104
  puts response.status_code
107
105
  puts response.body
108
106
  puts response.headers
@@ -112,7 +110,7 @@ puts response.headers
112
110
  # PATCH /mail_settings/forward_bounce #
113
111
 
114
112
  data = JSON.parse('{
115
- "email": "example@example.com",
113
+ "email": "example@example.com",
116
114
  "enabled": true
117
115
  }')
118
116
  response = sg.client.mail_settings.forward_bounce.patch(request_body: data)
@@ -124,7 +122,7 @@ puts response.headers
124
122
  # Retrieve forward bounce mail settings #
125
123
  # GET /mail_settings/forward_bounce #
126
124
 
127
- response = sg.client.mail_settings.forward_bounce.get()
125
+ response = sg.client.mail_settings.forward_bounce.get
128
126
  puts response.status_code
129
127
  puts response.body
130
128
  puts response.headers
@@ -134,7 +132,7 @@ puts response.headers
134
132
  # PATCH /mail_settings/forward_spam #
135
133
 
136
134
  data = JSON.parse('{
137
- "email": "",
135
+ "email": "",
138
136
  "enabled": false
139
137
  }')
140
138
  response = sg.client.mail_settings.forward_spam.patch(request_body: data)
@@ -146,7 +144,7 @@ puts response.headers
146
144
  # Retrieve forward spam mail settings #
147
145
  # GET /mail_settings/forward_spam #
148
146
 
149
- response = sg.client.mail_settings.forward_spam.get()
147
+ response = sg.client.mail_settings.forward_spam.get
150
148
  puts response.status_code
151
149
  puts response.body
152
150
  puts response.headers
@@ -167,7 +165,7 @@ puts response.headers
167
165
  # Retrieve plain content mail settings #
168
166
  # GET /mail_settings/plain_content #
169
167
 
170
- response = sg.client.mail_settings.plain_content.get()
168
+ response = sg.client.mail_settings.plain_content.get
171
169
  puts response.status_code
172
170
  puts response.body
173
171
  puts response.headers
@@ -177,8 +175,8 @@ puts response.headers
177
175
  # PATCH /mail_settings/spam_check #
178
176
 
179
177
  data = JSON.parse('{
180
- "enabled": true,
181
- "max_score": 5,
178
+ "enabled": true,
179
+ "max_score": 5,
182
180
  "url": "url"
183
181
  }')
184
182
  response = sg.client.mail_settings.spam_check.patch(request_body: data)
@@ -190,7 +188,7 @@ puts response.headers
190
188
  # Retrieve spam check mail settings #
191
189
  # GET /mail_settings/spam_check #
192
190
 
193
- response = sg.client.mail_settings.spam_check.get()
191
+ response = sg.client.mail_settings.spam_check.get
194
192
  puts response.status_code
195
193
  puts response.body
196
194
  puts response.headers
@@ -200,7 +198,7 @@ puts response.headers
200
198
  # PATCH /mail_settings/template #
201
199
 
202
200
  data = JSON.parse('{
203
- "enabled": true,
201
+ "enabled": true,
204
202
  "html_content": "<% body %>"
205
203
  }')
206
204
  response = sg.client.mail_settings.template.patch(request_body: data)
@@ -212,8 +210,7 @@ puts response.headers
212
210
  # Retrieve legacy template mail settings #
213
211
  # GET /mail_settings/template #
214
212
 
215
- response = sg.client.mail_settings.template.get()
213
+ response = sg.client.mail_settings.template.get
216
214
  puts response.status_code
217
215
  puts response.body
218
216
  puts response.headers
219
-
@@ -1,9 +1,7 @@
1
1
  require 'sendgrid-ruby'
2
2
 
3
-
4
3
  sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
5
4
 
6
-
7
5
  ##################################################
8
6
  # Returns a list of all partner settings. #
9
7
  # GET /partner_settings #
@@ -19,8 +17,8 @@ puts response.headers
19
17
  # PATCH /partner_settings/new_relic #
20
18
 
21
19
  data = JSON.parse('{
22
- "enable_subuser_statistics": true,
23
- "enabled": true,
20
+ "enable_subuser_statistics": true,
21
+ "enabled": true,
24
22
  "license_key": ""
25
23
  }')
26
24
  response = sg.client.partner_settings.new_relic.patch(request_body: data)
@@ -32,8 +30,7 @@ puts response.headers
32
30
  # Returns all New Relic partner settings. #
33
31
  # GET /partner_settings/new_relic #
34
32
 
35
- response = sg.client.partner_settings.new_relic.get()
33
+ response = sg.client.partner_settings.new_relic.get
36
34
  puts response.status_code
37
35
  puts response.body
38
36
  puts response.headers
39
-
@@ -1,12 +1,11 @@
1
1
  require_relative '../../lib/sendgrid-ruby.rb'
2
-
3
2
  sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
4
3
 
5
4
  ##################################################
6
5
  # Retrieve a list of scopes for which this user has access. #
7
6
  # GET /scopes #
8
7
 
9
- response = sg.client.scopes.get()
8
+ response = sg.client.scopes.get
10
9
  puts response.status_code
11
10
  puts response.body
12
11
  puts response.headers
@@ -15,14 +14,13 @@ puts response.headers
15
14
  # Update the name & scopes of an API Key #
16
15
  # PUT /api_keys/{api_key_id} #
17
16
 
18
-
19
17
  scopes = [
20
- "user.profile.read",
18
+ "user.profile.read",
21
19
  "user.profile.update"
22
20
  ]
23
21
 
24
22
  data = {
25
- "name": "A New Hope",
23
+ "name": "A New Hope",
26
24
  "scopes": scopes
27
25
  }
28
26
  api_key_id = "test_url_param"
@@ -44,8 +42,8 @@ scopes = SendGrid::Scope.read_only_permissions
44
42
  # {endpoint}_read_only_permissions and {endpoint}_full_access_permissions
45
43
 
46
44
  # These are the endpoints :
47
- # alerts, api_keys, asm_groups, billing, categories, credentials, stats, ips, mail_settings, mail,
48
- # marketing_campaigns, partner_settings, scheduled_sends, subusers, suppression, teammates,
45
+ # alerts, api_keys, asm_groups, billing, categories, credentials, stats, ips, mail_settings, mail,
46
+ # marketing_campaigns, partner_settings, scheduled_sends, subusers, suppression, teammates,
49
47
  # templates, tracking_settings, user_settings, webhooks, whitelabel, access_settings
50
48
 
51
49
  # read only permissions for alerts
@@ -54,8 +52,8 @@ scopes = SendGrid::Scope.alerts_read_only_permissions
54
52
  # full access permissions for alerts
55
53
  scopes = SendGrid::Scope.alerts_full_access_permissions
56
54
 
57
- # read only permissions for billing
55
+ # read only permissions for billing
58
56
  scopes = SendGrid::Scope.billing_read_only_permissions
59
57
 
60
58
  # full access permissions for billing
61
- scopes = SendGrid::Scope.billing_full_access_permissions
59
+ scopes = SendGrid::Scope.billing_full_access_permissions
@@ -1,23 +1,21 @@
1
1
  require 'sendgrid-ruby'
2
2
 
3
-
4
3
  sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
5
4
 
6
-
7
5
  ##################################################
8
6
  # Create a domain authentication. #
9
7
  # POST /whitelabel/domains #
10
8
 
11
9
  data = JSON.parse('{
12
- "automatic_security": false,
13
- "custom_spf": true,
14
- "default": true,
15
- "domain": "example.com",
10
+ "automatic_security": false,
11
+ "custom_spf": true,
12
+ "default": true,
13
+ "domain": "example.com",
16
14
  "ips": [
17
- "192.168.1.1",
15
+ "192.168.1.1",
18
16
  "192.168.1.2"
19
- ],
20
- "subdomain": "news",
17
+ ],
18
+ "subdomain": "news",
21
19
  "username": "john@example.com"
22
20
  }')
23
21
  response = sg.client.whitelabel.domains.post(request_body: data)
@@ -39,7 +37,7 @@ puts response.headers
39
37
  # Get the default domain authentication. #
40
38
  # GET /whitelabel/domains/default #
41
39
 
42
- response = sg.client.whitelabel.domains.default.get()
40
+ response = sg.client.whitelabel.domains.default.get
43
41
  puts response.status_code
44
42
  puts response.body
45
43
  puts response.headers
@@ -48,7 +46,7 @@ puts response.headers
48
46
  # List the domain authentication associated with the given user. #
49
47
  # GET /whitelabel/domains/subuser #
50
48
 
51
- response = sg.client.whitelabel.domains.subuser.get()
49
+ response = sg.client.whitelabel.domains.subuser.get
52
50
  puts response.status_code
53
51
  puts response.body
54
52
  puts response.headers
@@ -57,7 +55,7 @@ puts response.headers
57
55
  # Disassociate a domain authentication from a given user. #
58
56
  # DELETE /whitelabel/domains/subuser #
59
57
 
60
- response = sg.client.whitelabel.domains.subuser.delete()
58
+ response = sg.client.whitelabel.domains.subuser.delete
61
59
  puts response.status_code
62
60
  puts response.body
63
61
  puts response.headers
@@ -67,10 +65,10 @@ puts response.headers
67
65
  # PATCH /whitelabel/domains/{domain_id} #
68
66
 
69
67
  data = JSON.parse('{
70
- "custom_spf": true,
68
+ "custom_spf": true,
71
69
  "default": false
72
70
  }')
73
- domain_id = "test_url_param"
71
+ domain_id = 'test_url_param'
74
72
  response = sg.client.whitelabel.domains._(domain_id).patch(request_body: data)
75
73
  puts response.status_code
76
74
  puts response.body
@@ -80,8 +78,8 @@ puts response.headers
80
78
  # Retrieve a domain authentication. #
81
79
  # GET /whitelabel/domains/{domain_id} #
82
80
 
83
- domain_id = "test_url_param"
84
- response = sg.client.whitelabel.domains._(domain_id).get()
81
+ domain_id = 'test_url_param'
82
+ response = sg.client.whitelabel.domains._(domain_id).get
85
83
  puts response.status_code
86
84
  puts response.body
87
85
  puts response.headers
@@ -90,8 +88,8 @@ puts response.headers
90
88
  # Delete a domain authentication. #
91
89
  # DELETE /whitelabel/domains/{domain_id} #
92
90
 
93
- domain_id = "test_url_param"
94
- response = sg.client.whitelabel.domains._(domain_id).delete()
91
+ domain_id = 'test_url_param'
92
+ response = sg.client.whitelabel.domains._(domain_id).delete
95
93
  puts response.status_code
96
94
  puts response.body
97
95
  puts response.headers
@@ -103,7 +101,7 @@ puts response.headers
103
101
  data = JSON.parse('{
104
102
  "username": "jane@example.com"
105
103
  }')
106
- domain_id = "test_url_param"
104
+ domain_id = 'test_url_param'
107
105
  response = sg.client.whitelabel.domains._(domain_id).subuser.post(request_body: data)
108
106
  puts response.status_code
109
107
  puts response.body
@@ -116,7 +114,7 @@ puts response.headers
116
114
  data = JSON.parse('{
117
115
  "ip": "192.168.0.1"
118
116
  }')
119
- id = "test_url_param"
117
+ id = 'test_url_param'
120
118
  response = sg.client.whitelabel.domains._(id).ips.post(request_body: data)
121
119
  puts response.status_code
122
120
  puts response.body
@@ -126,9 +124,9 @@ puts response.headers
126
124
  # Remove an IP from a domain authentication. #
127
125
  # DELETE /whitelabel/domains/{id}/ips/{ip} #
128
126
 
129
- id = "test_url_param"
130
- ip = "test_url_param"
131
- response = sg.client.whitelabel.domains._(id).ips._(ip).delete()
127
+ id = 'test_url_param'
128
+ ip = 'test_url_param'
129
+ response = sg.client.whitelabel.domains._(id).ips._(ip).delete
132
130
  puts response.status_code
133
131
  puts response.body
134
132
  puts response.headers
@@ -137,8 +135,8 @@ puts response.headers
137
135
  # Validate a domain authentication. #
138
136
  # POST /whitelabel/domains/{id}/validate #
139
137
 
140
- id = "test_url_param"
141
- response = sg.client.whitelabel.domains._(id).validate.post()
138
+ id = 'test_url_param'
139
+ response = sg.client.whitelabel.domains._(id).validate.post
142
140
  puts response.status_code
143
141
  puts response.body
144
142
  puts response.headers
@@ -148,8 +146,8 @@ puts response.headers
148
146
  # POST /whitelabel/ips #
149
147
 
150
148
  data = JSON.parse('{
151
- "domain": "example.com",
152
- "ip": "192.168.1.1",
149
+ "domain": "example.com",
150
+ "ip": "192.168.1.1",
153
151
  "subdomain": "email"
154
152
  }')
155
153
  response = sg.client.whitelabel.ips.post(request_body: data)
@@ -171,8 +169,8 @@ puts response.headers
171
169
  # Retrieve a reverse DNS record #
172
170
  # GET /whitelabel/ips/{id} #
173
171
 
174
- id = "test_url_param"
175
- response = sg.client.whitelabel.ips._(id).get()
172
+ id = 'test_url_param'
173
+ response = sg.client.whitelabel.ips._(id).get
176
174
  puts response.status_code
177
175
  puts response.body
178
176
  puts response.headers
@@ -181,8 +179,8 @@ puts response.headers
181
179
  # Delete a reverse DNS record #
182
180
  # DELETE /whitelabel/ips/{id} #
183
181
 
184
- id = "test_url_param"
185
- response = sg.client.whitelabel.ips._(id).delete()
182
+ id = 'test_url_param'
183
+ response = sg.client.whitelabel.ips._(id).delete
186
184
  puts response.status_code
187
185
  puts response.body
188
186
  puts response.headers
@@ -191,8 +189,8 @@ puts response.headers
191
189
  # Validate a reverse DNS record #
192
190
  # POST /whitelabel/ips/{id}/validate #
193
191
 
194
- id = "test_url_param"
195
- response = sg.client.whitelabel.ips._(id).validate.post()
192
+ id = 'test_url_param'
193
+ response = sg.client.whitelabel.ips._(id).validate.post
196
194
  puts response.status_code
197
195
  puts response.body
198
196
  puts response.headers
@@ -202,8 +200,8 @@ puts response.headers
202
200
  # POST /whitelabel/links #
203
201
 
204
202
  data = JSON.parse('{
205
- "default": true,
206
- "domain": "example.com",
203
+ "default": true,
204
+ "domain": "example.com",
207
205
  "subdomain": "mail"
208
206
  }')
209
207
  params = JSON.parse('{"limit": 1, "offset": 1}')
@@ -259,7 +257,7 @@ puts response.headers
259
257
  data = JSON.parse('{
260
258
  "default": true
261
259
  }')
262
- id = "test_url_param"
260
+ id = 'test_url_param'
263
261
  response = sg.client.whitelabel.links._(id).patch(request_body: data)
264
262
  puts response.status_code
265
263
  puts response.body
@@ -269,8 +267,8 @@ puts response.headers
269
267
  # Retrieve a Link Branding #
270
268
  # GET /whitelabel/links/{id} #
271
269
 
272
- id = "test_url_param"
273
- response = sg.client.whitelabel.links._(id).get()
270
+ id = 'test_url_param'
271
+ response = sg.client.whitelabel.links._(id).get
274
272
  puts response.status_code
275
273
  puts response.body
276
274
  puts response.headers
@@ -279,8 +277,8 @@ puts response.headers
279
277
  # Delete a Link Branding #
280
278
  # DELETE /whitelabel/links/{id} #
281
279
 
282
- id = "test_url_param"
283
- response = sg.client.whitelabel.links._(id).delete()
280
+ id = 'test_url_param'
281
+ response = sg.client.whitelabel.links._(id).delete
284
282
  puts response.status_code
285
283
  puts response.body
286
284
  puts response.headers
@@ -289,8 +287,8 @@ puts response.headers
289
287
  # Validate a Link Branding #
290
288
  # POST /whitelabel/links/{id}/validate #
291
289
 
292
- id = "test_url_param"
293
- response = sg.client.whitelabel.links._(id).validate.post()
290
+ id = 'test_url_param'
291
+ response = sg.client.whitelabel.links._(id).validate.post
294
292
  puts response.status_code
295
293
  puts response.body
296
294
  puts response.headers
@@ -302,9 +300,8 @@ puts response.headers
302
300
  data = JSON.parse('{
303
301
  "username": "jane@example.com"
304
302
  }')
305
- link_id = "test_url_param"
303
+ link_id = 'test_url_param'
306
304
  response = sg.client.whitelabel.links._(link_id).subuser.post(request_body: data)
307
305
  puts response.status_code
308
306
  puts response.body
309
307
  puts response.headers
310
-