Class: Exa::Resources::AgentRunEventList

Inherits:
Struct
  • Object
show all
Defined in:
lib/exa/resources/agent_run_event_list.rb

Overview

Paginated collection of agent run events. Mirrors AgentRunList's data/has_more/next_cursor shape; event items are kept as plain hashes (the API returns event, data, createdAt per event).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, has_more: false, next_cursor: nil) ⇒ AgentRunEventList

Returns a new instance of AgentRunEventList.



7
8
9
10
# File 'lib/exa/resources/agent_run_event_list.rb', line 7

def initialize(data:, has_more: false, next_cursor: nil)
  super
  freeze
end

Instance Attribute Details

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



6
7
8
# File 'lib/exa/resources/agent_run_event_list.rb', line 6

def data
  @data
end

#has_moreObject

Returns the value of attribute has_more

Returns:

  • (Object)

    the current value of has_more



6
7
8
# File 'lib/exa/resources/agent_run_event_list.rb', line 6

def has_more
  @has_more
end

#next_cursorObject

Returns the value of attribute next_cursor

Returns:

  • (Object)

    the current value of next_cursor



6
7
8
# File 'lib/exa/resources/agent_run_event_list.rb', line 6

def next_cursor
  @next_cursor
end

Instance Method Details

#to_hObject



12
13
14
15
16
17
18
# File 'lib/exa/resources/agent_run_event_list.rb', line 12

def to_h
  {
    data: data.map { |item| item.respond_to?(:to_h) ? item.to_h : item },
    has_more: has_more,
    next_cursor: next_cursor
  }
end