Class: A2A::Operation::ListTaskPushNotificationConfigs::Response

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configs:, next_page_token: nil) ⇒ Response

Returns a new instance of Response.



43
44
45
46
# File 'lib/a2a/operation/list_task_push_notification_configs.rb', line 43

def initialize(configs:, next_page_token: nil)
  @configs = configs
  @next_page_token = next_page_token
end

Instance Attribute Details

#configsObject (readonly)

Returns the value of attribute configs.



41
42
43
# File 'lib/a2a/operation/list_task_push_notification_configs.rb', line 41

def configs
  @configs
end

#next_page_tokenObject (readonly)

Returns the value of attribute next_page_token.



41
42
43
# File 'lib/a2a/operation/list_task_push_notification_configs.rb', line 41

def next_page_token
  @next_page_token
end

Class Method Details

.from_h(hash) ⇒ Object



48
49
50
51
52
53
# File 'lib/a2a/operation/list_task_push_notification_configs.rb', line 48

def self.from_h(hash)
  new(
    configs: Array(hash["configs"]).map { PushNotification::Config.from_h(_1) },
    next_page_token: hash["nextPageToken"]
  )
end

Instance Method Details

#to_hObject



55
56
57
58
59
60
# File 'lib/a2a/operation/list_task_push_notification_configs.rb', line 55

def to_h
  {
    "configs" => configs.map(&:to_h),
    "nextPageToken" => next_page_token
  }.compact
end