Class: Cadenya::Resources::Agents::WebhookDeliveries

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/resources/agents/webhook_deliveries.rb

Overview

Manage AI agents within a workspace. Agents define AI behavior and tool access.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ WebhookDeliveries

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

Parameters:



49
50
51
# File 'lib/cadenya/resources/agents/webhook_deliveries.rb', line 49

def initialize(client:)
  @client = client
end

Instance Method Details

#list(agent_id, workspace_id:, cursor: nil, event_type: nil, limit: nil, objective_id: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::Agents::WebhookDelivery>

Lists all webhook deliveries for an agent

Parameters:

  • agent_id (String)

    Path param

  • workspace_id (String)

    Path param: Workspace ID.

  • cursor (String)

    Query param: Pagination cursor from previous response

  • event_type (Symbol, Cadenya::Models::Agents::WebhookDeliveryListParams::EventType)

    Query param: Optional filter by event type

  • limit (Integer)

    Query param: Maximum number of results to return

  • objective_id (String)

    Query param: Optional filter by objective ID

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

Returns:

See Also:



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/cadenya/resources/agents/webhook_deliveries.rb', line 29

def list(agent_id, params)
  parsed, options = Cadenya::Agents::WebhookDeliveryListParams.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/agents/%2$s/webhook_deliveries", workspace_id, agent_id],
    query: query.transform_keys(event_type: "eventType", objective_id: "objectiveId"),
    page: Cadenya::Internal::CursorPagination,
    model: Cadenya::Agents::WebhookDelivery,
    options: options
  )
end