Class: BrickFTP::RESTfulAPI::CreatePublicKey
- Inherits:
-
Object
- Object
- BrickFTP::RESTfulAPI::CreatePublicKey
- Includes:
- Command
- Defined in:
- lib/brick_ftp/restful_api/create_public_key.rb
Overview
Create a public key
Params
PARAMETER | TYPE | DESCRIPTION |
---|---|---|
title | string | Title to identify the public key. For your reference. Maximum of 50 characters. |
public_key | string | The public key itself. This property is write-only. It cannot be retrieved via the API. |
Defined Under Namespace
Classes: Params
Instance Method Summary collapse
-
#call(id, params) ⇒ BrickFTP::Types::UserPublicKey
Creates a new public key for a user on the current site.
Methods included from Command
Instance Method Details
#call(id, params) ⇒ BrickFTP::Types::UserPublicKey
Creates a new public key for a user on the current site.
35 36 37 38 39 |
# File 'lib/brick_ftp/restful_api/create_public_key.rb', line 35 def call(id, params) res = client.post("/api/rest/v1/users/#{id}/public_keys.json", params.to_h.compact) BrickFTP::Types::UserPublicKey.new(**res.symbolize_keys) end |