Class: SendGrid4r::CLI::Webhooks::Event
- Inherits:
-
SgThor
- Object
- Thor
- SgThor
- SendGrid4r::CLI::Webhooks::Event
show all
- Defined in:
- lib/sendgrid4r/cli/webhooks/event.rb
Overview
SendGrid Web API v3 Webhooks Event
Instance Method Summary
collapse
Methods inherited from SgThor
#initialize
Instance Method Details
#disable ⇒ Object
37
38
39
40
41
42
|
# File 'lib/sendgrid4r/cli/webhooks/event.rb', line 37
def disable
params = { enabled: false }
puts @client.patch_settings_event_notification(params: params)
rescue RestClient::ExceptionWithResponse => e
puts e.inspect
end
|
#enable ⇒ Object
27
28
29
30
31
32
33
34
|
# File 'lib/sendgrid4r/cli/webhooks/event.rb', line 27
def enable
params = parameterise(options)
params[:enabled] = true
event = SendGrid4r::Factory::EventFactory.create(params)
puts @client.patch_settings_event_notification(params: event)
rescue RestClient::ExceptionWithResponse => e
puts e.inspect
end
|
#get ⇒ Object
8
9
10
11
12
|
# File 'lib/sendgrid4r/cli/webhooks/event.rb', line 8
def get
puts @client.get_settings_event_notification
rescue RestClient::ExceptionWithResponse => e
puts e.inspect
end
|
#test ⇒ Object
46
47
48
49
50
|
# File 'lib/sendgrid4r/cli/webhooks/event.rb', line 46
def test
puts @client.test_settings_event_notification(parameterise(options))
rescue RestClient::ExceptionWithResponse => e
puts e.inspect
end
|