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.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -1
  3. data/lib/sendgrid4r/version.rb +1 -1
  4. data/lib/sendgrid4r.rb +0 -58
  5. data/sendgrid4r.gemspec +0 -3
  6. data/spec/client_spec.rb +1 -1
  7. metadata +5 -183
  8. data/exe/sg +0 -5
  9. data/lib/sendgrid4r/cli/alert.rb +0 -51
  10. data/lib/sendgrid4r/cli/api_keys/api_key.rb +0 -53
  11. data/lib/sendgrid4r/cli/api_keys/permission.rb +0 -15
  12. data/lib/sendgrid4r/cli/campaign/campaign.rb +0 -134
  13. data/lib/sendgrid4r/cli/campaign/contact/contact.rb +0 -25
  14. data/lib/sendgrid4r/cli/campaign/contact/custom_field.rb +0 -42
  15. data/lib/sendgrid4r/cli/campaign/contact/list.rb +0 -71
  16. data/lib/sendgrid4r/cli/campaign/contact/recipient.rb +0 -78
  17. data/lib/sendgrid4r/cli/campaign/contact/reserved_field.rb +0 -17
  18. data/lib/sendgrid4r/cli/campaign/contact/segment.rb +0 -105
  19. data/lib/sendgrid4r/cli/campaign/sender.rb +0 -83
  20. data/lib/sendgrid4r/cli/cancel_schedules/batch_id.rb +0 -23
  21. data/lib/sendgrid4r/cli/cancel_schedules/cancel_schedule.rb +0 -55
  22. data/lib/sendgrid4r/cli/category.rb +0 -16
  23. data/lib/sendgrid4r/cli/ipam/activity.rb +0 -16
  24. data/lib/sendgrid4r/cli/ipam/ipam.rb +0 -14
  25. data/lib/sendgrid4r/cli/ipam/whitelist.rb +0 -39
  26. data/lib/sendgrid4r/cli/ips/address.rb +0 -48
  27. data/lib/sendgrid4r/cli/ips/ip.rb +0 -17
  28. data/lib/sendgrid4r/cli/ips/pool.rb +0 -48
  29. data/lib/sendgrid4r/cli/ips/warmup.rb +0 -39
  30. data/lib/sendgrid4r/cli/mail.rb +0 -34
  31. data/lib/sendgrid4r/cli/settings/enforced_tls.rb +0 -24
  32. data/lib/sendgrid4r/cli/settings/mail.rb +0 -195
  33. data/lib/sendgrid4r/cli/settings/partner.rb +0 -37
  34. data/lib/sendgrid4r/cli/settings/settings.rb +0 -20
  35. data/lib/sendgrid4r/cli/settings/tracking.rb +0 -101
  36. data/lib/sendgrid4r/cli/sg.rb +0 -61
  37. data/lib/sendgrid4r/cli/sg_thor.rb +0 -50
  38. data/lib/sendgrid4r/cli/stats/advanced.rb +0 -74
  39. data/lib/sendgrid4r/cli/stats/category.rb +0 -35
  40. data/lib/sendgrid4r/cli/stats/global.rb +0 -18
  41. data/lib/sendgrid4r/cli/stats/parse.rb +0 -18
  42. data/lib/sendgrid4r/cli/stats/stats.rb +0 -23
  43. data/lib/sendgrid4r/cli/stats/subuser.rb +0 -67
  44. data/lib/sendgrid4r/cli/subusers/monitor.rb +0 -44
  45. data/lib/sendgrid4r/cli/subusers/subuser.rb +0 -77
  46. data/lib/sendgrid4r/cli/suppressions/block.rb +0 -43
  47. data/lib/sendgrid4r/cli/suppressions/bounce.rb +0 -41
  48. data/lib/sendgrid4r/cli/suppressions/global_unsubscribe.rb +0 -43
  49. data/lib/sendgrid4r/cli/suppressions/group.rb +0 -61
  50. data/lib/sendgrid4r/cli/suppressions/group_unsubscribe.rb +0 -43
  51. data/lib/sendgrid4r/cli/suppressions/invalid_email.rb +0 -43
  52. data/lib/sendgrid4r/cli/suppressions/spam_report.rb +0 -43
  53. data/lib/sendgrid4r/cli/suppressions/suppression.rb +0 -36
  54. data/lib/sendgrid4r/cli/templates/template.rb +0 -51
  55. data/lib/sendgrid4r/cli/templates/version.rb +0 -78
  56. data/lib/sendgrid4r/cli/user.rb +0 -86
  57. data/lib/sendgrid4r/cli/webhooks/event.rb +0 -53
  58. data/lib/sendgrid4r/cli/webhooks/parse.rb +0 -55
  59. data/lib/sendgrid4r/cli/webhooks/webhook.rb +0 -14
  60. data/lib/sendgrid4r/cli/whitelabel/domain.rb +0 -117
  61. data/lib/sendgrid4r/cli/whitelabel/ip.rb +0 -52
  62. data/lib/sendgrid4r/cli/whitelabel/link.rb +0 -96
  63. data/lib/sendgrid4r/cli/whitelabel/whitelabel.rb +0 -17
  64. data/spec/cli/alert_spec.rb +0 -71
  65. data/spec/cli/api_keys/api_key_spec.rb +0 -77
  66. data/spec/cli/api_keys/permission_spec.rb +0 -29
  67. data/spec/cli/campaign/campaign_spec.rb +0 -136
  68. data/spec/cli/campaign/contact/custom_field_spec.rb +0 -48
  69. data/spec/cli/campaign/contact/list_spec.rb +0 -88
  70. data/spec/cli/campaign/contact/recipient_spec.rb +0 -93
  71. data/spec/cli/campaign/contact/reserved_field_spec.rb +0 -20
  72. data/spec/cli/campaign/contact/segment_spec.rb +0 -93
  73. data/spec/cli/campaign/sender_spec.rb +0 -83
  74. data/spec/cli/cancel_schedules/batch_id_spec.rb +0 -33
  75. data/spec/cli/cancel_schedules/cancel_schedule_spec.rb +0 -69
  76. data/spec/cli/category_spec.rb +0 -23
  77. data/spec/cli/ipam/activity_spec.rb +0 -21
  78. data/spec/cli/ipam/ipam_spec.rb +0 -26
  79. data/spec/cli/ipam/whitelist_spec.rb +0 -47
  80. data/spec/cli/ips/address_spec.rb +0 -57
  81. data/spec/cli/ips/ip_spec.rb +0 -33
  82. data/spec/cli/ips/pool_spec.rb +0 -57
  83. data/spec/cli/ips/warmup_spec.rb +0 -47
  84. data/spec/cli/mail_spec.rb +0 -37
  85. data/spec/cli/settings/enforced_tls_spec.rb +0 -30
  86. data/spec/cli/settings/mail_spec.rb +0 -255
  87. data/spec/cli/settings/partner_spec.rb +0 -47
  88. data/spec/cli/settings/settings_spec.rb +0 -40
  89. data/spec/cli/settings/tracking_spec.rb +0 -128
  90. data/spec/cli/sg_spec.rb +0 -87
  91. data/spec/cli/stats/advanced_spec.rb +0 -137
  92. data/spec/cli/stats/category_spec.rb +0 -57
  93. data/spec/cli/stats/global_spec.rb +0 -32
  94. data/spec/cli/stats/parse_spec.rb +0 -32
  95. data/spec/cli/stats/stats_spec.rb +0 -40
  96. data/spec/cli/stats/subuser_spec.rb +0 -104
  97. data/spec/cli/subusers/monitor_spec.rb +0 -52
  98. data/spec/cli/subusers/subuser_spec.rb +0 -88
  99. data/spec/cli/suppressions/block_spec.rb +0 -60
  100. data/spec/cli/suppressions/bounce_spec.rb +0 -58
  101. data/spec/cli/suppressions/global_unsubscribe_spec.rb +0 -59
  102. data/spec/cli/suppressions/group_spec.rb +0 -78
  103. data/spec/cli/suppressions/group_unsubscribe_spec.rb +0 -51
  104. data/spec/cli/suppressions/invalid_email_spec.rb +0 -60
  105. data/spec/cli/suppressions/spam_report_spec.rb +0 -60
  106. data/spec/cli/suppressions/suppression_spec.rb +0 -68
  107. data/spec/cli/templates/template_spec.rb +0 -65
  108. data/spec/cli/templates/version_spec.rb +0 -71
  109. data/spec/cli/user_spec.rb +0 -82
  110. data/spec/cli/webhooks/event_spec.rb +0 -67
  111. data/spec/cli/webhooks/parse_spec.rb +0 -72
  112. data/spec/cli/webhooks/webhook_spec.rb +0 -28
  113. data/spec/cli/whitelabel/domain_spec.rb +0 -112
  114. data/spec/cli/whitelabel/ip_spec.rb +0 -61
  115. data/spec/cli/whitelabel/link_spec.rb +0 -110
  116. data/spec/cli/whitelabel/whitelabel_spec.rb +0 -27
@@ -1,42 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Campaign
3
- module Contact
4
- #
5
- # SendGrid Web API v3 Marketing Campaigns
6
- #
7
- class CustomField < SgThor
8
- desc 'create', 'Create a custom field'
9
- option :name, require: true
10
- option :type, banner: SgThor::TYP, require: true
11
- def create
12
- puts @client.post_custom_field(parameterise(options))
13
- rescue RestClient::ExceptionWithResponse => e
14
- puts e.inspect
15
- end
16
-
17
- desc 'list', 'List custom fields'
18
- def list
19
- puts @client.get_custom_fields
20
- rescue RestClient::ExceptionWithResponse => e
21
- puts e.inspect
22
- end
23
-
24
- desc 'get', 'Get a custom field'
25
- option :custom_field_id, require: true
26
- def get
27
- puts @client.get_custom_field(parameterise(options))
28
- rescue RestClient::ExceptionWithResponse => e
29
- puts e.inspect
30
- end
31
-
32
- desc 'delete', 'Delete a custom field'
33
- option :custom_field_id, require: true
34
- def delete
35
- puts @client.delete_custom_field(parameterise(options))
36
- rescue RestClient::ExceptionWithResponse => e
37
- puts e.inspect
38
- end
39
- end
40
- end
41
- end
42
- end
@@ -1,71 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Campaign
3
- module Contact
4
- #
5
- # SendGrid Web API v3 Marketing Campaigns - List
6
- #
7
- class List < SgThor
8
- desc 'create', 'Create a list'
9
- option :name, require: true
10
- def create
11
- puts @client.post_list(parameterise(options))
12
- rescue RestClient::ExceptionWithResponse => e
13
- puts e.inspect
14
- end
15
-
16
- desc 'list', 'List lists'
17
- def list
18
- puts @client.get_lists
19
- rescue RestClient::ExceptionWithResponse => e
20
- puts e.inspect
21
- end
22
-
23
- desc 'get', 'Get a list'
24
- option :list_id, type: :numeric, require: true
25
- def get
26
- puts @client.get_list(parameterise(options))
27
- rescue RestClient::ExceptionWithResponse => e
28
- puts e.inspect
29
- end
30
-
31
- desc 'rename', 'Rename a list'
32
- option :list_id, type: :numeric, require: true
33
- option :name
34
- def rename
35
- puts @client.patch_list(parameterise(options))
36
- rescue RestClient::ExceptionWithResponse => e
37
- puts e.inspect
38
- end
39
-
40
- desc 'delete', 'Delete lists'
41
- option :list_ids, type: :array, require: true
42
- def delete
43
- puts @client.delete_lists(parameterise(options))
44
- rescue RestClient::ExceptionWithResponse => e
45
- puts e.inspect
46
- end
47
-
48
- desc 'recipient [add|remove|list]', 'Add, Remove, List a recipient'
49
- option :list_id, type: :numeric, require: true
50
- option :recipients, type: :array, desc: 'for add action'
51
- option :recipient_id, desc: 'for remove action'
52
- option :page, type: :numeric, desc: 'for list action'
53
- option :page_size, type: :numeric, desc: 'for list action'
54
- def recipient(action)
55
- case action
56
- when 'add'
57
- puts @client.post_recipients_to_list(parameterise(options))
58
- when 'remove'
59
- puts @client.delete_recipient_from_list(parameterise(options))
60
- when 'list'
61
- puts @client.get_recipients_from_list(parameterise(options))
62
- else
63
- puts "error: #{action} is not supported in action parameter"
64
- end
65
- rescue RestClient::ExceptionWithResponse => e
66
- puts e.inspect
67
- end
68
- end
69
- end
70
- end
71
- end
@@ -1,78 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Campaign
3
- module Contact
4
- #
5
- # SendGrid Web API v3 Marketing Campaigns - Recipient
6
- #
7
- class Recipient < SgThor
8
- desc 'create', 'Create a recipient'
9
- option :params, type: :hash, require: true
10
- def create
11
- puts @client.post_recipients(
12
- params: [parameterise(options[:params])]
13
- )
14
- rescue RestClient::ExceptionWithResponse => e
15
- puts e.inspect
16
- end
17
-
18
- desc 'update', 'Update a recipient'
19
- option :params, type: :hash, require: true
20
- def update
21
- puts @client.patch_recipients(
22
- params: [parameterise(options[:params])]
23
- )
24
- rescue RestClient::ExceptionWithResponse => e
25
- puts e.inspect
26
- end
27
-
28
- desc 'delete', 'Delete recipients'
29
- option :recipient_ids, type: :array, require: true
30
- def delete
31
- puts @client.delete_recipients(parameterise(options))
32
- rescue RestClient::ExceptionWithResponse => e
33
- puts e.inspect
34
- end
35
-
36
- desc 'list', 'List recipients'
37
- option :page, type: :numeric
38
- option :page_size, type: :numeric
39
- def list
40
- puts @client.get_recipients(parameterise(options))
41
- rescue RestClient::ExceptionWithResponse => e
42
- puts e.inspect
43
- end
44
-
45
- desc 'get', 'Get a recipient'
46
- option :recipient_id, require: true
47
- def get
48
- puts @client.get_recipient(parameterise(options))
49
- rescue RestClient::ExceptionWithResponse => e
50
- puts e.inspect
51
- end
52
-
53
- desc 'count', 'Get recipients count'
54
- def count
55
- puts @client.get_recipients_count
56
- rescue RestClient::ExceptionWithResponse => e
57
- puts e.inspect
58
- end
59
-
60
- desc 'search', 'Search recipients'
61
- option :params, type: :hash, require: true
62
- def search
63
- puts @client.search_recipients(params: options[:params])
64
- rescue RestClient::ExceptionWithResponse => e
65
- puts e.inspect
66
- end
67
-
68
- desc 'belong', 'List lists a recipient belongs to'
69
- option :recipient_id, require: true
70
- def belong
71
- puts @client.get_lists_recipient_belong(parameterise(options))
72
- rescue RestClient::ExceptionWithResponse => e
73
- puts e.inspect
74
- end
75
- end
76
- end
77
- end
78
- end
@@ -1,17 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Campaign
3
- module Contact
4
- #
5
- # SendGrid Web API v3 Marketing Campaigns - Reserved Field
6
- #
7
- class ReservedField < SgThor
8
- desc 'list', 'List reserved fields'
9
- def list
10
- puts @client.get_reserved_fields
11
- rescue RestClient::ExceptionWithResponse => e
12
- puts e.inspect
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,105 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Campaign
3
- module Contact
4
- #
5
- # SendGrid Web API v3 Marketing Campaigns - Segment
6
- #
7
- class Segment < SgThor
8
- def initialize(*args)
9
- super
10
- @condition_factory = SendGrid4r::Factory::ConditionFactory.new
11
- @segment_factory = SendGrid4r::Factory::SegmentFactory.new
12
- end
13
-
14
- desc 'create', 'Create a segment'
15
- option :name, require: true
16
- option :list_id, type: :numeric, require: true
17
- option(
18
- :conditions,
19
- type: :array,
20
- require: true,
21
- banner: 'field:email,value:abc@abc.abc,operator:eq,and_or:'
22
- )
23
- def create
24
- conditions = options[:conditions].map do |c|
25
- array = c.delete(' ').split(/[:,]/)
26
- hash = array.each_slice(2).map do |k, v|
27
- [k.to_sym, v.nil? ? '' : v]
28
- end.to_h
29
- @condition_factory.create(hash)
30
- end
31
- params = @segment_factory.create(
32
- name: options[:name],
33
- list_id: options[:list_id],
34
- conditions: conditions
35
- )
36
- puts @client.post_segment(params: params)
37
- rescue RestClient::ExceptionWithResponse => e
38
- puts e.inspect
39
- end
40
-
41
- desc 'list', 'List segments'
42
- def list
43
- puts @client.get_segments
44
- rescue RestClient::ExceptionWithResponse => e
45
- puts e.inspect
46
- end
47
-
48
- desc 'get', 'Get a segment'
49
- option :segment_id, require: true
50
- def get
51
- puts @client.get_segment(parameterise(options))
52
- rescue RestClient::ExceptionWithResponse => e
53
- puts e.inspect
54
- end
55
-
56
- desc 'update', 'Update a segment'
57
- option :segment_id, require: true
58
- option :name
59
- option(
60
- :conditions,
61
- type: :array,
62
- banner: 'field:email,value:abc@abc.abc,operator:eq,and_or:'
63
- )
64
- def update
65
- conditions = options[:conditions].map do |c|
66
- array = c.delete(' ').split(/[:,]/)
67
- hash = array.each_slice(2).map do |k, v|
68
- [k.to_sym, v.nil? ? '' : v]
69
- end.to_h
70
- @condition_factory.create(hash)
71
- end
72
- params = @segment_factory.create(
73
- name: options[:name],
74
- conditions: conditions
75
- )
76
- puts @client.patch_segment(
77
- segment_id: options[:segment_id],
78
- params: params
79
- )
80
- rescue RestClient::ExceptionWithResponse => e
81
- puts e.inspect
82
- end
83
-
84
- desc 'delete', 'Delete a segment'
85
- option :segment_id, require: true
86
- def delete
87
- puts @client.delete_segment(parameterise(options))
88
- rescue RestClient::ExceptionWithResponse => e
89
- puts e.inspect
90
- end
91
-
92
- desc 'recipient [list]', 'List recipients'
93
- option :segment_id, require: true
94
- def recipient(action)
95
- case action
96
- when 'list'
97
- puts @client.get_recipients_on_segment(parameterise(options))
98
- else
99
- puts "error: #{action} is not supported in action parameter"
100
- end
101
- end
102
- end
103
- end
104
- end
105
- end
@@ -1,83 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Campaign
3
- #
4
- # SendGrid Web API v3 Marketing Campaigns - Sender
5
- #
6
- class Sender < SgThor
7
- def initialize(*args)
8
- super
9
- @factory = SendGrid4r::Factory::CampaignFactory.new
10
- end
11
- desc 'create', 'Create a sender'
12
- option :nickname
13
- option :from, type: :hash
14
- option :reply_to, type: :hash
15
- option :address
16
- option :address_2
17
- option :city
18
- option :state
19
- option :zip
20
- option :country
21
- def create
22
- sender = @factory.create_sender(parameterise(options))
23
- puts @client.post_sender(params: sender)
24
- rescue RestClient::ExceptionWithResponse => e
25
- puts e.inspect
26
- end
27
-
28
- desc 'list', 'List senders'
29
- def list
30
- puts @client.get_senders
31
- rescue RestClient::ExceptionWithResponse => e
32
- puts e.inspect
33
- end
34
-
35
- desc 'update', 'Update a sender'
36
- option :sender_id, type: :numeric, require: true
37
- option :nickname
38
- option :from, type: :hash
39
- option :reply_to, type: :hash
40
- option :address
41
- option :address_2
42
- option :city
43
- option :state
44
- option :zip
45
- option :country
46
- def update
47
- params = parameterise(options)
48
- params.delete(:sender_id)
49
- sender = @factory.create_sender(params)
50
- puts @client.patch_sender(
51
- sender_id: options[:sender_id],
52
- params: sender
53
- )
54
- rescue RestClient::ExceptionWithResponse => e
55
- puts e.inspect
56
- end
57
-
58
- desc 'delete', 'Delete a sender'
59
- option :sender_id, type: :numeric, require: true
60
- def delete
61
- puts @client.delete_sender(parameterise(options))
62
- rescue RestClient::ExceptionWithResponse => e
63
- puts e.inspect
64
- end
65
-
66
- desc 'verify', 'Resend sender identity verification'
67
- option :sender_id, type: :numeric, require: true
68
- def verify
69
- puts @client.resend_sender_verification(parameterise(options))
70
- rescue RestClient::ExceptionWithResponse => e
71
- puts e.inspect
72
- end
73
-
74
- desc 'get', 'Get a sender'
75
- option :sender_id, type: :numeric, require: true
76
- def get
77
- puts @client.get_sender(parameterise(options))
78
- rescue RestClient::ExceptionWithResponse => e
79
- puts e.inspect
80
- end
81
- end
82
- end
83
- end
@@ -1,23 +0,0 @@
1
- module SendGrid4r::CLI
2
- module CancelSchedules
3
- #
4
- # SendGrid Web API v3 CancelSchedules BatchId
5
- #
6
- class BatchId < SgThor
7
- desc 'generate', 'Generate Batch ID'
8
- def generate_batch_id
9
- puts @client.generate_batch_id
10
- rescue RestClient::ExceptionWithResponse => e
11
- puts e.inspect
12
- end
13
-
14
- desc 'validate', 'Validate Batch ID'
15
- option :batch_id, require: true
16
- def validate_batch_id
17
- puts @client.validate_batch_id(parameterise(options))
18
- rescue RestClient::ExceptionWithResponse => e
19
- puts e.inspect
20
- end
21
- end
22
- end
23
- end
@@ -1,55 +0,0 @@
1
- module SendGrid4r::CLI
2
- module CancelSchedules
3
- #
4
- # SendGrid Web API v3 CancelSchedules CancelSchedule
5
- #
6
- class CancelSchedule < SgThor
7
- desc 'add', 'Cancel shceduled sends'
8
- option :batch_id, require: true
9
- option :status, require: true
10
- def add
11
- puts @client.post_scheduled_send(parameterise(options))
12
- rescue RestClient::ExceptionWithResponse => e
13
- puts e.inspect
14
- end
15
-
16
- desc 'list', 'Get all cancel/paused scheduled send information'
17
- def list
18
- puts @client.get_scheduled_sends
19
- rescue RestClient::ExceptionWithResponse => e
20
- puts e.inspect
21
- end
22
-
23
- desc 'get', 'Get a single cancel/paused scheduled send information'
24
- option :batch_id, require: true
25
- def get
26
- puts @client.get_scheduled_sends(parameterise(options))
27
- rescue RestClient::ExceptionWithResponse => e
28
- puts e.inspect
29
- end
30
-
31
- desc 'update', 'Update the status of a scheduled send'
32
- option :batch_id, require: true
33
- option :status, require: true
34
- def update
35
- puts @client.patch_scheduled_send(parameterise(options))
36
- rescue RestClient::ExceptionWithResponse => e
37
- puts e.inspect
38
- end
39
-
40
- desc 'delete', 'Delete the cancel/pause of a scheduled send'
41
- option :batch_id, require: true
42
- def delete
43
- puts @client.delete_scheduled_send(parameterise(options))
44
- rescue RestClient::ExceptionWithResponse => e
45
- puts e.inspect
46
- end
47
-
48
- desc(
49
- 'batch_id SUBCOMMAND ...ARGS',
50
- 'Manage batch ID for canceling schedule sends'
51
- )
52
- subcommand('batch_id', BatchId)
53
- end
54
- end
55
- end
@@ -1,16 +0,0 @@
1
- module SendGrid4r::CLI
2
- #
3
- # SendGrid Web API v3 Category
4
- #
5
- class Category < SgThor
6
- desc 'list', 'List categories'
7
- option :category
8
- option :limit, type: :numeric
9
- option :offset, type: :numeric
10
- def list
11
- puts @client.get_categories(parameterise(options))
12
- rescue RestClient::ExceptionWithResponse => e
13
- puts e.inspect
14
- end
15
- end
16
- end
@@ -1,16 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Ipam
3
- #
4
- # SendGrid Web API v3 Ipam Activity
5
- #
6
- class Activity < SgThor
7
- desc 'list', 'History Collection'
8
- option :limit, type: :numeric
9
- def list
10
- puts @client.get_ip_activities(parameterise(options))
11
- rescue RestClient::ExceptionWithResponse => e
12
- puts e.inspect
13
- end
14
- end
15
- end
16
- end
@@ -1,14 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Ipam
3
- #
4
- # SendGrid Web API v3 Ipam Whitelist
5
- #
6
- class Ipam < SgThor
7
- desc('activity SUBCOMMAND ...ARGS', 'Manage IP access activity')
8
- subcommand('activity', Activity)
9
-
10
- desc('whitelist SUBCOMMAND ...ARGS', 'Manage IP access whitelist')
11
- subcommand('whitelist', Whitelist)
12
- end
13
- end
14
- end
@@ -1,39 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Ipam
3
- #
4
- # SendGrid Web API v3 Ipam Whitelist
5
- #
6
- class Whitelist < SgThor
7
- desc 'list', 'List Whitelisted IPs'
8
- def list
9
- puts @client.get_whitelisted_ips
10
- rescue RestClient::ExceptionWithResponse => e
11
- puts e.inspect
12
- end
13
-
14
- desc 'add', 'Add Whitelisted IPs'
15
- option :ips, type: :array, require: true
16
- def add
17
- puts @client.post_whitelisted_ips(parameterise(options))
18
- rescue RestClient::ExceptionWithResponse => e
19
- puts e.inspect
20
- end
21
-
22
- desc 'delete', 'Delete Whitelisted IPs'
23
- option :ids, type: :array, require: true
24
- def delete
25
- puts @client.delete_whitelisted_ips(parameterise(options))
26
- rescue RestClient::ExceptionWithResponse => e
27
- puts e.inspect
28
- end
29
-
30
- desc 'get', 'Get a Whitelisted IP'
31
- option :rule_id, type: :numeric, require: true
32
- def get
33
- puts @client.get_whitelisted_ip(parameterise(options))
34
- rescue RestClient::ExceptionWithResponse => e
35
- puts e.inspect
36
- end
37
- end
38
- end
39
- end
@@ -1,48 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Ips
3
- #
4
- # SendGrid Web API v3 Ips Address
5
- #
6
- class Address < SgThor
7
- desc 'add_to_pool', 'Add an IP address to a pool'
8
- option :pool_name, require: true
9
- option :ip, require: true
10
- def add_to_pool
11
- puts @client.post_ip_to_pool(parameterise(options))
12
- rescue RestClient::ExceptionWithResponse => e
13
- puts e.inspect
14
- end
15
-
16
- desc 'list', 'List all IP addresses'
17
- def list
18
- puts @client.get_ips
19
- rescue RestClient::ExceptionWithResponse => e
20
- puts e.inspect
21
- end
22
-
23
- desc 'assigned', 'List only assigned IP addresses'
24
- def assigned
25
- puts @client.get_ips_assigned
26
- rescue RestClient::ExceptionWithResponse => e
27
- puts e.inspect
28
- end
29
-
30
- desc 'get', 'Get an IP address'
31
- option :ip, require: true
32
- def get
33
- puts @client.get_ip(parameterise(options))
34
- rescue RestClient::ExceptionWithResponse => e
35
- puts e.inspect
36
- end
37
-
38
- desc 'delete_from_pool', 'Remove an IP address from a pool'
39
- option :pool_name, require: true
40
- option :ip, require: true
41
- def delete_from_pool
42
- puts @client.delete_ip_from_pool(parameterise(options))
43
- rescue RestClient::ExceptionWithResponse => e
44
- puts e.inspect
45
- end
46
- end
47
- end
48
- end
@@ -1,17 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Ips
3
- #
4
- # SendGrid Web API v3 Ips Ip
5
- #
6
- class Ip < SgThor
7
- desc('address SUBCOMMAND ...ARGS', 'Manage IP addresses')
8
- subcommand('address', Address)
9
-
10
- desc('pool SUBCOMMAND ...ARGS', 'Manage IP pools')
11
- subcommand('pool', Pool)
12
-
13
- desc('warmup SUBCOMMAND ...ARGS', 'Manage IP warmup')
14
- subcommand('warmup', Warmup)
15
- end
16
- end
17
- end
@@ -1,48 +0,0 @@
1
- module SendGrid4r::CLI
2
- module Ips
3
- #
4
- # SendGrid Web API v3 Ips Pool
5
- #
6
- class Pool < SgThor
7
- desc 'create', 'Create an IP pool'
8
- option :name, require: true
9
- def create
10
- puts @client.post_pool(parameterise(options))
11
- rescue RestClient::ExceptionWithResponse => e
12
- puts e.inspect
13
- end
14
-
15
- desc 'list', 'List all IP pools'
16
- def list
17
- puts @client.get_pools
18
- rescue RestClient::ExceptionWithResponse => e
19
- puts e.inspect
20
- end
21
-
22
- desc 'get', 'Get an IP pool'
23
- option :name, require: true
24
- def get
25
- puts @client.get_pool(parameterise(options))
26
- rescue RestClient::ExceptionWithResponse => e
27
- puts e.inspect
28
- end
29
-
30
- desc 'rename', 'Rename an IP pool'
31
- option :name, require: true
32
- option :new_name, require: true
33
- def rename
34
- puts @client.put_pool(parameterise(options))
35
- rescue RestClient::ExceptionWithResponse => e
36
- puts e.inspect
37
- end
38
-
39
- desc 'delete', 'Delete an IP pool'
40
- option :name, require: true
41
- def delete
42
- puts @client.delete_pool(parameterise(options))
43
- rescue RestClient::ExceptionWithResponse => e
44
- puts e.inspect
45
- end
46
- end
47
- end
48
- end