Class: MessageMediaMessages::DeliveryReport
- Defined in:
- lib/message_media_messages/models/delivery_report.rb
Overview
DeliveryReport Model.
Instance Attribute Summary collapse
-
#callback_url ⇒ String
The URL specified as the callback URL in the original submit message request.
-
#date_received ⇒ DateTime
The date and time at which this delivery report was generated in UTC.
-
#delay ⇒ Integer
Deprecated, no longer in use.
-
#delivery_report_id ⇒ UUID | String
Unique ID for this delivery report.
-
#message_id ⇒ UUID | String
Unique ID of the original message.
-
#metadata ⇒ Object
Any metadata that was included in the original submit message request.
-
#original_text ⇒ String
Text of the original message.
-
#source_number ⇒ String
Address from which this delivery report was received.
-
#status ⇒ Status2Enum
The status of the message as per the delivery report.
-
#submitted_date ⇒ DateTime
The date and time when the message status changed in UTC.
-
#vendor_account_id ⇒ VendorAccountId
The date and time when the message status changed in UTC.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(callback_url = nil, date_received = nil, delay = nil, delivery_report_id = nil, message_id = nil, metadata = nil, original_text = nil, source_number = nil, status = nil, submitted_date = nil, vendor_account_id = nil) ⇒ DeliveryReport
constructor
A new instance of DeliveryReport.
Methods inherited from BaseModel
Constructor Details
#initialize(callback_url = nil, date_received = nil, delay = nil, delivery_report_id = nil, message_id = nil, metadata = nil, original_text = nil, source_number = nil, status = nil, submitted_date = nil, vendor_account_id = nil) ⇒ DeliveryReport
Returns a new instance of DeliveryReport.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 76 def initialize(callback_url = nil, date_received = nil, delay = nil, delivery_report_id = nil, = nil, = nil, original_text = nil, source_number = nil, status = nil, submitted_date = nil, vendor_account_id = nil) @callback_url = callback_url @date_received = date_received @delay = delay @delivery_report_id = delivery_report_id @message_id = @metadata = @original_text = original_text @source_number = source_number @status = status @submitted_date = submitted_date @vendor_account_id = vendor_account_id end |
Instance Attribute Details
#callback_url ⇒ String
The URL specified as the callback URL in the original submit message request
13 14 15 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 13 def callback_url @callback_url end |
#date_received ⇒ DateTime
The date and time at which this delivery report was generated in UTC.
17 18 19 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 17 def date_received @date_received end |
#delay ⇒ Integer
Deprecated, no longer in use
21 22 23 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 21 def delay @delay end |
#delivery_report_id ⇒ UUID | String
Unique ID for this delivery report
25 26 27 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 25 def delivery_report_id @delivery_report_id end |
#message_id ⇒ UUID | String
Unique ID of the original message
29 30 31 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 29 def @message_id end |
#metadata ⇒ Object
Any metadata that was included in the original submit message request
33 34 35 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 33 def @metadata end |
#original_text ⇒ String
Text of the original message.
37 38 39 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 37 def original_text @original_text end |
#source_number ⇒ String
Address from which this delivery report was received
41 42 43 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 41 def source_number @source_number end |
#status ⇒ Status2Enum
The status of the message as per the delivery report
45 46 47 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 45 def status @status end |
#submitted_date ⇒ DateTime
The date and time when the message status changed in UTC. For a delivered DR this may indicate the time at which the message was received on the handset.
51 52 53 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 51 def submitted_date @submitted_date end |
#vendor_account_id ⇒ VendorAccountId
The date and time when the message status changed in UTC. For a delivered DR this may indicate the time at which the message was received on the handset.
57 58 59 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 57 def vendor_account_id @vendor_account_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 101 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. callback_url = hash['callback_url'] date_received = APIHelper.rfc3339(hash['date_received']) if hash['date_received'] delay = hash['delay'] delivery_report_id = hash['delivery_report_id'] = hash['message_id'] = hash['metadata'] original_text = hash['original_text'] source_number = hash['source_number'] status = hash['status'] submitted_date = APIHelper.rfc3339(hash['submitted_date']) if hash['submitted_date'] if hash['vendor_account_id'] vendor_account_id = VendorAccountId.from_hash(hash['vendor_account_id']) end # Create object from extracted values. DeliveryReport.new(callback_url, date_received, delay, delivery_report_id, , , original_text, source_number, status, submitted_date, vendor_account_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/message_media_messages/models/delivery_report.rb', line 60 def self.names @_hash = {} if @_hash.nil? @_hash['callback_url'] = 'callback_url' @_hash['date_received'] = 'date_received' @_hash['delay'] = 'delay' @_hash['delivery_report_id'] = 'delivery_report_id' @_hash['message_id'] = 'message_id' @_hash['metadata'] = 'metadata' @_hash['original_text'] = 'original_text' @_hash['source_number'] = 'source_number' @_hash['status'] = 'status' @_hash['submitted_date'] = 'submitted_date' @_hash['vendor_account_id'] = 'vendor_account_id' @_hash end |