Class: BrickFTP::RESTfulAPI::CreateAPIKey
- Inherits:
-
Object
- Object
- BrickFTP::RESTfulAPI::CreateAPIKey
- Includes:
- Command
- Defined in:
- lib/brick_ftp/restful_api/create_api_key.rb
Overview
Create an API key
Params
PARAMETER | TYPE | DESCRIPTION |
---|---|---|
name | string | Name to identify the user API key. For your reference. Maximum of 100 characters. |
permission_set | string | The permission set for the user API key. Can be desktop_app or full. |
platform | string | The platform for the user API key. Can be win32, macos, linux, or none. Applies only to API keys with a permission_set of desktop_app. |
expires_at | datetime | The date that this API key is valid through. |
Defined Under Namespace
Classes: Params
Instance Method Summary collapse
-
#call(id, params) ⇒ BrickFTP::Types::UserAPIKey
Creates a new API key for a user on the current site.
Methods included from Command
Instance Method Details
#call(id, params) ⇒ BrickFTP::Types::UserAPIKey
Creates a new API key for a user on the current site.
39 40 41 42 43 |
# File 'lib/brick_ftp/restful_api/create_api_key.rb', line 39 def call(id, params) res = client.post("/api/rest/v1/users/#{id}/api_keys.json", params.to_h.compact) BrickFTP::Types::UserAPIKey.new(**res.symbolize_keys) end |