Class: A2A::Types::TaskPushNotificationConfig
- Defined in:
- lib/a2a/types/push_notification.rb
Overview
Represents a task-specific push notification configuration
Links a task to a push notification configuration for receiving updates about that specific task.
Instance Attribute Summary collapse
-
#push_notification_config ⇒ Object
readonly
Returns the value of attribute push_notification_config.
-
#task_id ⇒ Object
readonly
Returns the value of attribute task_id.
Instance Method Summary collapse
-
#auth_headers ⇒ Hash
Get authentication headers.
-
#authenticated? ⇒ Boolean
Check if authentication is configured.
-
#initialize(task_id:, push_notification_config:) ⇒ TaskPushNotificationConfig
constructor
Initialize a new task push notification config.
- #validate! ⇒ Object private
-
#webhook_url ⇒ String
Get the webhook URL.
Methods inherited from BaseModel
#==, #camelize, from_h, from_json, #hash, #to_h, #to_json, underscore, #valid?, #validate_array_type, #validate_inclusion, #validate_required, #validate_type
Constructor Details
#initialize(task_id:, push_notification_config:) ⇒ TaskPushNotificationConfig
Initialize a new task push notification config
95 96 97 98 99 100 101 102 103 104 |
# File 'lib/a2a/types/push_notification.rb', line 95 def initialize(task_id:, push_notification_config:) @task_id = task_id @push_notification_config = if push_notification_config.is_a?(PushNotificationConfig) push_notification_config else PushNotificationConfig.from_h(push_notification_config) end validate! end |
Instance Attribute Details
#push_notification_config ⇒ Object (readonly)
Returns the value of attribute push_notification_config.
88 89 90 |
# File 'lib/a2a/types/push_notification.rb', line 88 def push_notification_config @push_notification_config end |
#task_id ⇒ Object (readonly)
Returns the value of attribute task_id.
88 89 90 |
# File 'lib/a2a/types/push_notification.rb', line 88 def task_id @task_id end |
Instance Method Details
#auth_headers ⇒ Hash
Get authentication headers
118 119 120 |
# File 'lib/a2a/types/push_notification.rb', line 118 def auth_headers @push_notification_config.auth_headers end |
#authenticated? ⇒ Boolean
Check if authentication is configured
126 127 128 |
# File 'lib/a2a/types/push_notification.rb', line 126 def authenticated? @push_notification_config.authenticated? end |
#validate! ⇒ Object (private)
132 133 134 135 136 |
# File 'lib/a2a/types/push_notification.rb', line 132 def validate! validate_required(:task_id, :push_notification_config) validate_type(:task_id, String) validate_type(:push_notification_config, PushNotificationConfig) end |
#webhook_url ⇒ String
Get the webhook URL
110 111 112 |
# File 'lib/a2a/types/push_notification.rb', line 110 def webhook_url @push_notification_config.url end |