Class: BrickFTP::RESTfulAPI::ListAPIKeys

Inherits:
Object
  • Object
show all
Includes:
Command
Defined in:
lib/brick_ftp/restful_api/list_api_keys.rb

Overview

List API keys

See Also:

Instance Method Summary collapse

Methods included from Command

included, #initialize

Instance Method Details

#call(id) ⇒ Array<BrickFTP::Types::UserAPIKey>

Returns a list of all API keys for a user on the current site.

Parameters:

  • id (Integer)

    Globally unique identifier of each user. Each user is given an ID automatically upon creation.

Returns:



19
20
21
22
23
# File 'lib/brick_ftp/restful_api/list_api_keys.rb', line 19

def call(id)
  res = client.get("/api/rest/v1/users/#{id}/api_keys.json")

  res.map { |i| BrickFTP::Types::UserAPIKey.new(**i.symbolize_keys) }
end