Class: A2A::Operation::ListTasks

Inherits:
Object
  • Object
show all
Includes:
Executable
Defined in:
lib/a2a/operation/list_tasks.rb

Defined Under Namespace

Classes: Response

Constant Summary collapse

METHOD =
"ListTasks"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Executable

#execute

Constructor Details

#initialize(**kwargs) ⇒ ListTasks

Returns a new instance of ListTasks.



13
14
15
16
17
18
19
20
21
22
# File 'lib/a2a/operation/list_tasks.rb', line 13

def initialize(**kwargs)
  @context_id = kwargs[:context_id]
  @status = kwargs[:status]
  @page_size = kwargs[:page_size]
  @page_token = kwargs[:page_token]
  @history_length = kwargs[:history_length]
  @status_timestamp_after = kwargs[:status_timestamp_after]
  @include_artifacts = kwargs[:include_artifacts]
  @tenant = kwargs[:tenant]
end

Instance Attribute Details

#context_idObject (readonly)

Returns the value of attribute context_id.



10
11
12
# File 'lib/a2a/operation/list_tasks.rb', line 10

def context_id
  @context_id
end

#history_lengthObject (readonly)

Returns the value of attribute history_length.



10
11
12
# File 'lib/a2a/operation/list_tasks.rb', line 10

def history_length
  @history_length
end

#include_artifactsObject (readonly)

Returns the value of attribute include_artifacts.



10
11
12
# File 'lib/a2a/operation/list_tasks.rb', line 10

def include_artifacts
  @include_artifacts
end

#page_sizeObject (readonly)

Returns the value of attribute page_size.



10
11
12
# File 'lib/a2a/operation/list_tasks.rb', line 10

def page_size
  @page_size
end

#page_tokenObject (readonly)

Returns the value of attribute page_token.



10
11
12
# File 'lib/a2a/operation/list_tasks.rb', line 10

def page_token
  @page_token
end

#statusObject (readonly)

Returns the value of attribute status.



10
11
12
# File 'lib/a2a/operation/list_tasks.rb', line 10

def status
  @status
end

#status_timestamp_afterObject (readonly)

Returns the value of attribute status_timestamp_after.



10
11
12
# File 'lib/a2a/operation/list_tasks.rb', line 10

def status_timestamp_after
  @status_timestamp_after
end

#tenantObject (readonly)

Returns the value of attribute tenant.



10
11
12
# File 'lib/a2a/operation/list_tasks.rb', line 10

def tenant
  @tenant
end

Instance Method Details

#execute_http_json(protocol) ⇒ Object



31
32
33
# File 'lib/a2a/operation/list_tasks.rb', line 31

def execute_http_json(protocol)
  Response.from_h(protocol.get("/tasks", query: params))
end

#execute_json_rpc(protocol) ⇒ Object



24
25
26
27
28
29
# File 'lib/a2a/operation/list_tasks.rb', line 24

def execute_json_rpc(protocol)
  raw = protocol.post(METHOD, params)
  raise A2A.from_json_rpc_error(raw["error"]) if raw["error"]

  Response.from_h(Hash(raw["result"]))
end

#paramsObject



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/a2a/operation/list_tasks.rb', line 35

def params
  {
    "contextId" => context_id,
    "status" => status,
    "pageSize" => page_size,
    "pageToken" => page_token,
    "historyLength" => history_length,
    "statusTimestampAfter" => status_timestamp_after,
    "includeArtifacts" => include_artifacts,
    "tenant" => tenant
  }.compact
end