lib/sendgrid4r/rest/settings/mail.rb in sendgrid4r-1.5.1 vs lib/sendgrid4r/rest/settings/mail.rb in sendgrid4r-1.6.0

- old
+ new

@@ -34,26 +34,10 @@ BouncePurge.new( resp['enabled'], resp['hard_bounces'], resp['soft_bounces'] ) end - EventNotification = Struct.new( - :enabled, :url, :group_resubscribe, :delivered, :group_unsubscribe, - :spam_report, :bounce, :deferred, :unsubscribe, :processed, :open, - :click, :dropped - ) - - def self.create_event_notification(resp) - return resp if resp.nil? - EventNotification.new( - resp['enabled'], resp['url'], resp['group_resubscribe'], - resp['delivered'], resp['group_unsubscribe'], resp['spam_report'], - resp['bounce'], resp['deferred'], resp['unsubscribe'], - resp['processed'], resp['open'], resp['click'], resp['dropped'] - ) - end - Footer = Struct.new(:enabled, :html_content, :plain_content) def self.create_footer(resp) return resp if resp.nil? Footer.new( @@ -93,14 +77,10 @@ url = "#{BASE_URL}/mail_settings" url = "#{url}/#{name}" unless name.nil? url end - def self.url_event(path) - "#{BASE_URL}/user/webhooks/event/#{path}" - end - def get_mail_settings(limit: nil, offset: nil, &block) params = {} params['limit'] = limit unless limit.nil? params['offset'] = offset unless offset.nil? endpoint = SendGrid4r::REST::Settings::Mail.url @@ -140,28 +120,9 @@ def patch_settings_bounce_purge(params:, &block) endpoint = SendGrid4r::REST::Settings::Mail.url('bounce_purge') resp = patch(@auth, endpoint, params.to_h, &block) SendGrid4r::REST::Settings::Mail.create_bounce_purge(resp) - end - - def get_settings_event_notification(&block) - endpoint = SendGrid4r::REST::Settings::Mail.url_event('settings') - resp = get(@auth, endpoint, &block) - SendGrid4r::REST::Settings::Mail.create_event_notification(resp) - end - - def patch_settings_event_notification(params:, &block) - endpoint = SendGrid4r::REST::Settings::Mail.url_event('settings') - resp = patch(@auth, endpoint, params.to_h, &block) - SendGrid4r::REST::Settings::Mail.create_event_notification(resp) - end - - def test_settings_event_notification(url:, &block) - params = {} - params['url'] = url - endpoint = SendGrid4r::REST::Settings::Mail.url_event('test') - post(@auth, endpoint, params, &block) end def get_settings_footer(&block) endpoint = SendGrid4r::REST::Settings::Mail.url('footer') resp = get(@auth, endpoint, &block)