sendgrid4r 1.13.0 → 1.14.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/README.md +0 -1
- data/lib/sendgrid4r/version.rb +1 -1
- data/lib/sendgrid4r.rb +0 -58
- data/sendgrid4r.gemspec +0 -3
- data/spec/client_spec.rb +1 -1
- metadata +5 -183
- data/exe/sg +0 -5
- data/lib/sendgrid4r/cli/alert.rb +0 -51
- data/lib/sendgrid4r/cli/api_keys/api_key.rb +0 -53
- data/lib/sendgrid4r/cli/api_keys/permission.rb +0 -15
- data/lib/sendgrid4r/cli/campaign/campaign.rb +0 -134
- data/lib/sendgrid4r/cli/campaign/contact/contact.rb +0 -25
- data/lib/sendgrid4r/cli/campaign/contact/custom_field.rb +0 -42
- data/lib/sendgrid4r/cli/campaign/contact/list.rb +0 -71
- data/lib/sendgrid4r/cli/campaign/contact/recipient.rb +0 -78
- data/lib/sendgrid4r/cli/campaign/contact/reserved_field.rb +0 -17
- data/lib/sendgrid4r/cli/campaign/contact/segment.rb +0 -105
- data/lib/sendgrid4r/cli/campaign/sender.rb +0 -83
- data/lib/sendgrid4r/cli/cancel_schedules/batch_id.rb +0 -23
- data/lib/sendgrid4r/cli/cancel_schedules/cancel_schedule.rb +0 -55
- data/lib/sendgrid4r/cli/category.rb +0 -16
- data/lib/sendgrid4r/cli/ipam/activity.rb +0 -16
- data/lib/sendgrid4r/cli/ipam/ipam.rb +0 -14
- data/lib/sendgrid4r/cli/ipam/whitelist.rb +0 -39
- data/lib/sendgrid4r/cli/ips/address.rb +0 -48
- data/lib/sendgrid4r/cli/ips/ip.rb +0 -17
- data/lib/sendgrid4r/cli/ips/pool.rb +0 -48
- data/lib/sendgrid4r/cli/ips/warmup.rb +0 -39
- data/lib/sendgrid4r/cli/mail.rb +0 -34
- data/lib/sendgrid4r/cli/settings/enforced_tls.rb +0 -24
- data/lib/sendgrid4r/cli/settings/mail.rb +0 -195
- data/lib/sendgrid4r/cli/settings/partner.rb +0 -37
- data/lib/sendgrid4r/cli/settings/settings.rb +0 -20
- data/lib/sendgrid4r/cli/settings/tracking.rb +0 -101
- data/lib/sendgrid4r/cli/sg.rb +0 -61
- data/lib/sendgrid4r/cli/sg_thor.rb +0 -50
- data/lib/sendgrid4r/cli/stats/advanced.rb +0 -74
- data/lib/sendgrid4r/cli/stats/category.rb +0 -35
- data/lib/sendgrid4r/cli/stats/global.rb +0 -18
- data/lib/sendgrid4r/cli/stats/parse.rb +0 -18
- data/lib/sendgrid4r/cli/stats/stats.rb +0 -23
- data/lib/sendgrid4r/cli/stats/subuser.rb +0 -67
- data/lib/sendgrid4r/cli/subusers/monitor.rb +0 -44
- data/lib/sendgrid4r/cli/subusers/subuser.rb +0 -77
- data/lib/sendgrid4r/cli/suppressions/block.rb +0 -43
- data/lib/sendgrid4r/cli/suppressions/bounce.rb +0 -41
- data/lib/sendgrid4r/cli/suppressions/global_unsubscribe.rb +0 -43
- data/lib/sendgrid4r/cli/suppressions/group.rb +0 -61
- data/lib/sendgrid4r/cli/suppressions/group_unsubscribe.rb +0 -43
- data/lib/sendgrid4r/cli/suppressions/invalid_email.rb +0 -43
- data/lib/sendgrid4r/cli/suppressions/spam_report.rb +0 -43
- data/lib/sendgrid4r/cli/suppressions/suppression.rb +0 -36
- data/lib/sendgrid4r/cli/templates/template.rb +0 -51
- data/lib/sendgrid4r/cli/templates/version.rb +0 -78
- data/lib/sendgrid4r/cli/user.rb +0 -86
- data/lib/sendgrid4r/cli/webhooks/event.rb +0 -53
- data/lib/sendgrid4r/cli/webhooks/parse.rb +0 -55
- data/lib/sendgrid4r/cli/webhooks/webhook.rb +0 -14
- data/lib/sendgrid4r/cli/whitelabel/domain.rb +0 -117
- data/lib/sendgrid4r/cli/whitelabel/ip.rb +0 -52
- data/lib/sendgrid4r/cli/whitelabel/link.rb +0 -96
- data/lib/sendgrid4r/cli/whitelabel/whitelabel.rb +0 -17
- data/spec/cli/alert_spec.rb +0 -71
- data/spec/cli/api_keys/api_key_spec.rb +0 -77
- data/spec/cli/api_keys/permission_spec.rb +0 -29
- data/spec/cli/campaign/campaign_spec.rb +0 -136
- data/spec/cli/campaign/contact/custom_field_spec.rb +0 -48
- data/spec/cli/campaign/contact/list_spec.rb +0 -88
- data/spec/cli/campaign/contact/recipient_spec.rb +0 -93
- data/spec/cli/campaign/contact/reserved_field_spec.rb +0 -20
- data/spec/cli/campaign/contact/segment_spec.rb +0 -93
- data/spec/cli/campaign/sender_spec.rb +0 -83
- data/spec/cli/cancel_schedules/batch_id_spec.rb +0 -33
- data/spec/cli/cancel_schedules/cancel_schedule_spec.rb +0 -69
- data/spec/cli/category_spec.rb +0 -23
- data/spec/cli/ipam/activity_spec.rb +0 -21
- data/spec/cli/ipam/ipam_spec.rb +0 -26
- data/spec/cli/ipam/whitelist_spec.rb +0 -47
- data/spec/cli/ips/address_spec.rb +0 -57
- data/spec/cli/ips/ip_spec.rb +0 -33
- data/spec/cli/ips/pool_spec.rb +0 -57
- data/spec/cli/ips/warmup_spec.rb +0 -47
- data/spec/cli/mail_spec.rb +0 -37
- data/spec/cli/settings/enforced_tls_spec.rb +0 -30
- data/spec/cli/settings/mail_spec.rb +0 -255
- data/spec/cli/settings/partner_spec.rb +0 -47
- data/spec/cli/settings/settings_spec.rb +0 -40
- data/spec/cli/settings/tracking_spec.rb +0 -128
- data/spec/cli/sg_spec.rb +0 -87
- data/spec/cli/stats/advanced_spec.rb +0 -137
- data/spec/cli/stats/category_spec.rb +0 -57
- data/spec/cli/stats/global_spec.rb +0 -32
- data/spec/cli/stats/parse_spec.rb +0 -32
- data/spec/cli/stats/stats_spec.rb +0 -40
- data/spec/cli/stats/subuser_spec.rb +0 -104
- data/spec/cli/subusers/monitor_spec.rb +0 -52
- data/spec/cli/subusers/subuser_spec.rb +0 -88
- data/spec/cli/suppressions/block_spec.rb +0 -60
- data/spec/cli/suppressions/bounce_spec.rb +0 -58
- data/spec/cli/suppressions/global_unsubscribe_spec.rb +0 -59
- data/spec/cli/suppressions/group_spec.rb +0 -78
- data/spec/cli/suppressions/group_unsubscribe_spec.rb +0 -51
- data/spec/cli/suppressions/invalid_email_spec.rb +0 -60
- data/spec/cli/suppressions/spam_report_spec.rb +0 -60
- data/spec/cli/suppressions/suppression_spec.rb +0 -68
- data/spec/cli/templates/template_spec.rb +0 -65
- data/spec/cli/templates/version_spec.rb +0 -71
- data/spec/cli/user_spec.rb +0 -82
- data/spec/cli/webhooks/event_spec.rb +0 -67
- data/spec/cli/webhooks/parse_spec.rb +0 -72
- data/spec/cli/webhooks/webhook_spec.rb +0 -28
- data/spec/cli/whitelabel/domain_spec.rb +0 -112
- data/spec/cli/whitelabel/ip_spec.rb +0 -61
- data/spec/cli/whitelabel/link_spec.rb +0 -110
- data/spec/cli/whitelabel/whitelabel_spec.rb +0 -27
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
|
3
|
-
|
|
4
|
-
module SendGrid4r::CLI::ApiKeys
|
|
5
|
-
describe ApiKey do
|
|
6
|
-
describe 'integration test', :it do
|
|
7
|
-
before do
|
|
8
|
-
Dotenv.load
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it '#list' do
|
|
12
|
-
args = [
|
|
13
|
-
'list',
|
|
14
|
-
'--api-key', ENV['SILVER_API_KEY']
|
|
15
|
-
]
|
|
16
|
-
ApiKey.start(args)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it '#create with scope' do
|
|
20
|
-
args = [
|
|
21
|
-
'create',
|
|
22
|
-
'--api-key', ENV['SILVER_API_KEY'],
|
|
23
|
-
'--name', 'api_key_test3',
|
|
24
|
-
'--scopes', 'mail.send'
|
|
25
|
-
]
|
|
26
|
-
ApiKey.start(args)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it '#create with all scope' do
|
|
30
|
-
args = [
|
|
31
|
-
'create',
|
|
32
|
-
'--user', ENV['USERNAME'],
|
|
33
|
-
'--pass', ENV['PASS'],
|
|
34
|
-
'--name', 'api_key_test4'
|
|
35
|
-
]
|
|
36
|
-
ApiKey.start(args)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
it '#get' do
|
|
40
|
-
args = [
|
|
41
|
-
'get',
|
|
42
|
-
'--api-key', ENV['SILVER_API_KEY'],
|
|
43
|
-
'--api-key-id', ENV['TEMP_API_KEY_ID']
|
|
44
|
-
]
|
|
45
|
-
ApiKey.start(args)
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
it '#delete' do
|
|
49
|
-
args = [
|
|
50
|
-
'delete',
|
|
51
|
-
'--api-key', ENV['SILVER_API_KEY'],
|
|
52
|
-
'--api-key-id', ENV['TEMP_API_KEY_ID']
|
|
53
|
-
]
|
|
54
|
-
ApiKey.start(args)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
it '#update specify scopes' do
|
|
58
|
-
args = [
|
|
59
|
-
'update',
|
|
60
|
-
'--user', ENV['USERNAME'],
|
|
61
|
-
'--pass', ENV['PASS'],
|
|
62
|
-
'--name', 'api_key_test31',
|
|
63
|
-
'--api-key-id', ENV['TEMP_API_KEY_ID'],
|
|
64
|
-
'--scopes', 'mail.batch.create', 'mail.send'
|
|
65
|
-
]
|
|
66
|
-
ApiKey.start(args)
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
it '#permission subcommand' do
|
|
70
|
-
args = [
|
|
71
|
-
'permission'
|
|
72
|
-
]
|
|
73
|
-
ApiKey.start(args)
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
|
3
|
-
|
|
4
|
-
module SendGrid4r::CLI::ApiKeys
|
|
5
|
-
describe Permission do
|
|
6
|
-
describe 'integration test', :it do
|
|
7
|
-
before do
|
|
8
|
-
Dotenv.load
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it '#list with api key' do
|
|
12
|
-
args = [
|
|
13
|
-
'list',
|
|
14
|
-
'--api-key', ENV['SILVER_API_KEY']
|
|
15
|
-
]
|
|
16
|
-
Permission.start(args)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it '#list with user and pass' do
|
|
20
|
-
args = [
|
|
21
|
-
'list',
|
|
22
|
-
'--user', ENV['USERNAME'],
|
|
23
|
-
'--pass', ENV['PASS']
|
|
24
|
-
]
|
|
25
|
-
Permission.start(args)
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
|
3
|
-
|
|
4
|
-
module SendGrid4r::CLI::Campaign
|
|
5
|
-
describe Campaign do
|
|
6
|
-
describe 'integration test', :it do
|
|
7
|
-
before do
|
|
8
|
-
Dotenv.load
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it '#create' do
|
|
12
|
-
args = [
|
|
13
|
-
'create',
|
|
14
|
-
'--api-key', ENV['API_KEY'],
|
|
15
|
-
'--title', 'cli_campaign',
|
|
16
|
-
'--subject', 'cli_subject',
|
|
17
|
-
'--sender-id', 493,
|
|
18
|
-
'--list-ids', 402704,
|
|
19
|
-
'--segment-ids', 147305,
|
|
20
|
-
'--categories', 'CAT1',
|
|
21
|
-
'--suppression-group-id', 3581,
|
|
22
|
-
'--html-content',
|
|
23
|
-
'<p>This is HTML</p><a href="[unsubscribe]">here</a>',
|
|
24
|
-
'--plain-content', 'This is PLAIN [unsubscribe]'
|
|
25
|
-
]
|
|
26
|
-
Campaign.start(args)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it '#list' do
|
|
30
|
-
args = [
|
|
31
|
-
'list',
|
|
32
|
-
'--api-key', ENV['API_KEY']
|
|
33
|
-
]
|
|
34
|
-
Campaign.start(args)
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
it '#get' do
|
|
38
|
-
args = [
|
|
39
|
-
'get',
|
|
40
|
-
'--api-key', ENV['API_KEY'],
|
|
41
|
-
'--campaign-id', 317633
|
|
42
|
-
]
|
|
43
|
-
Campaign.start(args)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
it '#update' do
|
|
47
|
-
args = [
|
|
48
|
-
'update',
|
|
49
|
-
'--api-key', ENV['API_KEY'],
|
|
50
|
-
'--campaign-id', 317707,
|
|
51
|
-
'--title', 'cli_campaign',
|
|
52
|
-
'--subject', 'cli_subject',
|
|
53
|
-
'--sender-id', 493,
|
|
54
|
-
'--list-ids', 405165,
|
|
55
|
-
'--categories', 'CAT1',
|
|
56
|
-
'--suppression-group-id', 3581,
|
|
57
|
-
'--html-content',
|
|
58
|
-
'<p>This is HTML</p><a href="[unsubscribe]">here</a>',
|
|
59
|
-
'--plain-content', 'This is PLAIN [unsubscribe]'
|
|
60
|
-
]
|
|
61
|
-
Campaign.start(args)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
it '#send' do
|
|
65
|
-
args = [
|
|
66
|
-
'send',
|
|
67
|
-
'--api-key', ENV['API_KEY'],
|
|
68
|
-
'--campaign-id', 317707
|
|
69
|
-
]
|
|
70
|
-
Campaign.start(args)
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
it '#schedule' do
|
|
74
|
-
args = [
|
|
75
|
-
'schedule',
|
|
76
|
-
'--api-key', ENV['API_KEY'],
|
|
77
|
-
'--campaign-id', 317769,
|
|
78
|
-
'--send-at', Time.now.to_i + 1800
|
|
79
|
-
]
|
|
80
|
-
Campaign.start(args)
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
it '#reschedule' do
|
|
84
|
-
args = [
|
|
85
|
-
'reschedule',
|
|
86
|
-
'--api-key', ENV['API_KEY'],
|
|
87
|
-
'--campaign-id', 317735,
|
|
88
|
-
'--send-at', Time.now.to_i
|
|
89
|
-
]
|
|
90
|
-
Campaign.start(args)
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
it '#unschedule' do
|
|
94
|
-
args = [
|
|
95
|
-
'unschedule',
|
|
96
|
-
'--api-key', ENV['API_KEY'],
|
|
97
|
-
'--campaign-id', 317769
|
|
98
|
-
]
|
|
99
|
-
Campaign.start(args)
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
it '#time' do
|
|
103
|
-
args = [
|
|
104
|
-
'time',
|
|
105
|
-
'--api-key', ENV['API_KEY'],
|
|
106
|
-
'--campaign-id', 317769
|
|
107
|
-
]
|
|
108
|
-
Campaign.start(args)
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
it '#test' do
|
|
112
|
-
args = [
|
|
113
|
-
'test',
|
|
114
|
-
'--api-key', ENV['API_KEY'],
|
|
115
|
-
'--campaign-id', 317769,
|
|
116
|
-
'--to', 'awwa500@gmail.com'
|
|
117
|
-
]
|
|
118
|
-
Campaign.start(args)
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
it '#sender subcommand' do
|
|
122
|
-
args = [
|
|
123
|
-
'sender'
|
|
124
|
-
]
|
|
125
|
-
Campaign.start(args)
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
it '#contact subcommand' do
|
|
129
|
-
args = [
|
|
130
|
-
'contact'
|
|
131
|
-
]
|
|
132
|
-
Campaign.start(args)
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
end
|
|
136
|
-
end
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
3
|
-
|
|
4
|
-
module SendGrid4r::CLI::Campaign::Contact
|
|
5
|
-
describe CustomField do
|
|
6
|
-
describe 'integration test', :it do
|
|
7
|
-
before do
|
|
8
|
-
Dotenv.load
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it '#create' do
|
|
12
|
-
args = [
|
|
13
|
-
'create',
|
|
14
|
-
'--api-key', ENV['API_KEY'],
|
|
15
|
-
'--name', 'cli_test',
|
|
16
|
-
'--type', 'text'
|
|
17
|
-
]
|
|
18
|
-
CustomField.start(args)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it '#list' do
|
|
22
|
-
args = [
|
|
23
|
-
'list',
|
|
24
|
-
'--api-key', ENV['API_KEY']
|
|
25
|
-
]
|
|
26
|
-
CustomField.start(args)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it '#get' do
|
|
30
|
-
args = [
|
|
31
|
-
'get',
|
|
32
|
-
'--api-key', ENV['API_KEY'],
|
|
33
|
-
'--custom-field-id', 112801
|
|
34
|
-
]
|
|
35
|
-
CustomField.start(args)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it '#delete' do
|
|
39
|
-
args = [
|
|
40
|
-
'delete',
|
|
41
|
-
'--api-key', ENV['API_KEY'],
|
|
42
|
-
'--custom-field-id', 112801
|
|
43
|
-
]
|
|
44
|
-
CustomField.start(args)
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
3
|
-
|
|
4
|
-
module SendGrid4r::CLI::Campaign::Contact
|
|
5
|
-
describe List do
|
|
6
|
-
describe 'integration test', :it do
|
|
7
|
-
before do
|
|
8
|
-
Dotenv.load
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it '#create' do
|
|
12
|
-
args = [
|
|
13
|
-
'create',
|
|
14
|
-
'--api-key', ENV['API_KEY'],
|
|
15
|
-
'--name', 'cli_list'
|
|
16
|
-
]
|
|
17
|
-
List.start(args)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
it '#list' do
|
|
21
|
-
args = [
|
|
22
|
-
'list',
|
|
23
|
-
'--api-key', ENV['API_KEY']
|
|
24
|
-
]
|
|
25
|
-
List.start(args)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it '#get' do
|
|
29
|
-
args = [
|
|
30
|
-
'get',
|
|
31
|
-
'--api-key', ENV['API_KEY'],
|
|
32
|
-
'--list-id', 402704
|
|
33
|
-
]
|
|
34
|
-
List.start(args)
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
it '#rename' do
|
|
38
|
-
args = [
|
|
39
|
-
'rename',
|
|
40
|
-
'--api-key', ENV['API_KEY'],
|
|
41
|
-
'--list-id', 402704,
|
|
42
|
-
'--name', 'cli_list_edit'
|
|
43
|
-
]
|
|
44
|
-
List.start(args)
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
it '#delete' do
|
|
48
|
-
args = [
|
|
49
|
-
'delete',
|
|
50
|
-
'--api-key', ENV['API_KEY'],
|
|
51
|
-
'--list-id', 402704
|
|
52
|
-
]
|
|
53
|
-
List.start(args)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
it '#recipient with add action' do
|
|
57
|
-
args = [
|
|
58
|
-
'recipient', 'add',
|
|
59
|
-
'--api-key', ENV['API_KEY'],
|
|
60
|
-
'--list-id', 402704,
|
|
61
|
-
'--recipients', 'YXd3YTUwMEBnbWFpbC5jb20='
|
|
62
|
-
]
|
|
63
|
-
List.start(args)
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
it '#recipient with list action' do
|
|
67
|
-
args = [
|
|
68
|
-
'recipient', 'list',
|
|
69
|
-
'--api-key', ENV['API_KEY'],
|
|
70
|
-
'--list-id', 405165,
|
|
71
|
-
'--page', 1,
|
|
72
|
-
'--page-size', 20
|
|
73
|
-
]
|
|
74
|
-
List.start(args)
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
it '#recipient with remove action' do
|
|
78
|
-
args = [
|
|
79
|
-
'recipient', 'remove',
|
|
80
|
-
'--api-key', ENV['API_KEY'],
|
|
81
|
-
'--list-id', 402704,
|
|
82
|
-
'--recipient-id', 'YWJjQGFiYy5hYmM='
|
|
83
|
-
]
|
|
84
|
-
List.start(args)
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
end
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
3
|
-
|
|
4
|
-
module SendGrid4r::CLI::Campaign::Contact
|
|
5
|
-
describe Recipient do
|
|
6
|
-
describe 'integration test', :it do
|
|
7
|
-
before do
|
|
8
|
-
Dotenv.load
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it '#create multiple recipients' do
|
|
12
|
-
args = [
|
|
13
|
-
'create',
|
|
14
|
-
'--api-key', ENV['API_KEY'],
|
|
15
|
-
'--params', 'email:abc@abc.abc', 'last_name:cli taro'
|
|
16
|
-
]
|
|
17
|
-
Recipient.start(args)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
it '#create single recipient' do
|
|
21
|
-
args = [
|
|
22
|
-
'create',
|
|
23
|
-
'--api-key', ENV['API_KEY'],
|
|
24
|
-
'--params', "email:#{ENV['MAIL']}"
|
|
25
|
-
]
|
|
26
|
-
Recipient.start(args)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it '#update' do
|
|
30
|
-
args = [
|
|
31
|
-
'update',
|
|
32
|
-
'--api-key', ENV['API_KEY'],
|
|
33
|
-
'--params', 'email:abc@abc.abc', 'last_name:cli taro'
|
|
34
|
-
]
|
|
35
|
-
Recipient.start(args)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it '#delete' do
|
|
39
|
-
args = [
|
|
40
|
-
'delete',
|
|
41
|
-
'--api-key', ENV['API_KEY'],
|
|
42
|
-
'--recipient-ids', 'YWJjQGFiYy5hYmM='
|
|
43
|
-
]
|
|
44
|
-
Recipient.start(args)
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
it '#list' do
|
|
48
|
-
args = [
|
|
49
|
-
'list',
|
|
50
|
-
'--api-key', ENV['API_KEY'],
|
|
51
|
-
'--page', 1,
|
|
52
|
-
'--page-size', 50
|
|
53
|
-
]
|
|
54
|
-
Recipient.start(args)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
it '#get' do
|
|
58
|
-
args = [
|
|
59
|
-
'get',
|
|
60
|
-
'--api-key', ENV['API_KEY'],
|
|
61
|
-
'--recipient-id', 'YXd3YTUwMEBnbWFpbC5jb20='
|
|
62
|
-
]
|
|
63
|
-
Recipient.start(args)
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
it '#count' do
|
|
67
|
-
args = [
|
|
68
|
-
'count',
|
|
69
|
-
'--api-key', ENV['API_KEY']
|
|
70
|
-
]
|
|
71
|
-
Recipient.start(args)
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
it '#search' do
|
|
75
|
-
args = [
|
|
76
|
-
'search',
|
|
77
|
-
'--api-key', ENV['API_KEY'],
|
|
78
|
-
'--params', 'email:abc@abc.abc'
|
|
79
|
-
]
|
|
80
|
-
Recipient.start(args)
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
it '#belong' do
|
|
84
|
-
args = [
|
|
85
|
-
'belong',
|
|
86
|
-
'--api-key', ENV['API_KEY'],
|
|
87
|
-
'--recipient-id', 'YWJjQGFiYy5hYmM='
|
|
88
|
-
]
|
|
89
|
-
Recipient.start(args)
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
3
|
-
|
|
4
|
-
module SendGrid4r::CLI::Campaign::Contact
|
|
5
|
-
describe ReservedField do
|
|
6
|
-
describe 'integration test', :it do
|
|
7
|
-
before do
|
|
8
|
-
Dotenv.load
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it '#list' do
|
|
12
|
-
args = [
|
|
13
|
-
'list',
|
|
14
|
-
'--api-key', ENV['API_KEY']
|
|
15
|
-
]
|
|
16
|
-
ReservedField.start(args)
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
3
|
-
|
|
4
|
-
module SendGrid4r::CLI::Campaign::Contact
|
|
5
|
-
describe Segment do
|
|
6
|
-
describe 'integration test', :it do
|
|
7
|
-
before do
|
|
8
|
-
Dotenv.load
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it '#create without and_or' do
|
|
12
|
-
args = [
|
|
13
|
-
'create',
|
|
14
|
-
'--api-key', ENV['API_KEY'],
|
|
15
|
-
'--name', 'cli_segment1',
|
|
16
|
-
'--list-id', 402704,
|
|
17
|
-
'--conditions', 'field:email,value:abc@abc.abc,operator:eq'
|
|
18
|
-
]
|
|
19
|
-
Segment.start(args)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it '#create with nil and_or' do
|
|
23
|
-
args = [
|
|
24
|
-
'create',
|
|
25
|
-
'--api-key', ENV['API_KEY'],
|
|
26
|
-
'--name', 'cli_segment2',
|
|
27
|
-
'--list-id', 402704,
|
|
28
|
-
'--conditions', 'field:email,value:abc@abc.abc,operator:eq,and_or:'
|
|
29
|
-
]
|
|
30
|
-
Segment.start(args)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it '#create with multiple conditions' do
|
|
34
|
-
args = [
|
|
35
|
-
'create',
|
|
36
|
-
'--api-key', ENV['API_KEY'],
|
|
37
|
-
'--name', 'cli_segment3',
|
|
38
|
-
'--list-id', 402704,
|
|
39
|
-
'--conditions',
|
|
40
|
-
'field:email,value:abc@abc.abc,operator:eq,and_or:',
|
|
41
|
-
'field:email,value:abc@abc.abc,operator:eq,and_or:and'
|
|
42
|
-
]
|
|
43
|
-
Segment.start(args)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
it '#list' do
|
|
47
|
-
args = [
|
|
48
|
-
'list',
|
|
49
|
-
'--api-key', ENV['API_KEY']
|
|
50
|
-
]
|
|
51
|
-
Segment.start(args)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
it '#get' do
|
|
55
|
-
args = [
|
|
56
|
-
'get',
|
|
57
|
-
'--api-key', ENV['API_KEY'],
|
|
58
|
-
'--segment-id', 208991
|
|
59
|
-
]
|
|
60
|
-
Segment.start(args)
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
it '#update' do
|
|
64
|
-
args = [
|
|
65
|
-
'update',
|
|
66
|
-
'--api-key', ENV['API_KEY'],
|
|
67
|
-
'--segment-id', 208991,
|
|
68
|
-
'--name', 'cli_segment_edit',
|
|
69
|
-
'--conditions', 'field:email,value:abc@abc.abc,operator:eq,and_or:'
|
|
70
|
-
]
|
|
71
|
-
Segment.start(args)
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
it '#delete' do
|
|
75
|
-
args = [
|
|
76
|
-
'delete',
|
|
77
|
-
'--api-key', ENV['API_KEY'],
|
|
78
|
-
'--segment-id', 208991
|
|
79
|
-
]
|
|
80
|
-
Segment.start(args)
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
it '#recipient with list action' do
|
|
84
|
-
args = [
|
|
85
|
-
'recipient', 'list',
|
|
86
|
-
'--api-key', ENV['API_KEY'],
|
|
87
|
-
'--segment-id', 208991
|
|
88
|
-
]
|
|
89
|
-
Segment.start(args)
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
end
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
|
3
|
-
|
|
4
|
-
module SendGrid4r::CLI::Campaign
|
|
5
|
-
describe Sender do
|
|
6
|
-
describe 'integration test', :it do
|
|
7
|
-
before do
|
|
8
|
-
Dotenv.load
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it '#create' do
|
|
12
|
-
args = [
|
|
13
|
-
'create',
|
|
14
|
-
'--api-key', ENV['API_KEY'],
|
|
15
|
-
'--nickname', 'cli_sender',
|
|
16
|
-
'--from', 'email:from@abc.abc', 'name:from_name',
|
|
17
|
-
'--reply-to', 'email:reply_to@abc.abc', 'name:reply_to_name',
|
|
18
|
-
'--address', 'Address',
|
|
19
|
-
'--address-2', 'Address2',
|
|
20
|
-
'--city', 'City',
|
|
21
|
-
'--state', 'State',
|
|
22
|
-
'--zip', 'Zip',
|
|
23
|
-
'--country', 'Country'
|
|
24
|
-
]
|
|
25
|
-
Sender.start(args)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it '#list' do
|
|
29
|
-
args = [
|
|
30
|
-
'list',
|
|
31
|
-
'--api-key', ENV['API_KEY']
|
|
32
|
-
]
|
|
33
|
-
Sender.start(args)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it '#update' do
|
|
37
|
-
args = [
|
|
38
|
-
'update',
|
|
39
|
-
'--api-key', ENV['API_KEY'],
|
|
40
|
-
'--sender-id', 41280,
|
|
41
|
-
'--nickname', 'cli_sender_edit',
|
|
42
|
-
'--from', 'email:from_edit@abc.abc', 'name:from_name_edit',
|
|
43
|
-
'--reply-to', 'email:reply_to_edit@abc.abc',
|
|
44
|
-
'name:reply_to_name_edit',
|
|
45
|
-
'--address', 'Address_edit',
|
|
46
|
-
'--address-2', 'Address2_edit',
|
|
47
|
-
'--city', 'City_edit',
|
|
48
|
-
'--state', 'State_edit',
|
|
49
|
-
'--zip', 'Zip_edit',
|
|
50
|
-
'--country', 'Country_edit'
|
|
51
|
-
]
|
|
52
|
-
Sender.start(args)
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
it '#verify' do
|
|
56
|
-
args = [
|
|
57
|
-
'verify',
|
|
58
|
-
'--api-key', ENV['API_KEY'],
|
|
59
|
-
'--sender-id', 41280
|
|
60
|
-
]
|
|
61
|
-
Sender.start(args)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
it '#get' do
|
|
65
|
-
args = [
|
|
66
|
-
'get',
|
|
67
|
-
'--api-key', ENV['API_KEY'],
|
|
68
|
-
'--sender-id', 41280
|
|
69
|
-
]
|
|
70
|
-
Sender.start(args)
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
it '#delete' do
|
|
74
|
-
args = [
|
|
75
|
-
'delete',
|
|
76
|
-
'--api-key', ENV['API_KEY'],
|
|
77
|
-
'--sender-id', 41280
|
|
78
|
-
]
|
|
79
|
-
Sender.start(args)
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
end
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
|
3
|
-
|
|
4
|
-
module SendGrid4r::CLI::CancelSchedules
|
|
5
|
-
describe BatchId do
|
|
6
|
-
describe 'integration test', :it do
|
|
7
|
-
before do
|
|
8
|
-
Dotenv.load
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
let(:batch_id) do
|
|
12
|
-
'NWI4NjAwZWMtMzNjYS0xMWU2LTgxYzktNTI1NDAwYTUxOTdhLTc4ZmZiMGNmMg'
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
it '#generate' do
|
|
16
|
-
args = [
|
|
17
|
-
'generate',
|
|
18
|
-
'--api-key', ENV['SILVER_API_KEY']
|
|
19
|
-
]
|
|
20
|
-
BatchId.start(args)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it '#validate' do
|
|
24
|
-
args = [
|
|
25
|
-
'validate',
|
|
26
|
-
'--api-key', ENV['SILVER_API_KEY'],
|
|
27
|
-
'--batch-id', batch_id
|
|
28
|
-
]
|
|
29
|
-
BatchId.start(args)
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|