Class: Sendly::WebhookMessageData
- Inherits:
-
Object
- Object
- Sendly::WebhookMessageData
- Defined in:
- lib/sendly/webhooks.rb
Instance Attribute Summary collapse
-
#batch_id ⇒ Object
readonly
Returns the value of attribute batch_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#credits_used ⇒ Object
readonly
Returns the value of attribute credits_used.
-
#delivered_at ⇒ Object
readonly
Returns the value of attribute delivered_at.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#failed_at ⇒ Object
readonly
Returns the value of attribute failed_at.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#media_urls ⇒ Object
readonly
Returns the value of attribute media_urls.
-
#message_format ⇒ Object
readonly
Returns the value of attribute message_format.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
-
#retry_count ⇒ Object
readonly
Returns the value of attribute retry_count.
-
#segments ⇒ Object
readonly
Returns the value of attribute segments.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(data) ⇒ WebhookMessageData
constructor
A new instance of WebhookMessageData.
- #message_id ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ WebhookMessageData
Returns a new instance of WebhookMessageData.
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/sendly/webhooks.rb', line 201 def initialize(data) @id = data[:id] || data[:message_id] || '' @status = data[:status] @to = data[:to] @from = data[:from] || '' @direction = data[:direction] || 'outbound' @organization_id = data[:organization_id] @text = data[:text] @error = data[:error] @error_code = data[:error_code] @delivered_at = data[:delivered_at] @failed_at = data[:failed_at] @created_at = data[:created_at] @segments = data[:segments] || 1 @credits_used = data[:credits_used] || 0 @message_format = data[:message_format] @media_urls = data[:media_urls] @retry_count = data[:retry_count] @metadata = data[:metadata] @batch_id = data[:batch_id] end |
Instance Attribute Details
#batch_id ⇒ Object (readonly)
Returns the value of attribute batch_id.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def batch_id @batch_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def created_at @created_at end |
#credits_used ⇒ Object (readonly)
Returns the value of attribute credits_used.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def credits_used @credits_used end |
#delivered_at ⇒ Object (readonly)
Returns the value of attribute delivered_at.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def delivered_at @delivered_at end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def direction @direction end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def error @error end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def error_code @error_code end |
#failed_at ⇒ Object (readonly)
Returns the value of attribute failed_at.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def failed_at @failed_at end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def from @from end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def id @id end |
#media_urls ⇒ Object (readonly)
Returns the value of attribute media_urls.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def media_urls @media_urls end |
#message_format ⇒ Object (readonly)
Returns the value of attribute message_format.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def @message_format end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def @metadata end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def organization_id @organization_id end |
#retry_count ⇒ Object (readonly)
Returns the value of attribute retry_count.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def retry_count @retry_count end |
#segments ⇒ Object (readonly)
Returns the value of attribute segments.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def segments @segments end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def status @status end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def text @text end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
196 197 198 |
# File 'lib/sendly/webhooks.rb', line 196 def to @to end |
Instance Method Details
#message_id ⇒ Object
223 224 225 |
# File 'lib/sendly/webhooks.rb', line 223 def @id end |
#to_h ⇒ Object
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/sendly/webhooks.rb', line 227 def to_h { id: @id, status: @status, to: @to, from: @from, direction: @direction, error: @error, error_code: @error_code, delivered_at: @delivered_at, failed_at: @failed_at, segments: @segments, credits_used: @credits_used, batch_id: @batch_id }.compact end |