Class: SendGrid4r::CLI::Suppressions::Group

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

Overview

SendGrid Web API v3 Suppressions Group

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

#createObject



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

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

#deleteObject



49
50
51
52
53
# File 'lib/sendgrid4r/cli/suppressions/group.rb', line 49

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

#getObject



26
27
28
29
30
# File 'lib/sendgrid4r/cli/suppressions/group.rb', line 26

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

#listObject



18
19
20
21
22
# File 'lib/sendgrid4r/cli/suppressions/group.rb', line 18

def list
  puts @client.get_groups
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end

#updateObject



36
37
38
39
40
41
42
43
44
45
# File 'lib/sendgrid4r/cli/suppressions/group.rb', line 36

def update
  group = parameterise(options)
  group.delete(:group_id)
  puts @client.patch_group(
    group_id: options[:group_id],
    group: group
  )
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end