messagemedia_messages_sdk 2.0.0 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c1967fd352134b073366c5ebcc98c1fb88800fe5
4
- data.tar.gz: 3c457dc2d431cb3f3ff1e3d41a824ff3069233c5
2
+ SHA256:
3
+ metadata.gz: c8527f0518f2fce65163b962423d3767eadf961ab31a5ea364692cafb0f8ccec
4
+ data.tar.gz: 570de73035e5a30ec4b05cd46c9432149d88f030af5e181ba4874906e1fe5ba2
5
5
  SHA512:
6
- metadata.gz: '089c61c24350ad64f69e0d035187e4ad43311299b368d72c2e80b51ebf269394dc19ba02f7ad6b94afbadc1af420e6c2096b8a61e323991e4c4c378e80296cd4'
7
- data.tar.gz: 1630fd4caa437af32a658d1b72a5250e3df0c108a63dc912971eef0239ec31095581d2daa82e7133a9fea653623f2f16eef31de612996fe284ea320aa3cc61b7
6
+ metadata.gz: 18dedfb7c624ee9f1ad8822c8b1c2bab53daf1fa3cddfe5069b7d5ad407d3bcbf2ffc4a5958efe6a2ca4f1f35debc5ae5c34ee1497c30152d0b5d82452b4d195
7
+ data.tar.gz: 5f353e4d16fdd192ebf7050a8ed1845dc5db57a67f1379bd02dea40494a5035b4bee6d122878086530eaf3f9bedd37e5fccac86722e97bcc394e9fd6ff2eacef
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
 
2
2
  # MessageMedia Messages Ruby SDK
3
+ [![Build Status](https://travis-ci.org/messagemedia/messages-ruby-sdk.svg?branch=master)](https://travis-ci.org/messagemedia/messages-ruby-sdk)
3
4
  [![Pull Requests Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com)
4
5
  [![HitCount](http://hits.dwyl.io/messagemedia/messages-ruby-sdk.svg)](http://hits.dwyl.io/messagemedia/messages-ruby-sdk)
5
6
  [![gem](https://badge.fury.io/rb/messagemedia_messages_sdk.svg)](https://rubygems.org/gems/messagemedia_messages_sdk)
@@ -59,7 +60,7 @@ If you discover a problem with the SDK, we would like to know about it. You can
59
60
 
60
61
  We welcome your thoughts on how we could best provide you with SDKs that would simplify how you consume our services in your application. You can fork and create pull requests for any features you would like to see or raise an [issue](https://github.com/messagemedia/messages-nodejs-sdk/issues). Please be aware that a large share of the files are auto-generated by our backend tool.
61
62
 
62
- ## :star Installation
63
+ ## :star: Installation
63
64
  * Run the following command to install the SDK via RubyGems:
64
65
  ```
65
66
  gem install messagemedia_messages_sdk
@@ -1,29 +1,29 @@
1
- # message_media_messages
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module MessageMediaMessages
7
- # Send messages 400 response class.
8
- class SendMessages400ResponseException < APIException
9
- # TODO: Write general description for this method
10
- # @return [String]
11
- attr_accessor :message
12
-
13
- # The constructor.
14
- # @param [String] The reason for raising an exception.
15
- # @param [HttpContext] The HttpContext of the API call.
16
- def initialize(reason, context)
17
- super(reason, context)
18
- hash = APIHelper.json_deserialize(@context.response.raw_body)
19
- unbox(hash)
20
- end
21
-
22
- # Populates this object by extracting properties from a hash.
23
- # @param [Hash] The deserialized response sent by the server in the
24
- # response body.
25
- def unbox(hash)
26
- @message = hash['message']
27
- end
28
- end
29
- end
1
+ # message_media_messages
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module MessageMediaMessages
7
+ # Send messages 400 response class.
8
+ class SendMessages400ResponseException < APIException
9
+ # TODO: Write general description for this method
10
+ # @return [String]
11
+ attr_accessor :message
12
+
13
+ # The constructor.
14
+ # @param [String] The reason for raising an exception.
15
+ # @param [HttpContext] The HttpContext of the API call.
16
+ def initialize(reason, context)
17
+ super(reason, context)
18
+ hash = APIHelper.json_deserialize(@context.response.raw_body)
19
+ unbox(hash)
20
+ end
21
+
22
+ # Populates this object by extracting properties from a hash.
23
+ # @param [Hash] The deserialized response sent by the server in the
24
+ # response body.
25
+ def unbox(hash)
26
+ @message = hash['message']
27
+ end
28
+ end
29
+ end
@@ -1,90 +1,90 @@
1
- # message_media_messages
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- require 'base64'
7
-
8
- module MessageMediaMessages
9
- # Utility class for basic authorization.
10
- class AuthManager
11
- # Add authentication to the request.
12
- # @param [HttpRequest] The HttpRequest object to which authentication will
13
- # be added.
14
- # @param [String] The url of the request.
15
- # @param [String] The body of the request. None for GET requests.
16
- def self.apply(http_request, url, body = nil)
17
- if Configuration.hmac_auth_user_name.nil? ||
18
- Configuration.hmac_auth_password.nil?
19
- AuthManager.apply_basic_auth(http_request)
20
- else
21
- AuthManager.apply_hmac_auth(http_request, url, body)
22
- end
23
- end
24
-
25
- # Add basic authentication to the request.
26
- # @param [HttpRequest] The HttpRequest object to which authentication will
27
- # be added.
28
- def self.apply_basic_auth(http_request)
29
- username = Configuration.basic_auth_user_name
30
- password = Configuration.basic_auth_password
31
- value = Base64.strict_encode64("#{username}:#{password}")
32
- header_value = "Basic #{value}"
33
- http_request.headers['Authorization'] = header_value
34
- end
35
-
36
- # Add hmac authentication to the request.
37
- # @param [HttpRequest] The HttpRequest object to which authentication will
38
- # be added.
39
- # @param [String] The url of the request.
40
- # @param [String] The body of the request. None for GET requests.
41
- def self.apply_hmac_auth(http_request, url, body)
42
- username = Configuration.hmac_auth_user_name
43
-
44
- content_signature = ''
45
- content_header = ''
46
-
47
- now = Time.now.utc.strftime('%a, %d %b %Y %H:%M:%S GMT')
48
-
49
- date_header = now
50
-
51
- request_type = 'GET'
52
-
53
- unless body.nil?
54
- request_type = 'POST'
55
-
56
- md5 = Digest::MD5.new
57
- md5.update(body)
58
-
59
- content_hash = md5.hexdigest
60
- content_signature = "x-Content-MD5: #{content_hash}\n"
61
- content_header = 'x-Content-MD5 '
62
- http_request.headers['x-Content-MD5'] = content_hash
63
- end
64
-
65
- http_request.headers['date'] = date_header
66
-
67
- hmac_signature = AuthManager.create_signature(date_header,
68
- content_signature, url,
69
- request_type)
70
-
71
- joined = "username=\"#{username}\", algorithm=\"hmac-sha1\", " \
72
- "headers=\"date #{content_header}request-line\", " \
73
- "signature=\"#{hmac_signature}\""
74
- header_value = "hmac #{joined}"
75
- http_request.headers['Authorization'] = header_value
76
- end
77
-
78
- def self.create_signature(date, content_signature, url, request_type)
79
- signing_string = "date: #{date}\n#{content_signature}#{request_type} " \
80
- "#{url} HTTP/1.1"
81
- hmac = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha1'),
82
- Configuration.hmac_auth_password.encode(
83
- Encoding::UTF_8
84
- ),
85
- signing_string.encode(Encoding::UTF_8))
86
-
87
- Base64.encode64(hmac).chomp
88
- end
89
- end
90
- end
1
+ # message_media_messages
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ require 'base64'
7
+
8
+ module MessageMediaMessages
9
+ # Utility class for basic authorization.
10
+ class AuthManager
11
+ # Add authentication to the request.
12
+ # @param [HttpRequest] The HttpRequest object to which authentication will
13
+ # be added.
14
+ # @param [String] The url of the request.
15
+ # @param [String] The body of the request. None for GET requests.
16
+ def self.apply(http_request, url, body = nil)
17
+ if Configuration.hmac_auth_user_name.nil? ||
18
+ Configuration.hmac_auth_password.nil?
19
+ AuthManager.apply_basic_auth(http_request)
20
+ else
21
+ AuthManager.apply_hmac_auth(http_request, url, body)
22
+ end
23
+ end
24
+
25
+ # Add basic authentication to the request.
26
+ # @param [HttpRequest] The HttpRequest object to which authentication will
27
+ # be added.
28
+ def self.apply_basic_auth(http_request)
29
+ username = Configuration.basic_auth_user_name
30
+ password = Configuration.basic_auth_password
31
+ value = Base64.strict_encode64("#{username}:#{password}")
32
+ header_value = "Basic #{value}"
33
+ http_request.headers['Authorization'] = header_value
34
+ end
35
+
36
+ # Add hmac authentication to the request.
37
+ # @param [HttpRequest] The HttpRequest object to which authentication will
38
+ # be added.
39
+ # @param [String] The url of the request.
40
+ # @param [String] The body of the request. None for GET requests.
41
+ def self.apply_hmac_auth(http_request, url, body)
42
+ username = Configuration.hmac_auth_user_name
43
+
44
+ content_signature = ''
45
+ content_header = ''
46
+
47
+ now = Time.now.utc.strftime('%a, %d %b %Y %H:%M:%S GMT')
48
+
49
+ date_header = now
50
+
51
+ request_type = 'GET'
52
+
53
+ unless body.nil?
54
+ request_type = 'POST'
55
+
56
+ md5 = Digest::MD5.new
57
+ md5.update(body)
58
+
59
+ content_hash = md5.hexdigest
60
+ content_signature = "x-Content-MD5: #{content_hash}\n"
61
+ content_header = 'x-Content-MD5 '
62
+ http_request.headers['x-Content-MD5'] = content_hash
63
+ end
64
+
65
+ http_request.headers['date'] = date_header
66
+
67
+ hmac_signature = AuthManager.create_signature(date_header,
68
+ content_signature, url,
69
+ request_type)
70
+
71
+ joined = "username=\"#{username}\", algorithm=\"hmac-sha1\", " \
72
+ "headers=\"date #{content_header}request-line\", " \
73
+ "signature=\"#{hmac_signature}\""
74
+ header_value = "hmac #{joined}"
75
+ http_request.headers['Authorization'] = header_value
76
+ end
77
+
78
+ def self.create_signature(date, content_signature, url, request_type)
79
+ signing_string = "date: #{date}\n#{content_signature}#{request_type} " \
80
+ "#{url} HTTP/1.1"
81
+ hmac = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha1'),
82
+ Configuration.hmac_auth_password.encode(
83
+ Encoding::UTF_8
84
+ ),
85
+ signing_string.encode(Encoding::UTF_8))
86
+
87
+ Base64.encode64(hmac).chomp
88
+ end
89
+ end
90
+ end
@@ -1,35 +1,35 @@
1
- # message_media_messages
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module MessageMediaMessages
7
- # ConfirmDeliveryReportsAsReceivedRequest1 Model.
8
- class ConfirmDeliveryReportsAsReceivedRequest1 < BaseModel
9
- # TODO: Write general description for this method
10
- # @return [List of UUID | String]
11
- attr_accessor :delivery_report_ids
12
-
13
- # A mapping from model property names to API property names.
14
- def self.names
15
- @_hash = {} if @_hash.nil?
16
- @_hash['delivery_report_ids'] = 'delivery_report_ids'
17
- @_hash
18
- end
19
-
20
- def initialize(delivery_report_ids = nil)
21
- @delivery_report_ids = delivery_report_ids
22
- end
23
-
24
- # Creates an instance of the object from a hash.
25
- def self.from_hash(hash)
26
- return nil unless hash
27
-
28
- # Extract variables from the hash.
29
- delivery_report_ids = hash['delivery_report_ids']
30
-
31
- # Create object from extracted values.
32
- ConfirmDeliveryReportsAsReceivedRequest1.new(delivery_report_ids)
33
- end
34
- end
35
- end
1
+ # message_media_messages
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module MessageMediaMessages
7
+ # ConfirmDeliveryReportsAsReceivedRequest1 Model.
8
+ class ConfirmDeliveryReportsAsReceivedRequest1 < BaseModel
9
+ # TODO: Write general description for this method
10
+ # @return [List of UUID | String]
11
+ attr_accessor :delivery_report_ids
12
+
13
+ # A mapping from model property names to API property names.
14
+ def self.names
15
+ @_hash = {} if @_hash.nil?
16
+ @_hash['delivery_report_ids'] = 'delivery_report_ids'
17
+ @_hash
18
+ end
19
+
20
+ def initialize(delivery_report_ids = nil)
21
+ @delivery_report_ids = delivery_report_ids
22
+ end
23
+
24
+ # Creates an instance of the object from a hash.
25
+ def self.from_hash(hash)
26
+ return nil unless hash
27
+
28
+ # Extract variables from the hash.
29
+ delivery_report_ids = hash['delivery_report_ids']
30
+
31
+ # Create object from extracted values.
32
+ ConfirmDeliveryReportsAsReceivedRequest1.new(delivery_report_ids)
33
+ end
34
+ end
35
+ end
@@ -1,35 +1,35 @@
1
- # message_media_messages
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module MessageMediaMessages
7
- # ConfirmRepliesAsReceivedRequest1 Model.
8
- class ConfirmRepliesAsReceivedRequest1 < BaseModel
9
- # TODO: Write general description for this method
10
- # @return [List of UUID | String]
11
- attr_accessor :reply_ids
12
-
13
- # A mapping from model property names to API property names.
14
- def self.names
15
- @_hash = {} if @_hash.nil?
16
- @_hash['reply_ids'] = 'reply_ids'
17
- @_hash
18
- end
19
-
20
- def initialize(reply_ids = nil)
21
- @reply_ids = reply_ids
22
- end
23
-
24
- # Creates an instance of the object from a hash.
25
- def self.from_hash(hash)
26
- return nil unless hash
27
-
28
- # Extract variables from the hash.
29
- reply_ids = hash['reply_ids']
30
-
31
- # Create object from extracted values.
32
- ConfirmRepliesAsReceivedRequest1.new(reply_ids)
33
- end
34
- end
35
- end
1
+ # message_media_messages
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module MessageMediaMessages
7
+ # ConfirmRepliesAsReceivedRequest1 Model.
8
+ class ConfirmRepliesAsReceivedRequest1 < BaseModel
9
+ # TODO: Write general description for this method
10
+ # @return [List of UUID | String]
11
+ attr_accessor :reply_ids
12
+
13
+ # A mapping from model property names to API property names.
14
+ def self.names
15
+ @_hash = {} if @_hash.nil?
16
+ @_hash['reply_ids'] = 'reply_ids'
17
+ @_hash
18
+ end
19
+
20
+ def initialize(reply_ids = nil)
21
+ @reply_ids = reply_ids
22
+ end
23
+
24
+ # Creates an instance of the object from a hash.
25
+ def self.from_hash(hash)
26
+ return nil unless hash
27
+
28
+ # Extract variables from the hash.
29
+ reply_ids = hash['reply_ids']
30
+
31
+ # Create object from extracted values.
32
+ ConfirmRepliesAsReceivedRequest1.new(reply_ids)
33
+ end
34
+ end
35
+ end
@@ -1,135 +1,135 @@
1
- # message_media_messages
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- require 'date'
7
- module MessageMediaMessages
8
- # DeliveryReport Model.
9
- class DeliveryReport < BaseModel
10
- # The URL specified as the callback URL in the original submit message
11
- # request
12
- # @return [String]
13
- attr_accessor :callback_url
14
-
15
- # The date and time at which this delivery report was generated in UTC.
16
- # @return [DateTime]
17
- attr_accessor :date_received
18
-
19
- # Deprecated, no longer in use
20
- # @return [Integer]
21
- attr_accessor :delay
22
-
23
- # Unique ID for this delivery report
24
- # @return [UUID | String]
25
- attr_accessor :delivery_report_id
26
-
27
- # Unique ID of the original message
28
- # @return [UUID | String]
29
- attr_accessor :message_id
30
-
31
- # Any metadata that was included in the original submit message request
32
- # @return [Object]
33
- attr_accessor :metadata
34
-
35
- # Text of the original message.
36
- # @return [String]
37
- attr_accessor :original_text
38
-
39
- # Address from which this delivery report was received
40
- # @return [String]
41
- attr_accessor :source_number
42
-
43
- # The status of the message as per the delivery report
44
- # @return [Status2Enum]
45
- attr_accessor :status
46
-
47
- # The date and time when the message status changed in UTC. For a delivered
48
- # DR this may indicate the time at which the message was received on the
49
- # handset.
50
- # @return [DateTime]
51
- attr_accessor :submitted_date
52
-
53
- # The date and time when the message status changed in UTC. For a delivered
54
- # DR this may indicate the time at which the message was received on the
55
- # handset.
56
- # @return [VendorAccountId]
57
- attr_accessor :vendor_account_id
58
-
59
- # A mapping from model property names to API property names.
60
- def self.names
61
- @_hash = {} if @_hash.nil?
62
- @_hash['callback_url'] = 'callback_url'
63
- @_hash['date_received'] = 'date_received'
64
- @_hash['delay'] = 'delay'
65
- @_hash['delivery_report_id'] = 'delivery_report_id'
66
- @_hash['message_id'] = 'message_id'
67
- @_hash['metadata'] = 'metadata'
68
- @_hash['original_text'] = 'original_text'
69
- @_hash['source_number'] = 'source_number'
70
- @_hash['status'] = 'status'
71
- @_hash['submitted_date'] = 'submitted_date'
72
- @_hash['vendor_account_id'] = 'vendor_account_id'
73
- @_hash
74
- end
75
-
76
- def initialize(callback_url = nil,
77
- date_received = nil,
78
- delay = nil,
79
- delivery_report_id = nil,
80
- message_id = nil,
81
- metadata = nil,
82
- original_text = nil,
83
- source_number = nil,
84
- status = nil,
85
- submitted_date = nil,
86
- vendor_account_id = nil)
87
- @callback_url = callback_url
88
- @date_received = date_received
89
- @delay = delay
90
- @delivery_report_id = delivery_report_id
91
- @message_id = message_id
92
- @metadata = metadata
93
- @original_text = original_text
94
- @source_number = source_number
95
- @status = status
96
- @submitted_date = submitted_date
97
- @vendor_account_id = vendor_account_id
98
- end
99
-
100
- # Creates an instance of the object from a hash.
101
- def self.from_hash(hash)
102
- return nil unless hash
103
-
104
- # Extract variables from the hash.
105
- callback_url = hash['callback_url']
106
- date_received = APIHelper.rfc3339(hash['date_received']) if
107
- hash['date_received']
108
- delay = hash['delay']
109
- delivery_report_id = hash['delivery_report_id']
110
- message_id = hash['message_id']
111
- metadata = hash['metadata']
112
- original_text = hash['original_text']
113
- source_number = hash['source_number']
114
- status = hash['status']
115
- submitted_date = APIHelper.rfc3339(hash['submitted_date']) if
116
- hash['submitted_date']
117
- if hash['vendor_account_id']
118
- vendor_account_id = VendorAccountId.from_hash(hash['vendor_account_id'])
119
- end
120
-
121
- # Create object from extracted values.
122
- DeliveryReport.new(callback_url,
123
- date_received,
124
- delay,
125
- delivery_report_id,
126
- message_id,
127
- metadata,
128
- original_text,
129
- source_number,
130
- status,
131
- submitted_date,
132
- vendor_account_id)
133
- end
134
- end
135
- end
1
+ # message_media_messages
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ require 'date'
7
+ module MessageMediaMessages
8
+ # DeliveryReport Model.
9
+ class DeliveryReport < BaseModel
10
+ # The URL specified as the callback URL in the original submit message
11
+ # request
12
+ # @return [String]
13
+ attr_accessor :callback_url
14
+
15
+ # The date and time at which this delivery report was generated in UTC.
16
+ # @return [DateTime]
17
+ attr_accessor :date_received
18
+
19
+ # Deprecated, no longer in use
20
+ # @return [Integer]
21
+ attr_accessor :delay
22
+
23
+ # Unique ID for this delivery report
24
+ # @return [UUID | String]
25
+ attr_accessor :delivery_report_id
26
+
27
+ # Unique ID of the original message
28
+ # @return [UUID | String]
29
+ attr_accessor :message_id
30
+
31
+ # Any metadata that was included in the original submit message request
32
+ # @return [Object]
33
+ attr_accessor :metadata
34
+
35
+ # Text of the original message.
36
+ # @return [String]
37
+ attr_accessor :original_text
38
+
39
+ # Address from which this delivery report was received
40
+ # @return [String]
41
+ attr_accessor :source_number
42
+
43
+ # The status of the message as per the delivery report
44
+ # @return [Status2Enum]
45
+ attr_accessor :status
46
+
47
+ # The date and time when the message status changed in UTC. For a delivered
48
+ # DR this may indicate the time at which the message was received on the
49
+ # handset.
50
+ # @return [DateTime]
51
+ attr_accessor :submitted_date
52
+
53
+ # The date and time when the message status changed in UTC. For a delivered
54
+ # DR this may indicate the time at which the message was received on the
55
+ # handset.
56
+ # @return [VendorAccountId]
57
+ attr_accessor :vendor_account_id
58
+
59
+ # A mapping from model property names to API property names.
60
+ def self.names
61
+ @_hash = {} if @_hash.nil?
62
+ @_hash['callback_url'] = 'callback_url'
63
+ @_hash['date_received'] = 'date_received'
64
+ @_hash['delay'] = 'delay'
65
+ @_hash['delivery_report_id'] = 'delivery_report_id'
66
+ @_hash['message_id'] = 'message_id'
67
+ @_hash['metadata'] = 'metadata'
68
+ @_hash['original_text'] = 'original_text'
69
+ @_hash['source_number'] = 'source_number'
70
+ @_hash['status'] = 'status'
71
+ @_hash['submitted_date'] = 'submitted_date'
72
+ @_hash['vendor_account_id'] = 'vendor_account_id'
73
+ @_hash
74
+ end
75
+
76
+ def initialize(callback_url = nil,
77
+ date_received = nil,
78
+ delay = nil,
79
+ delivery_report_id = nil,
80
+ message_id = nil,
81
+ metadata = nil,
82
+ original_text = nil,
83
+ source_number = nil,
84
+ status = nil,
85
+ submitted_date = nil,
86
+ vendor_account_id = nil)
87
+ @callback_url = callback_url
88
+ @date_received = date_received
89
+ @delay = delay
90
+ @delivery_report_id = delivery_report_id
91
+ @message_id = message_id
92
+ @metadata = metadata
93
+ @original_text = original_text
94
+ @source_number = source_number
95
+ @status = status
96
+ @submitted_date = submitted_date
97
+ @vendor_account_id = vendor_account_id
98
+ end
99
+
100
+ # Creates an instance of the object from a hash.
101
+ def self.from_hash(hash)
102
+ return nil unless hash
103
+
104
+ # Extract variables from the hash.
105
+ callback_url = hash['callback_url']
106
+ date_received = APIHelper.rfc3339(hash['date_received']) if
107
+ hash['date_received']
108
+ delay = hash['delay']
109
+ delivery_report_id = hash['delivery_report_id']
110
+ message_id = hash['message_id']
111
+ metadata = hash['metadata']
112
+ original_text = hash['original_text']
113
+ source_number = hash['source_number']
114
+ status = hash['status']
115
+ submitted_date = APIHelper.rfc3339(hash['submitted_date']) if
116
+ hash['submitted_date']
117
+ if hash['vendor_account_id']
118
+ vendor_account_id = VendorAccountId.from_hash(hash['vendor_account_id'])
119
+ end
120
+
121
+ # Create object from extracted values.
122
+ DeliveryReport.new(callback_url,
123
+ date_received,
124
+ delay,
125
+ delivery_report_id,
126
+ message_id,
127
+ metadata,
128
+ original_text,
129
+ source_number,
130
+ status,
131
+ submitted_date,
132
+ vendor_account_id)
133
+ end
134
+ end
135
+ end