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.
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/sendly/webhooks.rb', line 185 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.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def batch_id @batch_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def created_at @created_at end |
#credits_used ⇒ Object (readonly)
Returns the value of attribute credits_used.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def credits_used @credits_used end |
#delivered_at ⇒ Object (readonly)
Returns the value of attribute delivered_at.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def delivered_at @delivered_at end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def direction @direction end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def error @error end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def error_code @error_code end |
#failed_at ⇒ Object (readonly)
Returns the value of attribute failed_at.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def failed_at @failed_at end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def from @from end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def id @id end |
#media_urls ⇒ Object (readonly)
Returns the value of attribute media_urls.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def media_urls @media_urls end |
#message_format ⇒ Object (readonly)
Returns the value of attribute message_format.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def @message_format end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def @metadata end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def organization_id @organization_id end |
#retry_count ⇒ Object (readonly)
Returns the value of attribute retry_count.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def retry_count @retry_count end |
#segments ⇒ Object (readonly)
Returns the value of attribute segments.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def segments @segments end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def status @status end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def text @text end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
180 181 182 |
# File 'lib/sendly/webhooks.rb', line 180 def to @to end |
Instance Method Details
#message_id ⇒ Object
207 208 209 |
# File 'lib/sendly/webhooks.rb', line 207 def @id end |
#to_h ⇒ Object
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/sendly/webhooks.rb', line 211 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 |