Class: SendGrid4r::CLI::Suppressions::Bounce

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

Overview

SendGrid Web API v3 Suppressions Bounce

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



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/sendgrid4r/cli/suppressions/bounce.rb', line 20

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

#getObject



34
35
36
37
38
# File 'lib/sendgrid4r/cli/suppressions/bounce.rb', line 34

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

#listObject



10
11
12
13
14
# File 'lib/sendgrid4r/cli/suppressions/bounce.rb', line 10

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