Class: Superbot::Cloud::CLI::Token::GenerateCommand

Inherits:
BaseCommand show all
Defined in:
lib/superbot/cloud/cli/token/generate_command.rb

Instance Method Summary collapse

Methods inherited from LoginRequiredCommand

#run, run

Methods included from Validations

#require_login

Instance Method Details

#executeObject



10
11
12
# File 'lib/superbot/cloud/cli/token/generate_command.rb', line 10

def execute
  generate_token
end

#generate_tokenObject



14
15
16
17
# File 'lib/superbot/cloud/cli/token/generate_command.rb', line 14

def generate_token
  api_response = Superbot::Cloud::Api.request(:create_access_token, params: { organization_name: organization, name: name })
  puts api_response[:token]
end