Class: A2A::Operation::ListTaskPushNotificationConfigs

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

Defined Under Namespace

Classes: Response

Constant Summary collapse

METHOD =
"ListTaskPushNotificationConfigs"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Executable

#execute

Constructor Details

#initialize(task_id:, page_size: nil, page_token: nil, tenant: nil) ⇒ ListTaskPushNotificationConfigs

Returns a new instance of ListTaskPushNotificationConfigs.



12
13
14
15
16
17
# File 'lib/a2a/operation/list_task_push_notification_configs.rb', line 12

def initialize(task_id:, page_size: nil, page_token: nil, tenant: nil)
  @task_id = task_id
  @page_size = page_size
  @page_token = page_token
  @tenant = tenant
end

Instance Attribute Details

#page_sizeObject (readonly)

Returns the value of attribute page_size.



10
11
12
# File 'lib/a2a/operation/list_task_push_notification_configs.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_task_push_notification_configs.rb', line 10

def page_token
  @page_token
end

#task_idObject (readonly)

Returns the value of attribute task_id.



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

def task_id
  @task_id
end

#tenantObject (readonly)

Returns the value of attribute tenant.



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

def tenant
  @tenant
end

Instance Method Details

#execute_http_json(protocol) ⇒ Object



26
27
28
29
# File 'lib/a2a/operation/list_task_push_notification_configs.rb', line 26

def execute_http_json(protocol)
  query = { "pageSize" => page_size, "pageToken" => page_token }.compact
  Response.from_h(protocol.get("/tasks/#{task_id}/pushNotificationConfigs", query: query))
end

#execute_json_rpc(protocol) ⇒ Object



19
20
21
22
23
24
# File 'lib/a2a/operation/list_task_push_notification_configs.rb', line 19

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



31
32
33
34
35
36
37
38
# File 'lib/a2a/operation/list_task_push_notification_configs.rb', line 31

def params
  {
    "taskId" => task_id,
    "pageSize" => page_size,
    "pageToken" => page_token,
    "tenant" => tenant
  }.compact
end