Class: Cadenya::Resources::Objectives::Tools

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/resources/objectives/tools.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Tools

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 Tools.

Parameters:



47
48
49
# File 'lib/cadenya/resources/objectives/tools.rb', line 47

def initialize(client:)
  @client = client
end

Instance Method Details

#list(objective_id, workspace_id:, cursor: nil, limit: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::Objectives::ObjectiveTool>

Some parameter documentations has been truncated, see Models::Objectives::ToolListParams for more details.

Lists all tools that were assigned to an objective

Parameters:

  • objective_id (String)

    Path param: The ID of the objective. Supports “external_id:” prefix for external

  • workspace_id (String)

    Path param

  • cursor (String)

    Query param: Pagination cursor from previous response

  • limit (Integer)

    Query param: Maximum number of results to return

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

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/cadenya/resources/objectives/tools.rb', line 27

def list(objective_id, params)
  parsed, options = Cadenya::Objectives::ToolListParams.dump_request(params)
  query = Cadenya::Internal::Util.encode_query_params(parsed)
  workspace_id =
    parsed.delete(:workspace_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["v1/workspaces/%1$s/objectives/%2$s/tools", workspace_id, objective_id],
    query: query,
    page: Cadenya::Internal::CursorPagination,
    model: Cadenya::Objectives::ObjectiveTool,
    options: options
  )
end