Class: BrickFTP::RESTfulAPI::ListPublicKeys

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

Overview

List public keys

See Also:

Instance Method Summary collapse

Methods included from Command

included, #initialize

Instance Method Details

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

Returns a list of all public 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_public_keys.rb', line 19

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

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