Class: SendGrid4r::CLI::User

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

Overview

SendGrid Web API v3 User

Instance Method Summary collapse

Methods inherited from SgThor

#initialize

Constructor Details

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

Instance Method Details

#account(action) ⇒ Object



31
32
33
34
35
36
37
38
39
40
# File 'lib/sendgrid4r/cli/user.rb', line 31

def (action)
  case action
  when 'get'
    puts @client.
  else
    puts "error: #{action} is not supported in action parameter"
  end
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end

#email(action) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/sendgrid4r/cli/user.rb', line 44

def email(action)
  case action
  when 'get'
    puts @client.get_user_email
  when 'update'
    puts @client.put_user_email(parameterise(options))
  else
    puts "error: #{action} is not supported in action parameter"
  end
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end

#password(action) ⇒ Object



75
76
77
78
79
80
81
82
83
84
# File 'lib/sendgrid4r/cli/user.rb', line 75

def password(action)
  case action
  when 'update'
    puts @client.put_user_password(parameterise(options))
  else
    puts "error: #{action} is not supported in action parameter"
  end
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end

#profile(action) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/sendgrid4r/cli/user.rb', line 17

def profile(action)
  case action
  when 'get'
    puts @client.
  when 'update'
    puts @client.(params: parameterise(options))
  else
    puts "error: #{action} is not supported in action parameter"
  end
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end

#username(action) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/sendgrid4r/cli/user.rb', line 59

def username(action)
  case action
  when 'get'
    puts @client.get_user_username
  when 'update'
    puts @client.put_user_username(parameterise(options))
  else
    puts "error: #{action} is not supported in action parameter"
  end
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end