Class: Posthubify::ApiKeysResource
- Inherits:
-
Object
- Object
- Posthubify::ApiKeysResource
- Defined in:
- lib/posthubify/resources/platform.rb
Overview
API keys (Node sdk .apiKeys).
Instance Method Summary collapse
-
#create(input) ⇒ Object
Create a new key — the full key is returned ONLY in this response.
-
#delete(id) ⇒ Object
Delete a key.
-
#initialize(http) ⇒ ApiKeysResource
constructor
A new instance of ApiKeysResource.
-
#list ⇒ Object
List API keys.
Constructor Details
#initialize(http) ⇒ ApiKeysResource
Returns a new instance of ApiKeysResource.
43 44 45 |
# File 'lib/posthubify/resources/platform.rb', line 43 def initialize(http) @http = http end |
Instance Method Details
#create(input) ⇒ Object
Create a new key — the full key is returned ONLY in this response.
53 54 55 |
# File 'lib/posthubify/resources/platform.rb', line 53 def create(input) @http.data('POST', '/api-keys', body: input) end |
#delete(id) ⇒ Object
Delete a key.
58 59 60 |
# File 'lib/posthubify/resources/platform.rb', line 58 def delete(id) @http.data('DELETE', "/api-keys/#{id}") end |
#list ⇒ Object
List API keys.
48 49 50 |
# File 'lib/posthubify/resources/platform.rb', line 48 def list @http.data('GET', '/api-keys') end |