Class: Certynix::Resources::ApiKeys

Inherits:
Object
  • Object
show all
Defined in:
lib/certynix/resources/api_keys.rb

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ ApiKeys

Returns a new instance of ApiKeys.



6
7
8
# File 'lib/certynix/resources/api_keys.rb', line 6

def initialize(http)
  @http = http
end

Instance Method Details

#create(name:) ⇒ Object



10
11
12
# File 'lib/certynix/resources/api_keys.rb', line 10

def create(name:)
  @http.post('/v1/api-keys', { name: name })
end

#list(**params) ⇒ Object



14
15
16
# File 'lib/certynix/resources/api_keys.rb', line 14

def list(**params)
  Models::Paginator.new(http: @http, path: '/v1/api-keys', params: params)
end

#revoke(id) ⇒ Object



18
19
20
# File 'lib/certynix/resources/api_keys.rb', line 18

def revoke(id)
  @http.delete("/v1/api-keys/#{URI.encode_www_form_component(id)}")
end