Class: Coffrify::ApiKeys
- Inherits:
-
Object
- Object
- Coffrify::ApiKeys
- Defined in:
- lib/coffrify/client.rb
Instance Method Summary collapse
- #create(**body) ⇒ Object
-
#initialize(client) ⇒ ApiKeys
constructor
A new instance of ApiKeys.
- #list ⇒ Object
- #revoke(id) ⇒ Object
- #rotate(id, grace_days: 7) ⇒ Object
Constructor Details
#initialize(client) ⇒ ApiKeys
Returns a new instance of ApiKeys.
133 |
# File 'lib/coffrify/client.rb', line 133 def initialize(client); @c = client; end |
Instance Method Details
#create(**body) ⇒ Object
135 |
# File 'lib/coffrify/client.rb', line 135 def create(**body); @c.request(:post, "/api-keys", body: body); end |
#list ⇒ Object
134 |
# File 'lib/coffrify/client.rb', line 134 def list; @c.request(:get, "/api-keys"); end |
#revoke(id) ⇒ Object
136 |
# File 'lib/coffrify/client.rb', line 136 def revoke(id); @c.request(:delete, "/api-keys/#{escape(id)}"); end |
#rotate(id, grace_days: 7) ⇒ Object
137 138 139 |
# File 'lib/coffrify/client.rb', line 137 def rotate(id, grace_days: 7) @c.request(:post, "/api-keys/#{escape(id)}/rotate", body: { grace_days: grace_days }) end |