bandwidth-sdk 2.1.1 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +85 -70
  4. data/lib/bandwidth.rb +31 -2
  5. data/lib/bandwidth/api_helper.rb +14 -9
  6. data/lib/bandwidth/client.rb +22 -2
  7. data/lib/bandwidth/configuration.rb +67 -12
  8. data/lib/bandwidth/http/api_response.rb +2 -0
  9. data/lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb +22 -0
  10. data/lib/bandwidth/http/auth/web_rtc_basic_auth.rb +22 -0
  11. data/lib/bandwidth/http/faraday_client.rb +5 -2
  12. data/lib/bandwidth/messaging_lib/messaging.rb +5 -3
  13. data/lib/bandwidth/messaging_lib/messaging/client.rb +13 -2
  14. data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +191 -113
  15. data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +1 -1
  16. data/lib/bandwidth/messaging_lib/messaging/exceptions/{generic_client_exception.rb → messaging_exception.rb} +2 -14
  17. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb +23 -13
  18. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb +125 -0
  19. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb +60 -0
  20. data/lib/bandwidth/messaging_lib/messaging/models/media.rb +4 -4
  21. data/lib/bandwidth/messaging_lib/messaging/models/message_request.rb +21 -8
  22. data/lib/bandwidth/messaging_lib/messaging/models/page_info.rb +62 -0
  23. data/lib/bandwidth/messaging_lib/messaging/models/priority_enum.rb +19 -0
  24. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth.rb +22 -0
  25. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/client.rb +51 -0
  26. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/base_controller.rb +49 -0
  27. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/mfa_controller.rb +209 -0
  28. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/error_with_request_exception.rb +34 -0
  29. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/forbidden_request_exception.rb +29 -0
  30. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/unauthorized_request_exception.rb +29 -0
  31. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb +88 -0
  32. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_messaging_response.rb +35 -0
  33. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_code_response.rb +35 -0
  34. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb +75 -0
  35. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_voice_response.rb +35 -0
  36. data/lib/bandwidth/utilities/file_wrapper.rb +17 -0
  37. data/lib/bandwidth/voice_lib/bxml/verbs/bridge.rb +28 -0
  38. data/lib/bandwidth/voice_lib/bxml/verbs/conference.rb +32 -0
  39. data/lib/bandwidth/voice_lib/bxml/verbs/gather.rb +13 -1
  40. data/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb +7 -1
  41. data/lib/bandwidth/voice_lib/bxml/verbs/record.rb +9 -1
  42. data/lib/bandwidth/voice_lib/bxml/verbs/redirect.rb +5 -1
  43. data/lib/bandwidth/voice_lib/bxml/verbs/ring.rb +15 -0
  44. data/lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb +4 -1
  45. data/lib/bandwidth/voice_lib/bxml/verbs/sip_uri.rb +25 -0
  46. data/lib/bandwidth/voice_lib/bxml/verbs/start_gather.rb +20 -0
  47. data/lib/bandwidth/voice_lib/bxml/verbs/start_recording.rb +4 -1
  48. data/lib/bandwidth/voice_lib/bxml/verbs/stop_gather.rb +14 -0
  49. data/lib/bandwidth/voice_lib/bxml/verbs/tag.rb +13 -0
  50. data/lib/bandwidth/voice_lib/bxml/verbs/transfer.rb +14 -3
  51. data/lib/bandwidth/voice_lib/voice.rb +19 -4
  52. data/lib/bandwidth/voice_lib/voice/client.rb +13 -2
  53. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +1219 -133
  54. data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +1 -1
  55. data/lib/bandwidth/voice_lib/voice/exceptions/{error_response_exception.rb → api_error_response_exception.rb} +3 -3
  56. data/lib/bandwidth/voice_lib/voice/models/answer_fallback_method_enum.rb +17 -0
  57. data/lib/bandwidth/voice_lib/voice/models/api_call_response.rb +56 -2
  58. data/lib/bandwidth/voice_lib/voice/models/api_call_state_response.rb +164 -0
  59. data/lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb +135 -12
  60. data/lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb +37 -1
  61. data/lib/bandwidth/voice_lib/voice/models/api_modify_conference_request.rb +107 -0
  62. data/lib/bandwidth/voice_lib/voice/models/api_transcribe_recording_request.rb +80 -0
  63. data/lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb +35 -0
  64. data/lib/bandwidth/voice_lib/voice/models/conference_detail.rb +108 -0
  65. data/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb +35 -0
  66. data/lib/bandwidth/voice_lib/voice/models/conference_member_detail.rb +80 -0
  67. data/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata_response.rb +126 -0
  68. data/lib/bandwidth/voice_lib/voice/models/disconnect_cause_enum.rb +47 -0
  69. data/lib/bandwidth/voice_lib/voice/models/modify_call_recording_state.rb +1 -1
  70. data/lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb +66 -28
  71. data/lib/bandwidth/voice_lib/voice/models/redirect_fallback_method_enum.rb +17 -0
  72. data/lib/bandwidth/voice_lib/voice/models/state1_enum.rb +4 -7
  73. data/lib/bandwidth/voice_lib/voice/models/state2_enum.rb +20 -0
  74. data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +7 -4
  75. data/lib/bandwidth/voice_lib/voice/models/status1_enum.rb +29 -0
  76. data/lib/bandwidth/voice_lib/voice/models/status3_enum.rb +32 -0
  77. data/lib/bandwidth/voice_lib/voice/models/status_enum.rb +17 -0
  78. data/lib/bandwidth/{messaging_lib/messaging/models/field_error.rb → voice_lib/voice/models/transcript.rb} +15 -15
  79. data/lib/bandwidth/voice_lib/voice/models/transcription.rb +62 -0
  80. data/lib/bandwidth/voice_lib/voice/models/transcription_response.rb +42 -0
  81. data/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb +13 -0
  82. data/lib/bandwidth/web_rtc_lib/web_rtc.rb +22 -0
  83. data/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +51 -0
  84. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +692 -0
  85. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +49 -0
  86. data/lib/bandwidth/{messaging_lib/messaging/exceptions/path_client_exception.rb → web_rtc_lib/web_rtc/exceptions/error_exception.rb} +4 -19
  87. data/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb +47 -0
  88. data/lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb +17 -0
  89. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb +92 -0
  90. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb +35 -0
  91. data/lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb +17 -0
  92. data/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb +44 -0
  93. data/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb +54 -0
  94. data/test/integration/test_integration.rb +570 -0
  95. metadata +132 -19
  96. data/lib/bandwidth/voice_lib/voice/models/api_get_account_recordings_metadata_request.rb +0 -65
  97. data/lib/bandwidth/voice_lib/voice/models/transcription_status_enum.rb +0 -20
  98. data/lib/bandwidth/voice_lib/voice/models/type_enum.rb +0 -32
@@ -0,0 +1,80 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # ConferenceMemberDetail Model.
8
+ class ConferenceMemberDetail < BaseModel
9
+ # TODO: Write general description for this method
10
+ # @return [String]
11
+ attr_accessor :call_id
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [String]
15
+ attr_accessor :conference_id
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :member_url
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [Boolean]
23
+ attr_accessor :mute
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [Boolean]
27
+ attr_accessor :hold
28
+
29
+ # TODO: Write general description for this method
30
+ # @return [List of String]
31
+ attr_accessor :call_ids_to_coach
32
+
33
+ # A mapping from model property names to API property names.
34
+ def self.names
35
+ @_hash = {} if @_hash.nil?
36
+ @_hash['call_id'] = 'callId'
37
+ @_hash['conference_id'] = 'conferenceId'
38
+ @_hash['member_url'] = 'memberUrl'
39
+ @_hash['mute'] = 'mute'
40
+ @_hash['hold'] = 'hold'
41
+ @_hash['call_ids_to_coach'] = 'callIdsToCoach'
42
+ @_hash
43
+ end
44
+
45
+ def initialize(call_id = nil,
46
+ conference_id = nil,
47
+ member_url = nil,
48
+ mute = nil,
49
+ hold = nil,
50
+ call_ids_to_coach = nil)
51
+ @call_id = call_id
52
+ @conference_id = conference_id
53
+ @member_url = member_url
54
+ @mute = mute
55
+ @hold = hold
56
+ @call_ids_to_coach = call_ids_to_coach
57
+ end
58
+
59
+ # Creates an instance of the object from a hash.
60
+ def self.from_hash(hash)
61
+ return nil unless hash
62
+
63
+ # Extract variables from the hash.
64
+ call_id = hash['callId']
65
+ conference_id = hash['conferenceId']
66
+ member_url = hash['memberUrl']
67
+ mute = hash['mute']
68
+ hold = hash['hold']
69
+ call_ids_to_coach = hash['callIdsToCoach']
70
+
71
+ # Create object from extracted values.
72
+ ConferenceMemberDetail.new(call_id,
73
+ conference_id,
74
+ member_url,
75
+ mute,
76
+ hold,
77
+ call_ids_to_coach)
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,126 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ require 'date'
7
+ module Bandwidth
8
+ # ConferenceRecordingMetadataResponse Model.
9
+ class ConferenceRecordingMetadataResponse < BaseModel
10
+ # TODO: Write general description for this method
11
+ # @return [String]
12
+ attr_accessor :account_id
13
+
14
+ # TODO: Write general description for this method
15
+ # @return [String]
16
+ attr_accessor :conference_id
17
+
18
+ # TODO: Write general description for this method
19
+ # @return [String]
20
+ attr_accessor :name
21
+
22
+ # TODO: Write general description for this method
23
+ # @return [String]
24
+ attr_accessor :recording_id
25
+
26
+ # Format is ISO-8601
27
+ # @return [String]
28
+ attr_accessor :duration
29
+
30
+ # Format is ISO-8601
31
+ # @return [Integer]
32
+ attr_accessor :channels
33
+
34
+ # Format is ISO-8601
35
+ # @return [DateTime]
36
+ attr_accessor :start_time
37
+
38
+ # Format is ISO-8601
39
+ # @return [DateTime]
40
+ attr_accessor :end_time
41
+
42
+ # Format is ISO-8601
43
+ # @return [FileFormatEnum]
44
+ attr_accessor :file_format
45
+
46
+ # Format is ISO-8601
47
+ # @return [Status1Enum]
48
+ attr_accessor :status
49
+
50
+ # Format is ISO-8601
51
+ # @return [String]
52
+ attr_accessor :media_url
53
+
54
+ # A mapping from model property names to API property names.
55
+ def self.names
56
+ @_hash = {} if @_hash.nil?
57
+ @_hash['account_id'] = 'accountId'
58
+ @_hash['conference_id'] = 'conferenceId'
59
+ @_hash['name'] = 'name'
60
+ @_hash['recording_id'] = 'recordingId'
61
+ @_hash['duration'] = 'duration'
62
+ @_hash['channels'] = 'channels'
63
+ @_hash['start_time'] = 'startTime'
64
+ @_hash['end_time'] = 'endTime'
65
+ @_hash['file_format'] = 'fileFormat'
66
+ @_hash['status'] = 'status'
67
+ @_hash['media_url'] = 'mediaUrl'
68
+ @_hash
69
+ end
70
+
71
+ def initialize(account_id = nil,
72
+ conference_id = nil,
73
+ name = nil,
74
+ recording_id = nil,
75
+ duration = nil,
76
+ channels = nil,
77
+ start_time = nil,
78
+ end_time = nil,
79
+ file_format = nil,
80
+ status = nil,
81
+ media_url = nil)
82
+ @account_id = account_id
83
+ @conference_id = conference_id
84
+ @name = name
85
+ @recording_id = recording_id
86
+ @duration = duration
87
+ @channels = channels
88
+ @start_time = start_time
89
+ @end_time = end_time
90
+ @file_format = file_format
91
+ @status = status
92
+ @media_url = media_url
93
+ end
94
+
95
+ # Creates an instance of the object from a hash.
96
+ def self.from_hash(hash)
97
+ return nil unless hash
98
+
99
+ # Extract variables from the hash.
100
+ account_id = hash['accountId']
101
+ conference_id = hash['conferenceId']
102
+ name = hash['name']
103
+ recording_id = hash['recordingId']
104
+ duration = hash['duration']
105
+ channels = hash['channels']
106
+ start_time = APIHelper.rfc3339(hash['startTime']) if hash['startTime']
107
+ end_time = APIHelper.rfc3339(hash['endTime']) if hash['endTime']
108
+ file_format = hash['fileFormat']
109
+ status = hash['status']
110
+ media_url = hash['mediaUrl']
111
+
112
+ # Create object from extracted values.
113
+ ConferenceRecordingMetadataResponse.new(account_id,
114
+ conference_id,
115
+ name,
116
+ recording_id,
117
+ duration,
118
+ channels,
119
+ start_time,
120
+ end_time,
121
+ file_format,
122
+ status,
123
+ media_url)
124
+ end
125
+ end
126
+ end
@@ -0,0 +1,47 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # DisconnectCause.
8
+ class DisconnectCauseEnum
9
+ DISCONNECT_CAUSE_ENUM = [
10
+ # TODO: Write general description for BUSY
11
+ BUSY = 'busy'.freeze,
12
+
13
+ # TODO: Write general description for CALLBACKERROR
14
+ CALLBACKERROR = 'callback-error'.freeze,
15
+
16
+ # TODO: Write general description for CANCEL
17
+ CANCEL = 'cancel'.freeze,
18
+
19
+ # TODO: Write general description for ERROR
20
+ ERROR = 'error'.freeze,
21
+
22
+ # TODO: Write general description for HANGUP
23
+ HANGUP = 'hangup'.freeze,
24
+
25
+ # TODO: Write general description for INVALIDBXML
26
+ INVALIDBXML = 'invalid-bxml'.freeze,
27
+
28
+ # TODO: Write general description for REJECTED
29
+ REJECTED = 'rejected'.freeze,
30
+
31
+ # TODO: Write general description for TIMEOUT
32
+ TIMEOUT = 'timeout'.freeze,
33
+
34
+ # TODO: Write general description for ACCOUNTLIMIT
35
+ ACCOUNTLIMIT = 'account-limit'.freeze,
36
+
37
+ # TODO: Write general description for NODECAPACITYEXCEEDED
38
+ NODECAPACITYEXCEEDED = 'node-capacity-exceeded'.freeze,
39
+
40
+ # TODO: Write general description for UNKNOWN
41
+ UNKNOWN = 'unknown'.freeze,
42
+
43
+ # TODO: Write general description for APPLICATIONERROR
44
+ APPLICATIONERROR = 'application-error'.freeze
45
+ ].freeze
46
+ end
47
+ end
@@ -7,7 +7,7 @@ module Bandwidth
7
7
  # ModifyCallRecordingState Model.
8
8
  class ModifyCallRecordingState < BaseModel
9
9
  # TODO: Write general description for this method
10
- # @return [State1Enum]
10
+ # @return [State2Enum]
11
11
  attr_accessor :state
12
12
 
13
13
  # A mapping from model property names to API property names.
@@ -3,9 +3,14 @@
3
3
  # This file was automatically generated by APIMATIC v2.0
4
4
  # ( https://apimatic.io ).
5
5
 
6
+ require 'date'
6
7
  module Bandwidth
7
8
  # RecordingMetadataResponse Model.
8
9
  class RecordingMetadataResponse < BaseModel
10
+ # TODO: Write general description for this method
11
+ # @return [String]
12
+ attr_accessor :application_id
13
+
9
14
  # TODO: Write general description for this method
10
15
  # @return [String]
11
16
  attr_accessor :account_id
@@ -14,6 +19,10 @@ module Bandwidth
14
19
  # @return [String]
15
20
  attr_accessor :call_id
16
21
 
22
+ # TODO: Write general description for this method
23
+ # @return [String]
24
+ attr_accessor :parent_call_id
25
+
17
26
  # TODO: Write general description for this method
18
27
  # @return [String]
19
28
  attr_accessor :recording_id
@@ -28,88 +37,108 @@ module Bandwidth
28
37
 
29
38
  # TODO: Write general description for this method
30
39
  # @return [String]
31
- attr_accessor :duration
40
+ attr_accessor :transfer_caller_id
32
41
 
33
42
  # TODO: Write general description for this method
43
+ # @return [String]
44
+ attr_accessor :transfer_to
45
+
46
+ # Format is ISO-8601
47
+ # @return [String]
48
+ attr_accessor :duration
49
+
50
+ # Format is ISO-8601
34
51
  # @return [DirectionEnum]
35
52
  attr_accessor :direction
36
53
 
37
- # TODO: Write general description for this method
54
+ # Format is ISO-8601
38
55
  # @return [Integer]
39
56
  attr_accessor :channels
40
57
 
41
- # TODO: Write general description for this method
42
- # @return [Long]
58
+ # Format is ISO-8601
59
+ # @return [DateTime]
43
60
  attr_accessor :start_time
44
61
 
45
- # TODO: Write general description for this method
46
- # @return [Long]
62
+ # Format is ISO-8601
63
+ # @return [DateTime]
47
64
  attr_accessor :end_time
48
65
 
49
- # TODO: Write general description for this method
66
+ # Format is ISO-8601
50
67
  # @return [FileFormatEnum]
51
68
  attr_accessor :file_format
52
69
 
53
- # TODO: Write general description for this method
54
- # @return [TranscriptionStatusEnum]
55
- attr_accessor :transcription_status
70
+ # Format is ISO-8601
71
+ # @return [Status1Enum]
72
+ attr_accessor :status
56
73
 
57
- # TODO: Write general description for this method
74
+ # Format is ISO-8601
58
75
  # @return [String]
59
76
  attr_accessor :media_url
60
77
 
61
- # TODO: Write general description for this method
62
- # @return [String]
63
- attr_accessor :transcription_url
78
+ # Format is ISO-8601
79
+ # @return [Transcription]
80
+ attr_accessor :transcription
64
81
 
65
82
  # A mapping from model property names to API property names.
66
83
  def self.names
67
84
  @_hash = {} if @_hash.nil?
85
+ @_hash['application_id'] = 'applicationId'
68
86
  @_hash['account_id'] = 'accountId'
69
87
  @_hash['call_id'] = 'callId'
88
+ @_hash['parent_call_id'] = 'parentCallId'
70
89
  @_hash['recording_id'] = 'recordingId'
71
90
  @_hash['to'] = 'to'
72
91
  @_hash['from'] = 'from'
92
+ @_hash['transfer_caller_id'] = 'transferCallerId'
93
+ @_hash['transfer_to'] = 'transferTo'
73
94
  @_hash['duration'] = 'duration'
74
95
  @_hash['direction'] = 'direction'
75
96
  @_hash['channels'] = 'channels'
76
97
  @_hash['start_time'] = 'startTime'
77
98
  @_hash['end_time'] = 'endTime'
78
99
  @_hash['file_format'] = 'fileFormat'
79
- @_hash['transcription_status'] = 'transcriptionStatus'
100
+ @_hash['status'] = 'status'
80
101
  @_hash['media_url'] = 'mediaUrl'
81
- @_hash['transcription_url'] = 'transcriptionUrl'
102
+ @_hash['transcription'] = 'transcription'
82
103
  @_hash
83
104
  end
84
105
 
85
- def initialize(account_id = nil,
106
+ def initialize(application_id = nil,
107
+ account_id = nil,
86
108
  call_id = nil,
109
+ parent_call_id = nil,
87
110
  recording_id = nil,
88
111
  to = nil,
89
112
  from = nil,
113
+ transfer_caller_id = nil,
114
+ transfer_to = nil,
90
115
  duration = nil,
91
116
  direction = nil,
92
117
  channels = nil,
93
118
  start_time = nil,
94
119
  end_time = nil,
95
120
  file_format = nil,
96
- transcription_status = nil,
121
+ status = nil,
97
122
  media_url = nil,
98
- transcription_url = nil)
123
+ transcription = nil)
124
+ @application_id = application_id
99
125
  @account_id = account_id
100
126
  @call_id = call_id
127
+ @parent_call_id = parent_call_id
101
128
  @recording_id = recording_id
102
129
  @to = to
103
130
  @from = from
131
+ @transfer_caller_id = transfer_caller_id
132
+ @transfer_to = transfer_to
104
133
  @duration = duration
105
134
  @direction = direction
106
135
  @channels = channels
107
136
  @start_time = start_time
108
137
  @end_time = end_time
109
138
  @file_format = file_format
110
- @transcription_status = transcription_status
139
+ @status = status
111
140
  @media_url = media_url
112
- @transcription_url = transcription_url
141
+ @transcription = transcription
113
142
  end
114
143
 
115
144
  # Creates an instance of the object from a hash.
@@ -117,36 +146,45 @@ module Bandwidth
117
146
  return nil unless hash
118
147
 
119
148
  # Extract variables from the hash.
149
+ application_id = hash['applicationId']
120
150
  account_id = hash['accountId']
121
151
  call_id = hash['callId']
152
+ parent_call_id = hash['parentCallId']
122
153
  recording_id = hash['recordingId']
123
154
  to = hash['to']
124
155
  from = hash['from']
156
+ transfer_caller_id = hash['transferCallerId']
157
+ transfer_to = hash['transferTo']
125
158
  duration = hash['duration']
126
159
  direction = hash['direction']
127
160
  channels = hash['channels']
128
- start_time = hash['startTime']
129
- end_time = hash['endTime']
161
+ start_time = APIHelper.rfc3339(hash['startTime']) if hash['startTime']
162
+ end_time = APIHelper.rfc3339(hash['endTime']) if hash['endTime']
130
163
  file_format = hash['fileFormat']
131
- transcription_status = hash['transcriptionStatus']
164
+ status = hash['status']
132
165
  media_url = hash['mediaUrl']
133
- transcription_url = hash['transcriptionUrl']
166
+ transcription = Transcription.from_hash(hash['transcription']) if
167
+ hash['transcription']
134
168
 
135
169
  # Create object from extracted values.
136
- RecordingMetadataResponse.new(account_id,
170
+ RecordingMetadataResponse.new(application_id,
171
+ account_id,
137
172
  call_id,
173
+ parent_call_id,
138
174
  recording_id,
139
175
  to,
140
176
  from,
177
+ transfer_caller_id,
178
+ transfer_to,
141
179
  duration,
142
180
  direction,
143
181
  channels,
144
182
  start_time,
145
183
  end_time,
146
184
  file_format,
147
- transcription_status,
185
+ status,
148
186
  media_url,
149
- transcription_url)
187
+ transcription)
150
188
  end
151
189
  end
152
190
  end