Class: A2A::Operation::SendMessage::Configuration

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ Configuration

Returns a new instance of Configuration.



10
11
12
13
14
15
# File 'lib/a2a/operation/send_message/configuration.rb', line 10

def initialize(**kwargs)
  @accepted_output_modes = kwargs[:accepted_output_modes]
  @task_push_notification_config = kwargs[:task_push_notification_config]
  @history_length = kwargs[:history_length]
  @return_immediately = kwargs[:return_immediately]
end

Instance Attribute Details

#accepted_output_modesObject (readonly)

Returns the value of attribute accepted_output_modes.



7
8
9
# File 'lib/a2a/operation/send_message/configuration.rb', line 7

def accepted_output_modes
  @accepted_output_modes
end

#history_lengthObject (readonly)

Returns the value of attribute history_length.



7
8
9
# File 'lib/a2a/operation/send_message/configuration.rb', line 7

def history_length
  @history_length
end

#return_immediatelyObject (readonly)

Returns the value of attribute return_immediately.



7
8
9
# File 'lib/a2a/operation/send_message/configuration.rb', line 7

def return_immediately
  @return_immediately
end

#task_push_notification_configObject (readonly)

Returns the value of attribute task_push_notification_config.



7
8
9
# File 'lib/a2a/operation/send_message/configuration.rb', line 7

def task_push_notification_config
  @task_push_notification_config
end

Class Method Details

.from_h(hash) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/a2a/operation/send_message/configuration.rb', line 17

def self.from_h(hash)
  new(
    accepted_output_modes: hash["acceptedOutputModes"],
    task_push_notification_config: hash["taskPushNotificationConfig"],
    history_length: hash["historyLength"],
    return_immediately: hash["returnImmediately"]
  )
end

Instance Method Details

#to_hObject



26
27
28
29
30
31
32
33
34
35
# File 'lib/a2a/operation/send_message/configuration.rb', line 26

def to_h
  push_config = task_push_notification_config
  push_config = push_config.to_h if push_config.is_a?(PushNotification::Config)
  {
    "acceptedOutputModes" => accepted_output_modes,
    "taskPushNotificationConfig" => push_config,
    "historyLength" => history_length,
    "returnImmediately" => return_immediately
  }.compact
end