Class: Zavudev::Resources::Senders::Agent::Executions

Inherits:
Object
  • Object
show all
Defined in:
lib/zavudev/resources/senders/agent/executions.rb,
sig/zavudev/resources/senders/agent/executions.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Executions

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

Parameters:



72
73
74
# File 'lib/zavudev/resources/senders/agent/executions.rb', line 72

def initialize(client:)
  @client = client
end

Instance Method Details

#list(sender_id, cursor: nil, limit: nil, status: nil, request_options: {}) ⇒ Zavudev::Internal::Cursor<Zavudev::Models::Senders::AgentExecution>

List recent agent executions with pagination.

An execution is one inbound message answered by the agent, so this covers the messaging channels only. Voice calls are never listed here regardless of how many the agent handled. Use GET /v1/calls (and GET /v1/calls/{callId} for the transcript) for voice.

Parameters:

Returns:

See Also:



56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/zavudev/resources/senders/agent/executions.rb', line 56

def list(sender_id, params = {})
  parsed, options = Zavudev::Senders::Agent::ExecutionListParams.dump_request(params)
  query = Zavudev::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["v1/senders/%1$s/agent/executions", sender_id],
    query: query,
    page: Zavudev::Internal::Cursor,
    model: Zavudev::Senders::AgentExecution,
    options: options
  )
end

#retrieve(execution_id, sender_id:, request_options: {}) ⇒ Zavudev::Models::Senders::Agent::ExecutionRetrieveResponse

Fetch full details for one execution — including errorMessage, errorCode, and responseText. Use this to debug failures surfaced by the list endpoint.

Parameters:

Returns:

See Also:



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/zavudev/resources/senders/agent/executions.rb', line 20

def retrieve(execution_id, params)
  parsed, options = Zavudev::Senders::Agent::ExecutionRetrieveParams.dump_request(params)
  sender_id =
    parsed.delete(:sender_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["v1/senders/%1$s/agent/executions/%2$s", sender_id, execution_id],
    model: Zavudev::Models::Senders::Agent::ExecutionRetrieveResponse,
    options: options
  )
end