sendgrid4r 1.11.0 → 1.12.0
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -1
- data/exe/sg +5 -0
- data/lib/sendgrid4r/cli/api_keys/api_key.rb +53 -0
- data/lib/sendgrid4r/cli/api_keys/permission.rb +15 -0
- data/lib/sendgrid4r/cli/campaign/campaign.rb +134 -0
- data/lib/sendgrid4r/cli/campaign/contact/contact.rb +25 -0
- data/lib/sendgrid4r/cli/campaign/contact/custom_field.rb +42 -0
- data/lib/sendgrid4r/cli/campaign/contact/list.rb +71 -0
- data/lib/sendgrid4r/cli/campaign/contact/recipient.rb +78 -0
- data/lib/sendgrid4r/cli/campaign/contact/reserved_field.rb +17 -0
- data/lib/sendgrid4r/cli/campaign/contact/segment.rb +96 -0
- data/lib/sendgrid4r/cli/campaign/sender.rb +83 -0
- data/lib/sendgrid4r/cli/cancel_schedules/batch_id.rb +23 -0
- data/lib/sendgrid4r/cli/cancel_schedules/cancel_schedule.rb +55 -0
- data/lib/sendgrid4r/cli/category.rb +16 -0
- data/lib/sendgrid4r/cli/ipam/activity.rb +16 -0
- data/lib/sendgrid4r/cli/ipam/ipam.rb +14 -0
- data/lib/sendgrid4r/cli/ipam/whitelist.rb +39 -0
- data/lib/sendgrid4r/cli/ips/address.rb +48 -0
- data/lib/sendgrid4r/cli/ips/ip.rb +17 -0
- data/lib/sendgrid4r/cli/ips/pool.rb +48 -0
- data/lib/sendgrid4r/cli/ips/warmup.rb +39 -0
- data/lib/sendgrid4r/cli/mail.rb +34 -0
- data/lib/sendgrid4r/cli/settings/enforced_tls.rb +24 -0
- data/lib/sendgrid4r/cli/settings/mail.rb +171 -0
- data/lib/sendgrid4r/cli/settings/partner.rb +34 -0
- data/lib/sendgrid4r/cli/settings/settings.rb +20 -0
- data/lib/sendgrid4r/cli/settings/tracking.rb +92 -0
- data/lib/sendgrid4r/cli/sg.rb +55 -0
- data/lib/sendgrid4r/cli/sg_thor.rb +34 -0
- data/lib/sendgrid4r/cli/stats/advanced.rb +72 -0
- data/lib/sendgrid4r/cli/stats/category.rb +35 -0
- data/lib/sendgrid4r/cli/stats/global.rb +18 -0
- data/lib/sendgrid4r/cli/stats/parse.rb +18 -0
- data/lib/sendgrid4r/cli/stats/stats.rb +23 -0
- data/lib/sendgrid4r/cli/stats/subuser.rb +67 -0
- data/lib/sendgrid4r/cli/subusers/monitor.rb +44 -0
- data/lib/sendgrid4r/cli/subusers/subuser.rb +77 -0
- data/lib/sendgrid4r/cli/suppressions/block.rb +43 -0
- data/lib/sendgrid4r/cli/suppressions/bounce.rb +41 -0
- data/lib/sendgrid4r/cli/suppressions/global_unsubscribe.rb +43 -0
- data/lib/sendgrid4r/cli/suppressions/group.rb +56 -0
- data/lib/sendgrid4r/cli/suppressions/group_unsubscribe.rb +34 -0
- data/lib/sendgrid4r/cli/suppressions/invalid_email.rb +43 -0
- data/lib/sendgrid4r/cli/suppressions/spam_report.rb +43 -0
- data/lib/sendgrid4r/cli/suppressions/suppression.rb +36 -0
- data/lib/sendgrid4r/cli/templates/template.rb +51 -0
- data/lib/sendgrid4r/cli/templates/version.rb +78 -0
- data/lib/sendgrid4r/cli/user.rb +86 -0
- data/lib/sendgrid4r/cli/webhooks/event.rb +53 -0
- data/lib/sendgrid4r/cli/webhooks/parse.rb +15 -0
- data/lib/sendgrid4r/cli/webhooks/webhook.rb +14 -0
- data/lib/sendgrid4r/cli/whitelabel/domain.rb +117 -0
- data/lib/sendgrid4r/cli/whitelabel/ip.rb +52 -0
- data/lib/sendgrid4r/cli/whitelabel/link.rb +96 -0
- data/lib/sendgrid4r/cli/whitelabel/whitelabel.rb +17 -0
- data/lib/sendgrid4r/client.rb +4 -1
- data/lib/sendgrid4r/factory/campaign_factory.rb +1 -1
- data/lib/sendgrid4r/factory/condition_factory.rb +2 -2
- data/lib/sendgrid4r/factory/event_factory.rb +21 -0
- data/lib/sendgrid4r/rest/api_keys_management/api_keys.rb +5 -5
- data/lib/sendgrid4r/rest/api_keys_management/permissions.rb +3 -1
- data/lib/sendgrid4r/rest/blocks.rb +2 -2
- data/lib/sendgrid4r/rest/bounces.rb +2 -2
- data/lib/sendgrid4r/rest/cancel_scheduled_sends.rb +12 -4
- data/lib/sendgrid4r/rest/categories.rb +1 -1
- data/lib/sendgrid4r/rest/email_activity.rb +1 -1
- data/lib/sendgrid4r/rest/invalid_emails.rb +2 -2
- data/lib/sendgrid4r/rest/ip_access_management.rb +12 -4
- data/lib/sendgrid4r/rest/ips/addresses.rb +4 -4
- data/lib/sendgrid4r/rest/ips/pools.rb +4 -4
- data/lib/sendgrid4r/rest/ips/warmup.rb +3 -3
- data/lib/sendgrid4r/rest/marketing_campaigns/contacts/custom_fields.rb +9 -3
- data/lib/sendgrid4r/rest/marketing_campaigns/contacts/lists.rb +7 -5
- data/lib/sendgrid4r/rest/marketing_campaigns/contacts/recipients.rb +22 -7
- data/lib/sendgrid4r/rest/marketing_campaigns/contacts/reserved_fields.rb +3 -1
- data/lib/sendgrid4r/rest/marketing_campaigns/contacts/segments.rb +7 -5
- data/lib/sendgrid4r/rest/marketing_campaigns/marketing_campaigns.rb +8 -8
- data/lib/sendgrid4r/rest/marketing_campaigns/senders.rb +4 -4
- data/lib/sendgrid4r/rest/request.rb +6 -4
- data/lib/sendgrid4r/rest/settings/enforced_tls.rb +6 -2
- data/lib/sendgrid4r/rest/settings/mail.rb +71 -17
- data/lib/sendgrid4r/rest/settings/partner.rb +3 -3
- data/lib/sendgrid4r/rest/settings/tracking.rb +17 -9
- data/lib/sendgrid4r/rest/sm/global_unsubscribes.rb +5 -3
- data/lib/sendgrid4r/rest/sm/groups.rb +4 -4
- data/lib/sendgrid4r/rest/sm/suppressions.rb +6 -3
- data/lib/sendgrid4r/rest/spam_reports.rb +2 -2
- data/lib/sendgrid4r/rest/stats/advanced.rb +8 -8
- data/lib/sendgrid4r/rest/stats/category.rb +2 -2
- data/lib/sendgrid4r/rest/stats/global.rb +1 -1
- data/lib/sendgrid4r/rest/stats/parse.rb +1 -1
- data/lib/sendgrid4r/rest/stats/subuser.rb +4 -4
- data/lib/sendgrid4r/rest/subusers.rb +15 -10
- data/lib/sendgrid4r/rest/transactional_templates/templates.rb +12 -4
- data/lib/sendgrid4r/rest/transactional_templates/versions.rb +4 -4
- data/lib/sendgrid4r/rest/users.rb +9 -9
- data/lib/sendgrid4r/rest/webhooks/event.rb +2 -2
- data/lib/sendgrid4r/rest/webhooks/parse.rb +1 -1
- data/lib/sendgrid4r/rest/whitelabel/domains.rb +10 -11
- data/lib/sendgrid4r/rest/whitelabel/ips.rb +4 -4
- data/lib/sendgrid4r/rest/whitelabel/links.rb +8 -8
- data/lib/sendgrid4r/version.rb +1 -1
- data/lib/sendgrid4r.rb +57 -0
- data/sendgrid4r.gemspec +3 -1
- data/spec/cli/api_keys/api_key_spec.rb +77 -0
- data/spec/cli/api_keys/permission_spec.rb +29 -0
- data/spec/cli/campaign/campaign_spec.rb +136 -0
- data/spec/cli/campaign/contact/custom_field_spec.rb +48 -0
- data/spec/cli/campaign/contact/list_spec.rb +88 -0
- data/spec/cli/campaign/contact/recipient_spec.rb +93 -0
- data/spec/cli/campaign/contact/reserved_field_spec.rb +20 -0
- data/spec/cli/campaign/contact/segment_spec.rb +93 -0
- data/spec/cli/campaign/sender_spec.rb +83 -0
- data/spec/cli/cancel_schedules/batch_id_spec.rb +33 -0
- data/spec/cli/cancel_schedules/cancel_schedule_spec.rb +69 -0
- data/spec/cli/category_spec.rb +23 -0
- data/spec/cli/ipam/activity_spec.rb +21 -0
- data/spec/cli/ipam/ipam_spec.rb +26 -0
- data/spec/cli/ipam/whitelist_spec.rb +47 -0
- data/spec/cli/ips/address_spec.rb +57 -0
- data/spec/cli/ips/ip_spec.rb +33 -0
- data/spec/cli/ips/pool_spec.rb +57 -0
- data/spec/cli/ips/warmup_spec.rb +47 -0
- data/spec/cli/mail_spec.rb +37 -0
- data/spec/cli/settings/enforced_tls_spec.rb +30 -0
- data/spec/cli/settings/mail_spec.rb +255 -0
- data/spec/cli/settings/partner_spec.rb +47 -0
- data/spec/cli/settings/settings_spec.rb +40 -0
- data/spec/cli/settings/tracking_spec.rb +128 -0
- data/spec/cli/sg_spec.rb +82 -0
- data/spec/cli/stats/advanced_spec.rb +137 -0
- data/spec/cli/stats/category_spec.rb +57 -0
- data/spec/cli/stats/global_spec.rb +32 -0
- data/spec/cli/stats/parse_spec.rb +32 -0
- data/spec/cli/stats/stats_spec.rb +40 -0
- data/spec/cli/stats/subuser_spec.rb +104 -0
- data/spec/cli/subusers/monitor_spec.rb +52 -0
- data/spec/cli/subusers/subuser_spec.rb +88 -0
- data/spec/cli/suppressions/block_spec.rb +60 -0
- data/spec/cli/suppressions/bounce_spec.rb +58 -0
- data/spec/cli/suppressions/global_unsubscribe_spec.rb +59 -0
- data/spec/cli/suppressions/group_spec.rb +69 -0
- data/spec/cli/suppressions/group_unsubscribe_spec.rb +41 -0
- data/spec/cli/suppressions/invalid_email_spec.rb +60 -0
- data/spec/cli/suppressions/spam_report_spec.rb +60 -0
- data/spec/cli/suppressions/suppression_spec.rb +68 -0
- data/spec/cli/templates/template_spec.rb +65 -0
- data/spec/cli/templates/version_spec.rb +71 -0
- data/spec/cli/user_spec.rb +82 -0
- data/spec/cli/webhooks/event_spec.rb +67 -0
- data/spec/cli/webhooks/parse_spec.rb +20 -0
- data/spec/cli/webhooks/webhook_spec.rb +28 -0
- data/spec/cli/whitelabel/domain_spec.rb +112 -0
- data/spec/cli/whitelabel/ip_spec.rb +61 -0
- data/spec/cli/whitelabel/link_spec.rb +110 -0
- data/spec/cli/whitelabel/whitelabel_spec.rb +27 -0
- data/spec/client_spec.rb +1 -1
- data/spec/factory/campaign_factory_spec.rb +2 -2
- data/spec/factory/event_factory_spec.rb +36 -0
- data/spec/rest/api_keys_management/api_keys_spec.rb +24 -24
- data/spec/rest/api_keys_management/permissions_spec.rb +8 -10
- data/spec/rest/blocks_spec.rb +14 -18
- data/spec/rest/bounces_spec.rb +28 -32
- data/spec/rest/cancel_scheduled_sends_spec.rb +15 -19
- data/spec/rest/categories_spec.rb +8 -10
- data/spec/rest/email_activity_spec.rb +18 -22
- data/spec/rest/invalid_emails_spec.rb +19 -23
- data/spec/rest/ip_access_management_spec.rb +46 -52
- data/spec/rest/ips/addresses_spec.rb +21 -25
- data/spec/rest/ips/pools_spec.rb +20 -24
- data/spec/rest/ips/warmup_spec.rb +11 -15
- data/spec/rest/marketing_campaigns/contacts/custom_fields_spec.rb +26 -30
- data/spec/rest/marketing_campaigns/contacts/lists_spec.rb +58 -66
- data/spec/rest/marketing_campaigns/contacts/recipients_spec.rb +77 -87
- data/spec/rest/marketing_campaigns/contacts/reserved_fields_spec.rb +46 -50
- data/spec/rest/marketing_campaigns/contacts/segments_spec.rb +75 -78
- data/spec/rest/marketing_campaigns/marketing_campaigns_spec.rb +92 -94
- data/spec/rest/marketing_campaigns/senders_spec.rb +51 -51
- data/spec/rest/settings/enforced_tls_spec.rb +5 -7
- data/spec/rest/settings/mail_spec.rb +89 -60
- data/spec/rest/settings/partner_spec.rb +5 -7
- data/spec/rest/settings/settings_spec.rb +18 -22
- data/spec/rest/settings/tracking_spec.rb +26 -34
- data/spec/rest/sm/global_unsubscribes_spec.rb +9 -13
- data/spec/rest/sm/groups_spec.rb +24 -28
- data/spec/rest/sm/sm_spec.rb +15 -15
- data/spec/rest/sm/suppressions_spec.rb +34 -44
- data/spec/rest/spam_reports_spec.rb +19 -23
- data/spec/rest/stats/advanced_spec.rb +4 -4
- data/spec/rest/stats/global_spec.rb +0 -21
- data/spec/rest/subusers_spec.rb +38 -47
- data/spec/rest/transactional_templates/templates_spec.rb +29 -33
- data/spec/rest/transactional_templates/versions_spec.rb +11 -93
- data/spec/rest/users_spec.rb +42 -54
- data/spec/rest/webhooks/event_spec.rb +16 -18
- data/spec/rest/webhooks/parse_spec.rb +16 -20
- data/spec/rest/whitelabel/domains_spec.rb +93 -100
- data/spec/rest/whitelabel/ips_spec.rb +28 -32
- data/spec/rest/whitelabel/links_spec.rb +41 -45
- metadata +181 -4
|
@@ -17,7 +17,7 @@ module SendGrid4r::REST
|
|
|
17
17
|
categories: categories
|
|
18
18
|
}
|
|
19
19
|
resp = get(@auth, "#{BASE_URL}/categories/stats", params, &block)
|
|
20
|
-
Stats.create_top_stats(
|
|
20
|
+
finish(resp, @raw_resp) { |r| Stats.create_top_stats(r) }
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def get_categories_stats_sums(
|
|
@@ -32,7 +32,7 @@ module SendGrid4r::REST
|
|
|
32
32
|
offset: offset
|
|
33
33
|
}
|
|
34
34
|
resp = get(@auth, "#{BASE_URL}/categories/stats/sums", params, &block)
|
|
35
|
-
Stats.create_top_stat(
|
|
35
|
+
finish(resp, @raw_resp) { |r| Stats.create_top_stat(r) }
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
end
|
|
@@ -28,7 +28,7 @@ module SendGrid4r::REST
|
|
|
28
28
|
subusers: subusers
|
|
29
29
|
}
|
|
30
30
|
resp = get(@auth, Subuser.url, params, &block)
|
|
31
|
-
Stats.create_top_stats(
|
|
31
|
+
finish(resp, @raw_resp) { |r| Stats.create_top_stats(r) }
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def get_subusers_stats_sums(
|
|
@@ -43,7 +43,7 @@ module SendGrid4r::REST
|
|
|
43
43
|
offset: offset
|
|
44
44
|
}
|
|
45
45
|
resp = get(@auth, Subuser.url(nil, :sums), params, &block)
|
|
46
|
-
Stats.create_top_stat(
|
|
46
|
+
finish(resp, @raw_resp) { |r| Stats.create_top_stat(r) }
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def get_subusers_stats_monthly(
|
|
@@ -58,7 +58,7 @@ module SendGrid4r::REST
|
|
|
58
58
|
offset: offset
|
|
59
59
|
}
|
|
60
60
|
resp = get(@auth, Subuser.url(nil, :monthly), params, &block)
|
|
61
|
-
Stats.create_top_stat(
|
|
61
|
+
finish(resp, @raw_resp) { |r| Stats.create_top_stat(r) }
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
def get_subuser_stats_monthly(
|
|
@@ -72,7 +72,7 @@ module SendGrid4r::REST
|
|
|
72
72
|
offset: offset
|
|
73
73
|
}
|
|
74
74
|
resp = get(@auth, Subuser.url(subuser_name, :monthly), params, &block)
|
|
75
|
-
Stats.create_top_stat(
|
|
75
|
+
finish(resp, @raw_resp) { |r| Stats.create_top_stat(r) }
|
|
76
76
|
end
|
|
77
77
|
end
|
|
78
78
|
end
|
|
@@ -52,7 +52,8 @@ module SendGrid4r::REST
|
|
|
52
52
|
params[:limit] = limit unless limit.nil?
|
|
53
53
|
params[:offset] = offset unless offset.nil?
|
|
54
54
|
params[:username] = username unless username.nil?
|
|
55
|
-
|
|
55
|
+
resp = get(@auth, Subusers.url, params, &block)
|
|
56
|
+
finish(resp, @raw_resp) { |r| Subusers.create_subusers(r) }
|
|
56
57
|
end
|
|
57
58
|
|
|
58
59
|
def post_subuser(username:, email:, password:, ips:, &block)
|
|
@@ -62,35 +63,38 @@ module SendGrid4r::REST
|
|
|
62
63
|
password: password,
|
|
63
64
|
ips: ips
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
+
resp = post(@auth, Subusers.url, params, &block)
|
|
67
|
+
finish(resp, @raw_resp) { |r| Subusers.create_subuser(r) }
|
|
66
68
|
end
|
|
67
69
|
|
|
68
70
|
def patch_subuser(username:, disabled:, &block)
|
|
69
71
|
payload = { disabled: disabled }
|
|
70
72
|
resp = patch(@auth, Subusers.url(username), payload, &block)
|
|
71
|
-
Subusers.create_subuser(
|
|
73
|
+
finish(resp, @raw_resp) { |r| Subusers.create_subuser(r) }
|
|
72
74
|
end
|
|
73
75
|
|
|
74
76
|
def delete_subuser(username:, &block)
|
|
75
77
|
delete(@auth, Subusers.url(username), &block)
|
|
76
78
|
end
|
|
77
79
|
|
|
78
|
-
def get_subuser_monitor(username:,
|
|
80
|
+
def get_subuser_monitor(username:, &block)
|
|
79
81
|
endpoint = Subusers.url_monitor(username)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
resp = get(@auth, endpoint, nil, &block)
|
|
83
|
+
finish(resp, @raw_resp) { |r| Subusers.create_monitor(r) }
|
|
82
84
|
end
|
|
83
85
|
|
|
84
86
|
def post_subuser_monitor(username:, email:, frequency:, &block)
|
|
85
87
|
endpoint = Subusers.url_monitor(username)
|
|
86
88
|
payload = { email: email, frequency: frequency }
|
|
87
|
-
|
|
89
|
+
resp = post(@auth, endpoint, payload, &block)
|
|
90
|
+
finish(resp, @raw_resp) { |r| Subusers.create_monitor(r) }
|
|
88
91
|
end
|
|
89
92
|
|
|
90
93
|
def put_subuser_monitor(username:, email:, frequency:, &block)
|
|
91
94
|
endpoint = Subusers.url_monitor(username)
|
|
92
95
|
payload = { email: email, frequency: frequency }
|
|
93
|
-
|
|
96
|
+
resp = put(@auth, endpoint, payload, &block)
|
|
97
|
+
finish(resp, @raw_resp) { |r| Subusers.create_monitor(r) }
|
|
94
98
|
end
|
|
95
99
|
|
|
96
100
|
def delete_subuser_monitor(username:, &block)
|
|
@@ -101,12 +105,13 @@ module SendGrid4r::REST
|
|
|
101
105
|
params = ''
|
|
102
106
|
usernames.each { |username| params += "usernames=#{username}&" }
|
|
103
107
|
endpoint = "#{Subusers.url}/reputations?#{params}"
|
|
104
|
-
|
|
108
|
+
resp = get(@auth, endpoint, usernames, &block)
|
|
109
|
+
finish(resp, @raw_resp) { |r| Subusers.create_subusers(r) }
|
|
105
110
|
end
|
|
106
111
|
|
|
107
112
|
def put_subuser_assigned_ips(username:, ips:, &block)
|
|
108
113
|
resp = put(@auth, "#{Subusers.url(username)}/ips", ips, &block)
|
|
109
|
-
Subusers.create_subuser(
|
|
114
|
+
finish(resp, @raw_resp) { |r| Subusers.create_subuser(r) }
|
|
110
115
|
end
|
|
111
116
|
end
|
|
112
117
|
end
|
|
@@ -35,24 +35,32 @@ module SendGrid4r::REST
|
|
|
35
35
|
def post_template(name:, &block)
|
|
36
36
|
endpoint = TransactionalTemplates.url
|
|
37
37
|
resp = post(@auth, endpoint, name: name, &block)
|
|
38
|
-
|
|
38
|
+
finish(resp, @raw_resp) do |r|
|
|
39
|
+
TransactionalTemplates.create_template(r)
|
|
40
|
+
end
|
|
39
41
|
end
|
|
40
42
|
|
|
41
43
|
def get_templates(&block)
|
|
42
44
|
resp = get(@auth, TransactionalTemplates.url, &block)
|
|
43
|
-
|
|
45
|
+
finish(resp, @raw_resp) do |r|
|
|
46
|
+
TransactionalTemplates.create_templates(r)
|
|
47
|
+
end
|
|
44
48
|
end
|
|
45
49
|
|
|
46
50
|
def get_template(template_id:, &block)
|
|
47
51
|
endpoint = TransactionalTemplates.url(template_id)
|
|
48
52
|
resp = get(@auth, endpoint, &block)
|
|
49
|
-
|
|
53
|
+
finish(resp, @raw_resp) do |r|
|
|
54
|
+
TransactionalTemplates.create_template(r)
|
|
55
|
+
end
|
|
50
56
|
end
|
|
51
57
|
|
|
52
58
|
def patch_template(template_id:, name:, &block)
|
|
53
59
|
endpoint = TransactionalTemplates.url(template_id)
|
|
54
60
|
resp = patch(@auth, endpoint, name: name, &block)
|
|
55
|
-
|
|
61
|
+
finish(resp, @raw_resp) do |r|
|
|
62
|
+
TransactionalTemplates.create_template(r)
|
|
63
|
+
end
|
|
56
64
|
end
|
|
57
65
|
|
|
58
66
|
def delete_template(template_id:, &block)
|
|
@@ -42,13 +42,13 @@ module SendGrid4r::REST
|
|
|
42
42
|
remove_uneditable_keys(version.to_h),
|
|
43
43
|
&block
|
|
44
44
|
)
|
|
45
|
-
Versions.create_version(
|
|
45
|
+
finish(resp, @raw_resp) { |r| Versions.create_version(r) }
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def activate_version(template_id:, version_id:, &block)
|
|
49
49
|
url = Versions.url(template_id, version_id)
|
|
50
50
|
resp = post(@auth, "#{url}/activate", &block)
|
|
51
|
-
Versions.create_version(
|
|
51
|
+
finish(resp, @raw_resp) { |r| Versions.create_version(r) }
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def get_version(template_id:, version_id:, &block)
|
|
@@ -57,7 +57,7 @@ module SendGrid4r::REST
|
|
|
57
57
|
Versions.url(template_id, version_id),
|
|
58
58
|
&block
|
|
59
59
|
)
|
|
60
|
-
Versions.create_version(
|
|
60
|
+
finish(resp, @raw_resp) { |r| Versions.create_version(r) }
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
def patch_version(template_id:, version_id:, version:, &block)
|
|
@@ -67,7 +67,7 @@ module SendGrid4r::REST
|
|
|
67
67
|
remove_uneditable_keys(version.to_h),
|
|
68
68
|
&block
|
|
69
69
|
)
|
|
70
|
-
Versions.create_version(
|
|
70
|
+
finish(resp, @raw_resp) { |r| Versions.create_version(r) }
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
def delete_version(template_id:, version_id:, &block)
|
|
@@ -80,44 +80,44 @@ module SendGrid4r::REST
|
|
|
80
80
|
|
|
81
81
|
def get_user_profile(&block)
|
|
82
82
|
resp = get(@auth, Users.url(:profile), nil, &block)
|
|
83
|
-
Users.create_profile(
|
|
83
|
+
finish(resp, @raw_resp) { |r| Users.create_profile(r) }
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
def patch_user_profile(params:, &block)
|
|
87
87
|
resp = patch(@auth, Users.url(:profile), params, &block)
|
|
88
|
-
Users.create_profile(
|
|
88
|
+
finish(resp, @raw_resp) { |r| Users.create_profile(r) }
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
def get_user_account(&block)
|
|
92
92
|
resp = get(@auth, Users.url(:account), nil, &block)
|
|
93
|
-
Users.create_account(
|
|
93
|
+
finish(resp, @raw_resp) { |r| Users.create_account(r) }
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
def get_user_email(&block)
|
|
97
97
|
resp = get(@auth, Users.url(:email), nil, &block)
|
|
98
|
-
Users.create_email(
|
|
98
|
+
finish(resp, @raw_resp) { |r| Users.create_email(r) }
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
def put_user_email(email:, &block)
|
|
102
102
|
params = { email: email }
|
|
103
103
|
resp = put(@auth, Users.url(:email), params, &block)
|
|
104
|
-
Users.create_email(
|
|
104
|
+
finish(resp, @raw_resp) { |r| Users.create_email(r) }
|
|
105
105
|
end
|
|
106
106
|
|
|
107
107
|
def get_user_username(&block)
|
|
108
108
|
resp = get(@auth, Users.url(:username), nil, &block)
|
|
109
|
-
Users.create_username(
|
|
109
|
+
finish(resp, @raw_resp) { |r| Users.create_username(r) }
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
def put_user_username(username:, &block)
|
|
113
113
|
params = { username: username }
|
|
114
114
|
resp = put(@auth, Users.url(:username), params, &block)
|
|
115
|
-
Users.create_username(
|
|
115
|
+
finish(resp, @raw_resp) { |r| Users.create_username(r) }
|
|
116
116
|
end
|
|
117
117
|
|
|
118
118
|
def get_user_credits(&block)
|
|
119
119
|
resp = get(@auth, Users.url(:credits), &block)
|
|
120
|
-
Users.create_credits(
|
|
120
|
+
finish(resp, @raw_resp) { |r| Users.create_credits(r) }
|
|
121
121
|
end
|
|
122
122
|
|
|
123
123
|
def put_user_password(new_password:, old_password:, &block)
|
|
@@ -126,7 +126,7 @@ module SendGrid4r::REST
|
|
|
126
126
|
old_password: old_password
|
|
127
127
|
}
|
|
128
128
|
resp = put(@auth, Users.url(:password), params, &block)
|
|
129
|
-
Users.create_password(
|
|
129
|
+
finish(resp, @raw_resp) { |r| Users.create_password(r) }
|
|
130
130
|
end
|
|
131
131
|
end
|
|
132
132
|
end
|
|
@@ -33,12 +33,12 @@ module SendGrid4r::REST
|
|
|
33
33
|
|
|
34
34
|
def get_settings_event_notification(&block)
|
|
35
35
|
resp = get(@auth, Event.url_event(:settings), &block)
|
|
36
|
-
Event.create_event_notification(
|
|
36
|
+
finish(resp, @raw_resp) { |r| Event.create_event_notification(r) }
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def patch_settings_event_notification(params:, &block)
|
|
40
40
|
resp = patch(@auth, Event.url_event(:settings), params.to_h, &block)
|
|
41
|
-
Event.create_event_notification(
|
|
41
|
+
finish(resp, @raw_resp) { |r| Event.create_event_notification(r) }
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def test_settings_event_notification(url:, &block)
|
|
@@ -120,7 +120,7 @@ module SendGrid4r::REST
|
|
|
120
120
|
params[:username] = username unless username.nil?
|
|
121
121
|
params[:domain] = domain unless domain.nil?
|
|
122
122
|
resp = get(@auth, Domains.url, params, &block)
|
|
123
|
-
Domains.create_domains(
|
|
123
|
+
finish(resp, @raw_resp) { |r| Domains.create_domains(r) }
|
|
124
124
|
end
|
|
125
125
|
|
|
126
126
|
def post_wl_domain(
|
|
@@ -139,12 +139,12 @@ module SendGrid4r::REST
|
|
|
139
139
|
params[:custom_spf] = custom_spf unless custom_spf.nil?
|
|
140
140
|
params[:default] = default unless default.nil?
|
|
141
141
|
resp = post(@auth, Domains.url, params, &block)
|
|
142
|
-
Domains.create_domain(
|
|
142
|
+
finish(resp, @raw_resp) { |r| Domains.create_domain(r) }
|
|
143
143
|
end
|
|
144
144
|
|
|
145
145
|
def get_wl_domain(id:, &block)
|
|
146
146
|
resp = get(@auth, Domains.url(id), nil, &block)
|
|
147
|
-
Domains.create_domain(
|
|
147
|
+
finish(resp, @raw_resp) { |r| Domains.create_domain(r) }
|
|
148
148
|
end
|
|
149
149
|
|
|
150
150
|
def patch_wl_domain(id:, custom_spf: nil, default: nil, &block)
|
|
@@ -152,7 +152,7 @@ module SendGrid4r::REST
|
|
|
152
152
|
params[:custom_spf] = custom_spf unless custom_spf.nil?
|
|
153
153
|
params[:default] = default unless default.nil?
|
|
154
154
|
resp = patch(@auth, Domains.url(id), params, &block)
|
|
155
|
-
Domains.create_domain(
|
|
155
|
+
finish(resp, @raw_resp) { |r| Domains.create_domain(r) }
|
|
156
156
|
end
|
|
157
157
|
|
|
158
158
|
def delete_wl_domain(id:, &block)
|
|
@@ -163,29 +163,28 @@ module SendGrid4r::REST
|
|
|
163
163
|
params = {}
|
|
164
164
|
params[:domain] = domain unless domain.nil?
|
|
165
165
|
resp = get(@auth, "#{Domains.url}/default", params, &block)
|
|
166
|
-
Domains.create_domain(
|
|
166
|
+
finish(resp, @raw_resp) { |r| Domains.create_domain(r) }
|
|
167
167
|
end
|
|
168
168
|
|
|
169
169
|
def add_ip_to_wl_domain(id:, ip:, &block)
|
|
170
170
|
params = { ip: ip }
|
|
171
171
|
resp = post(@auth, "#{Domains.url(id)}/ips", params, &block)
|
|
172
|
-
Domains.create_domain(
|
|
172
|
+
finish(resp, @raw_resp) { |r| Domains.create_domain(r) }
|
|
173
173
|
end
|
|
174
174
|
|
|
175
175
|
def remove_ip_from_wl_domain(id:, ip:, &block)
|
|
176
|
-
|
|
177
|
-
Domains.create_domain(resp)
|
|
176
|
+
delete(@auth, Domains.url(id, ip), &block)
|
|
178
177
|
end
|
|
179
178
|
|
|
180
179
|
def validate_wl_domain(id:, &block)
|
|
181
180
|
resp = post(@auth, "#{Domains.url(id)}/validate", &block)
|
|
182
|
-
Domains.create_result(
|
|
181
|
+
finish(resp, @raw_resp) { |r| Domains.create_result(r) }
|
|
183
182
|
end
|
|
184
183
|
|
|
185
184
|
def get_associated_wl_domain(username:, &block)
|
|
186
185
|
params = { username: username }
|
|
187
186
|
resp = get(@auth, "#{Domains.url}/subuser", params, &block)
|
|
188
|
-
Domains.create_domain(
|
|
187
|
+
finish(resp, @raw_resp) { |r| Domains.create_domain(r) }
|
|
189
188
|
end
|
|
190
189
|
|
|
191
190
|
def disassociate_wl_domain(username:, &block)
|
|
@@ -197,7 +196,7 @@ module SendGrid4r::REST
|
|
|
197
196
|
endpoint = "#{Domains.url(id)}/subuser"
|
|
198
197
|
params = { username: username }
|
|
199
198
|
resp = post(@auth, endpoint, params, &block)
|
|
200
|
-
Domains.create_domain(
|
|
199
|
+
finish(resp, @raw_resp) { |r| Domains.create_domain(r) }
|
|
201
200
|
end
|
|
202
201
|
end
|
|
203
202
|
end
|
|
@@ -85,7 +85,7 @@ module SendGrid4r::REST
|
|
|
85
85
|
params[:limit] = limit unless limit.nil?
|
|
86
86
|
params[:offset] = offset unless offset.nil?
|
|
87
87
|
resp = get(@auth, Ips.url, params, &block)
|
|
88
|
-
Ips.create_ips(
|
|
88
|
+
finish(resp, @raw_resp) { |r| Ips.create_ips(r) }
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
def post_wl_ip(ip:, subdomain:, domain:, &block)
|
|
@@ -95,12 +95,12 @@ module SendGrid4r::REST
|
|
|
95
95
|
domain: domain
|
|
96
96
|
}
|
|
97
97
|
resp = post(@auth, Ips.url, params, &block)
|
|
98
|
-
Ips.create_ip(
|
|
98
|
+
finish(resp, @raw_resp) { |r| Ips.create_ip(r) }
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
def get_wl_ip(id:, &block)
|
|
102
102
|
resp = get(@auth, Ips.url(id), nil, &block)
|
|
103
|
-
Ips.create_ip(
|
|
103
|
+
finish(resp, @raw_resp) { |r| Ips.create_ip(r) }
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
def delete_wl_ip(id:, &block)
|
|
@@ -109,7 +109,7 @@ module SendGrid4r::REST
|
|
|
109
109
|
|
|
110
110
|
def validate_wl_ip(id:, &block)
|
|
111
111
|
resp = post(@auth, "#{Ips.url(id)}/validate", &block)
|
|
112
|
-
Ips.create_result(
|
|
112
|
+
finish(resp, @raw_resp) { |r| Ips.create_result(r) }
|
|
113
113
|
end
|
|
114
114
|
end
|
|
115
115
|
end
|
|
@@ -96,7 +96,7 @@ module SendGrid4r::REST
|
|
|
96
96
|
params[:username] = username unless username.nil?
|
|
97
97
|
params[:domain] = domain unless domain.nil?
|
|
98
98
|
resp = get(@auth, Links.url, params, &block)
|
|
99
|
-
Links.create_links(
|
|
99
|
+
finish(resp, @raw_resp) { |r| Links.create_links(r) }
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
def post_wl_link(subdomain:, domain:, default: nil, &block)
|
|
@@ -106,18 +106,18 @@ module SendGrid4r::REST
|
|
|
106
106
|
}
|
|
107
107
|
params[:default] = default unless default.nil?
|
|
108
108
|
resp = post(@auth, Links.url, params, &block)
|
|
109
|
-
Links.create_link(
|
|
109
|
+
finish(resp, @raw_resp) { |r| Links.create_link(r) }
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
def get_wl_link(id:, &block)
|
|
113
113
|
resp = get(@auth, Links.url(id), nil, &block)
|
|
114
|
-
Links.create_link(
|
|
114
|
+
finish(resp, @raw_resp) { |r| Links.create_link(r) }
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
def patch_wl_link(id:, default:, &block)
|
|
118
118
|
params = { default: default }
|
|
119
119
|
resp = patch(@auth, Links.url(id), params, &block)
|
|
120
|
-
Links.create_link(
|
|
120
|
+
finish(resp, @raw_resp) { |r| Links.create_link(r) }
|
|
121
121
|
end
|
|
122
122
|
|
|
123
123
|
def delete_wl_link(id:, &block)
|
|
@@ -128,18 +128,18 @@ module SendGrid4r::REST
|
|
|
128
128
|
params = {}
|
|
129
129
|
params[:domain] = domain unless domain.nil?
|
|
130
130
|
resp = get(@auth, "#{Links.url}/default", params, &block)
|
|
131
|
-
Links.create_link(
|
|
131
|
+
finish(resp, @raw_resp) { |r| Links.create_link(r) }
|
|
132
132
|
end
|
|
133
133
|
|
|
134
134
|
def validate_wl_link(id:, &block)
|
|
135
135
|
resp = post(@auth, "#{Links.url(id)}/validate", &block)
|
|
136
|
-
Links.create_result(
|
|
136
|
+
finish(resp, @raw_resp) { |r| Links.create_result(r) }
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
def get_associated_wl_link(username:, &block)
|
|
140
140
|
params = { username: username }
|
|
141
141
|
resp = get(@auth, "#{Links.url}/subuser", params, &block)
|
|
142
|
-
Links.create_link(
|
|
142
|
+
finish(resp, @raw_resp) { |r| Links.create_link(r) }
|
|
143
143
|
end
|
|
144
144
|
|
|
145
145
|
def disassociate_wl_link(username:, &block)
|
|
@@ -150,7 +150,7 @@ module SendGrid4r::REST
|
|
|
150
150
|
def associate_wl_link(id:, username:, &block)
|
|
151
151
|
params = { username: username }
|
|
152
152
|
resp = post(@auth, "#{Links.url(id)}/subuser", params, &block)
|
|
153
|
-
Links.create_link(
|
|
153
|
+
finish(resp, @raw_resp) { |r| Links.create_link(r) }
|
|
154
154
|
end
|
|
155
155
|
end
|
|
156
156
|
end
|