Class: SendGrid4r::CLI::Suppressions::SpamReport

Inherits:
SendGrid4r::CLI::SgThor show all
Defined in:
lib/sendgrid4r/cli/suppressions/spam_report.rb

Overview

SendGrid Web API v3 Suppressions SpamReport

Instance Method Summary collapse

Methods inherited from SendGrid4r::CLI::SgThor

#initialize

Constructor Details

This class inherits a constructor from SendGrid4r::CLI::SgThor

Instance Method Details

#deleteObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/sendgrid4r/cli/suppressions/spam_report.rb', line 22

def delete
  if options[:email]
    @client.delete_spam_report(email: options[:email])
  else
    @client.delete_spam_reports(
      delete_all: options[:delete_all], emails: options[:emails]
    )
  end
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end

#getObject



36
37
38
39
40
# File 'lib/sendgrid4r/cli/suppressions/spam_report.rb', line 36

def get
  puts @client.get_spam_report(parameterise(options))
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end

#listObject



12
13
14
15
16
# File 'lib/sendgrid4r/cli/suppressions/spam_report.rb', line 12

def list
  puts @client.get_spam_reports(parameterise(options))
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end