Class: SendGrid4r::CLI::ApiKeys::ApiKey

Inherits:
SgThor
  • Object
show all
Defined in:
lib/sendgrid4r/cli/api_keys/api_key.rb

Overview

SendGrid Web API v3 ApiKeys ApiKey

Instance Method Summary collapse

Methods inherited from SgThor

#initialize

Constructor Details

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

Instance Method Details

#createObject



17
18
19
20
21
# File 'lib/sendgrid4r/cli/api_keys/api_key.rb', line 17

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

#deleteObject



33
34
35
36
37
# File 'lib/sendgrid4r/cli/api_keys/api_key.rb', line 33

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

#getObject



25
26
27
28
29
# File 'lib/sendgrid4r/cli/api_keys/api_key.rb', line 25

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

#listObject



8
9
10
11
12
# File 'lib/sendgrid4r/cli/api_keys/api_key.rb', line 8

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

#updateObject



43
44
45
46
47
# File 'lib/sendgrid4r/cli/api_keys/api_key.rb', line 43

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