Class: Openlayer::Resources::Workspaces::APIKeys

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ APIKeys

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of APIKeys.

Parameters:



34
35
36
# File 'lib/openlayer/resources/workspaces/api_keys.rb', line 34

def initialize(client:)
  @client = client
end

Instance Method Details

#create(workspace_id, name: nil, request_options: {}) ⇒ Openlayer::Models::Workspaces::APIKeyCreateResponse

Create a new API key in a workspace.

Parameters:

  • workspace_id (String)

    The workspace id.

  • name (String, nil)

    The API key name.

  • request_options (Openlayer::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



20
21
22
23
24
25
26
27
28
29
# File 'lib/openlayer/resources/workspaces/api_keys.rb', line 20

def create(workspace_id, params = {})
  parsed, options = Openlayer::Workspaces::APIKeyCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["workspaces/%1$s/api-keys", workspace_id],
    body: parsed,
    model: Openlayer::Models::Workspaces::APIKeyCreateResponse,
    options: options
  )
end