bandwidth-sdk 6.2.0 → 9.0.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.
- checksums.yaml +4 -4
- data/lib/bandwidth/api_helper.rb +19 -29
- data/lib/bandwidth/client.rb +8 -8
- data/lib/bandwidth/configuration.rb +20 -32
- data/lib/bandwidth/http/auth/{two_factor_auth_basic_auth.rb → multi_factor_auth_basic_auth.rb} +3 -3
- data/lib/bandwidth/http/faraday_client.rb +1 -1
- data/lib/bandwidth/messaging_lib/messaging/client.rb +14 -5
- data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +78 -71
- data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +3 -5
- data/lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb +5 -2
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb +31 -11
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb +54 -25
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb +102 -24
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb +23 -4
- data/lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb +20 -4
- data/lib/bandwidth/messaging_lib/messaging/models/media.rb +27 -80
- data/lib/bandwidth/messaging_lib/messaging/models/message_request.rb +32 -14
- data/lib/bandwidth/messaging_lib/messaging/models/page_info.rb +28 -8
- data/lib/bandwidth/messaging_lib/messaging/models/tag.rb +20 -4
- data/lib/bandwidth/models/base_model.rb +30 -8
- data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/client.rb +15 -6
- data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/controllers/base_controller.rb +3 -5
- data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/controllers/mfa_controller.rb +28 -23
- data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/exceptions/error_with_request_exception.rb +5 -2
- data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/exceptions/forbidden_request_exception.rb +4 -1
- data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/exceptions/unauthorized_request_exception.rb +4 -1
- data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_code_request_schema.rb +27 -12
- data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_messaging_response.rb +17 -2
- data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_verify_code_response.rb +17 -2
- data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_verify_request_schema.rb +29 -10
- data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_voice_response.rb +17 -2
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth.rb +23 -0
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb +212 -210
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb +3 -5
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb +4 -1
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb +17 -2
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb +20 -4
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb +28 -7
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb +43 -18
- data/lib/bandwidth/utilities/date_time_helper.rb +156 -0
- data/lib/bandwidth/utilities/file_wrapper.rb +1 -2
- data/lib/bandwidth/voice_lib/voice/client.rb +14 -5
- data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +418 -379
- data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +3 -5
- data/lib/bandwidth/voice_lib/voice/exceptions/{api_error_response_exception.rb → api_error_exception.rb} +8 -5
- data/lib/bandwidth/voice_lib/voice/models/call_callback.rb +343 -0
- data/lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb +250 -0
- data/lib/bandwidth/voice_lib/voice/models/call_state.rb +284 -0
- data/lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb +2 -20
- data/lib/bandwidth/voice_lib/voice/models/conference_callback.rb +211 -0
- data/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb +2 -20
- data/lib/bandwidth/voice_lib/voice/models/{conference_member_detail.rb → conference_member_state.rb} +43 -20
- data/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb +173 -0
- data/lib/bandwidth/voice_lib/voice/models/conference_state.rb +153 -0
- data/lib/bandwidth/voice_lib/voice/models/create_call_request.rb +301 -0
- data/lib/bandwidth/voice_lib/voice/models/create_call_response.rb +256 -0
- data/lib/bandwidth/voice_lib/voice/models/diversion.rb +80 -0
- data/lib/bandwidth/voice_lib/voice/models/fallback_method_enum.rb +17 -0
- data/lib/bandwidth/voice_lib/voice/models/machine_detection_configuration.rb +218 -0
- data/lib/bandwidth/voice_lib/voice/models/mode_enum.rb +20 -0
- data/lib/bandwidth/voice_lib/voice/models/{modify_call_recording_state.rb → modify_call_recording_request.rb} +19 -6
- data/lib/bandwidth/voice_lib/voice/models/modify_call_request.rb +156 -0
- data/lib/bandwidth/voice_lib/voice/models/modify_conference_request.rb +144 -0
- data/lib/bandwidth/voice_lib/voice/models/state1_enum.rb +7 -4
- data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +4 -7
- data/lib/bandwidth/voice_lib/voice/models/transcribe_recording_request.rb +108 -0
- data/lib/bandwidth/voice_lib/voice/models/transcript.rb +20 -4
- data/lib/bandwidth/voice_lib/voice/models/transcription.rb +35 -17
- data/lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb +89 -0
- data/lib/bandwidth/voice_lib/voice/models/transcription_response.rb +18 -1
- data/lib/bandwidth/voice_lib/voice.rb +20 -18
- data/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb +7 -2
- data/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +4 -4
- data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +75 -64
- data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +3 -5
- data/lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb +5 -2
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb +20 -5
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb +37 -14
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb +15 -2
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb +20 -4
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb +20 -3
- data/lib/bandwidth.rb +20 -18
- data/test/integration/test_integration.rb +92 -57
- metadata +35 -31
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth.rb +0 -22
- data/lib/bandwidth/voice_lib/voice/models/api_call_response.rb +0 -207
- data/lib/bandwidth/voice_lib/voice/models/api_call_state_response.rb +0 -164
- data/lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb +0 -248
- data/lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb +0 -116
- data/lib/bandwidth/voice_lib/voice/models/api_modify_conference_request.rb +0 -107
- data/lib/bandwidth/voice_lib/voice/models/api_transcribe_recording_request.rb +0 -80
- data/lib/bandwidth/voice_lib/voice/models/conference_detail.rb +0 -108
- data/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata_response.rb +0 -126
- data/lib/bandwidth/voice_lib/voice/models/disconnect_cause_enum.rb +0 -47
- data/lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb +0 -190
- data/lib/bandwidth/voice_lib/voice/models/state2_enum.rb +0 -20
- data/lib/bandwidth/voice_lib/voice/models/status1_enum.rb +0 -29
- data/lib/bandwidth/voice_lib/voice/models/status3_enum.rb +0 -32
|
@@ -0,0 +1,284 @@
|
|
|
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
|
+
# CallState Model.
|
|
9
|
+
class CallState < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for this method
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :call_id
|
|
16
|
+
|
|
17
|
+
# TODO: Write general description for this method
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :parent_call_id
|
|
20
|
+
|
|
21
|
+
# TODO: Write general description for this method
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :application_id
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for this method
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :account_id
|
|
28
|
+
|
|
29
|
+
# TODO: Write general description for this method
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :to
|
|
32
|
+
|
|
33
|
+
# TODO: Write general description for this method
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :from
|
|
36
|
+
|
|
37
|
+
# TODO: Write general description for this method
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :direction
|
|
40
|
+
|
|
41
|
+
# The current state of the call. Current possible values are 'initiated',
|
|
42
|
+
# 'answered' and 'disconnected'. Additional states may be added in the
|
|
43
|
+
# future, so your application must be tolerant of unknown values.
|
|
44
|
+
# @return [String]
|
|
45
|
+
attr_accessor :state
|
|
46
|
+
|
|
47
|
+
# The current state of the call. Current possible values are 'initiated',
|
|
48
|
+
# 'answered' and 'disconnected'. Additional states may be added in the
|
|
49
|
+
# future, so your application must be tolerant of unknown values.
|
|
50
|
+
# @return [String]
|
|
51
|
+
attr_accessor :identity
|
|
52
|
+
|
|
53
|
+
# The current state of the call. Current possible values are 'initiated',
|
|
54
|
+
# 'answered' and 'disconnected'. Additional states may be added in the
|
|
55
|
+
# future, so your application must be tolerant of unknown values.
|
|
56
|
+
# @return [Hash]
|
|
57
|
+
attr_accessor :stir_shaken
|
|
58
|
+
|
|
59
|
+
# The current state of the call. Current possible values are 'initiated',
|
|
60
|
+
# 'answered' and 'disconnected'. Additional states may be added in the
|
|
61
|
+
# future, so your application must be tolerant of unknown values.
|
|
62
|
+
# @return [DateTime]
|
|
63
|
+
attr_accessor :start_time
|
|
64
|
+
|
|
65
|
+
# The current state of the call. Current possible values are 'initiated',
|
|
66
|
+
# 'answered' and 'disconnected'. Additional states may be added in the
|
|
67
|
+
# future, so your application must be tolerant of unknown values.
|
|
68
|
+
# @return [DateTime]
|
|
69
|
+
attr_accessor :answer_time
|
|
70
|
+
|
|
71
|
+
# The current state of the call. Current possible values are 'initiated',
|
|
72
|
+
# 'answered' and 'disconnected'. Additional states may be added in the
|
|
73
|
+
# future, so your application must be tolerant of unknown values.
|
|
74
|
+
# @return [DateTime]
|
|
75
|
+
attr_accessor :end_time
|
|
76
|
+
|
|
77
|
+
# The reason the call was disconnected, or null if the call is still active.
|
|
78
|
+
# Current values are 'cancel', 'timeout', 'busy', 'rejected', 'hangup',
|
|
79
|
+
# 'invalid-bxml', 'callback-error', 'application-error', 'error',
|
|
80
|
+
# 'account-limit', 'node-capacity-exceeded' and 'unknown'. Additional causes
|
|
81
|
+
# may be added in the future, so your application must be tolerant of
|
|
82
|
+
# unknown values.
|
|
83
|
+
# @return [String]
|
|
84
|
+
attr_accessor :disconnect_cause
|
|
85
|
+
|
|
86
|
+
# The reason the call was disconnected, or null if the call is still active.
|
|
87
|
+
# Current values are 'cancel', 'timeout', 'busy', 'rejected', 'hangup',
|
|
88
|
+
# 'invalid-bxml', 'callback-error', 'application-error', 'error',
|
|
89
|
+
# 'account-limit', 'node-capacity-exceeded' and 'unknown'. Additional causes
|
|
90
|
+
# may be added in the future, so your application must be tolerant of
|
|
91
|
+
# unknown values.
|
|
92
|
+
# @return [String]
|
|
93
|
+
attr_accessor :error_message
|
|
94
|
+
|
|
95
|
+
# The reason the call was disconnected, or null if the call is still active.
|
|
96
|
+
# Current values are 'cancel', 'timeout', 'busy', 'rejected', 'hangup',
|
|
97
|
+
# 'invalid-bxml', 'callback-error', 'application-error', 'error',
|
|
98
|
+
# 'account-limit', 'node-capacity-exceeded' and 'unknown'. Additional causes
|
|
99
|
+
# may be added in the future, so your application must be tolerant of
|
|
100
|
+
# unknown values.
|
|
101
|
+
# @return [String]
|
|
102
|
+
attr_accessor :error_id
|
|
103
|
+
|
|
104
|
+
# The reason the call was disconnected, or null if the call is still active.
|
|
105
|
+
# Current values are 'cancel', 'timeout', 'busy', 'rejected', 'hangup',
|
|
106
|
+
# 'invalid-bxml', 'callback-error', 'application-error', 'error',
|
|
107
|
+
# 'account-limit', 'node-capacity-exceeded' and 'unknown'. Additional causes
|
|
108
|
+
# may be added in the future, so your application must be tolerant of
|
|
109
|
+
# unknown values.
|
|
110
|
+
# @return [DateTime]
|
|
111
|
+
attr_accessor :last_update
|
|
112
|
+
|
|
113
|
+
# A mapping from model property names to API property names.
|
|
114
|
+
def self.names
|
|
115
|
+
@_hash = {} if @_hash.nil?
|
|
116
|
+
@_hash['call_id'] = 'callId'
|
|
117
|
+
@_hash['parent_call_id'] = 'parentCallId'
|
|
118
|
+
@_hash['application_id'] = 'applicationId'
|
|
119
|
+
@_hash['account_id'] = 'accountId'
|
|
120
|
+
@_hash['to'] = 'to'
|
|
121
|
+
@_hash['from'] = 'from'
|
|
122
|
+
@_hash['direction'] = 'direction'
|
|
123
|
+
@_hash['state'] = 'state'
|
|
124
|
+
@_hash['identity'] = 'identity'
|
|
125
|
+
@_hash['stir_shaken'] = 'stirShaken'
|
|
126
|
+
@_hash['start_time'] = 'startTime'
|
|
127
|
+
@_hash['answer_time'] = 'answerTime'
|
|
128
|
+
@_hash['end_time'] = 'endTime'
|
|
129
|
+
@_hash['disconnect_cause'] = 'disconnectCause'
|
|
130
|
+
@_hash['error_message'] = 'errorMessage'
|
|
131
|
+
@_hash['error_id'] = 'errorId'
|
|
132
|
+
@_hash['last_update'] = 'lastUpdate'
|
|
133
|
+
@_hash
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# An array for optional fields
|
|
137
|
+
def optionals
|
|
138
|
+
%w[
|
|
139
|
+
call_id
|
|
140
|
+
parent_call_id
|
|
141
|
+
application_id
|
|
142
|
+
account_id
|
|
143
|
+
to
|
|
144
|
+
from
|
|
145
|
+
direction
|
|
146
|
+
state
|
|
147
|
+
identity
|
|
148
|
+
stir_shaken
|
|
149
|
+
start_time
|
|
150
|
+
answer_time
|
|
151
|
+
end_time
|
|
152
|
+
disconnect_cause
|
|
153
|
+
error_message
|
|
154
|
+
error_id
|
|
155
|
+
last_update
|
|
156
|
+
]
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# An array for nullable fields
|
|
160
|
+
def nullables
|
|
161
|
+
%w[
|
|
162
|
+
parent_call_id
|
|
163
|
+
identity
|
|
164
|
+
answer_time
|
|
165
|
+
end_time
|
|
166
|
+
disconnect_cause
|
|
167
|
+
error_message
|
|
168
|
+
error_id
|
|
169
|
+
]
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
def initialize(call_id = nil,
|
|
173
|
+
parent_call_id = nil,
|
|
174
|
+
application_id = nil,
|
|
175
|
+
account_id = nil,
|
|
176
|
+
to = nil,
|
|
177
|
+
from = nil,
|
|
178
|
+
direction = nil,
|
|
179
|
+
state = nil,
|
|
180
|
+
identity = nil,
|
|
181
|
+
stir_shaken = nil,
|
|
182
|
+
start_time = nil,
|
|
183
|
+
answer_time = nil,
|
|
184
|
+
end_time = nil,
|
|
185
|
+
disconnect_cause = nil,
|
|
186
|
+
error_message = nil,
|
|
187
|
+
error_id = nil,
|
|
188
|
+
last_update = nil)
|
|
189
|
+
@call_id = call_id unless call_id == SKIP
|
|
190
|
+
@parent_call_id = parent_call_id unless parent_call_id == SKIP
|
|
191
|
+
@application_id = application_id unless application_id == SKIP
|
|
192
|
+
@account_id = account_id unless account_id == SKIP
|
|
193
|
+
@to = to unless to == SKIP
|
|
194
|
+
@from = from unless from == SKIP
|
|
195
|
+
@direction = direction unless direction == SKIP
|
|
196
|
+
@state = state unless state == SKIP
|
|
197
|
+
@identity = identity unless identity == SKIP
|
|
198
|
+
@stir_shaken = stir_shaken unless stir_shaken == SKIP
|
|
199
|
+
@start_time = start_time unless start_time == SKIP
|
|
200
|
+
@answer_time = answer_time unless answer_time == SKIP
|
|
201
|
+
@end_time = end_time unless end_time == SKIP
|
|
202
|
+
@disconnect_cause = disconnect_cause unless disconnect_cause == SKIP
|
|
203
|
+
@error_message = error_message unless error_message == SKIP
|
|
204
|
+
@error_id = error_id unless error_id == SKIP
|
|
205
|
+
@last_update = last_update unless last_update == SKIP
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Creates an instance of the object from a hash.
|
|
209
|
+
def self.from_hash(hash)
|
|
210
|
+
return nil unless hash
|
|
211
|
+
|
|
212
|
+
# Extract variables from the hash.
|
|
213
|
+
call_id = hash.key?('callId') ? hash['callId'] : SKIP
|
|
214
|
+
parent_call_id = hash.key?('parentCallId') ? hash['parentCallId'] : SKIP
|
|
215
|
+
application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP
|
|
216
|
+
account_id = hash.key?('accountId') ? hash['accountId'] : SKIP
|
|
217
|
+
to = hash.key?('to') ? hash['to'] : SKIP
|
|
218
|
+
from = hash.key?('from') ? hash['from'] : SKIP
|
|
219
|
+
direction = hash.key?('direction') ? hash['direction'] : SKIP
|
|
220
|
+
state = hash.key?('state') ? hash['state'] : SKIP
|
|
221
|
+
identity = hash.key?('identity') ? hash['identity'] : SKIP
|
|
222
|
+
stir_shaken = hash.key?('stirShaken') ? hash['stirShaken'] : SKIP
|
|
223
|
+
start_time = if hash.key?('startTime')
|
|
224
|
+
(DateTimeHelper.from_rfc3339(hash['startTime']) if hash['startTime'])
|
|
225
|
+
else
|
|
226
|
+
SKIP
|
|
227
|
+
end
|
|
228
|
+
answer_time = if hash.key?('answerTime')
|
|
229
|
+
(DateTimeHelper.from_rfc3339(hash['answerTime']) if hash['answerTime'])
|
|
230
|
+
else
|
|
231
|
+
SKIP
|
|
232
|
+
end
|
|
233
|
+
end_time = if hash.key?('endTime')
|
|
234
|
+
(DateTimeHelper.from_rfc3339(hash['endTime']) if hash['endTime'])
|
|
235
|
+
else
|
|
236
|
+
SKIP
|
|
237
|
+
end
|
|
238
|
+
disconnect_cause =
|
|
239
|
+
hash.key?('disconnectCause') ? hash['disconnectCause'] : SKIP
|
|
240
|
+
error_message = hash.key?('errorMessage') ? hash['errorMessage'] : SKIP
|
|
241
|
+
error_id = hash.key?('errorId') ? hash['errorId'] : SKIP
|
|
242
|
+
last_update = if hash.key?('lastUpdate')
|
|
243
|
+
(DateTimeHelper.from_rfc3339(hash['lastUpdate']) if hash['lastUpdate'])
|
|
244
|
+
else
|
|
245
|
+
SKIP
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Create object from extracted values.
|
|
249
|
+
CallState.new(call_id,
|
|
250
|
+
parent_call_id,
|
|
251
|
+
application_id,
|
|
252
|
+
account_id,
|
|
253
|
+
to,
|
|
254
|
+
from,
|
|
255
|
+
direction,
|
|
256
|
+
state,
|
|
257
|
+
identity,
|
|
258
|
+
stir_shaken,
|
|
259
|
+
start_time,
|
|
260
|
+
answer_time,
|
|
261
|
+
end_time,
|
|
262
|
+
disconnect_cause,
|
|
263
|
+
error_message,
|
|
264
|
+
error_id,
|
|
265
|
+
last_update)
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
def to_start_time
|
|
269
|
+
DateTimeHelper.to_rfc3339(start_time)
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
def to_answer_time
|
|
273
|
+
DateTimeHelper.to_rfc3339(answer_time)
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
def to_end_time
|
|
277
|
+
DateTimeHelper.to_rfc3339(end_time)
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
def to_last_update
|
|
281
|
+
DateTimeHelper.to_rfc3339(last_update)
|
|
282
|
+
end
|
|
283
|
+
end
|
|
284
|
+
end
|
|
@@ -7,29 +7,11 @@ module Bandwidth
|
|
|
7
7
|
# CallbackMethod.
|
|
8
8
|
class CallbackMethodEnum
|
|
9
9
|
CALLBACK_METHOD_ENUM = [
|
|
10
|
-
# TODO: Write general description for GET
|
|
11
|
-
GET = 'GET'.freeze,
|
|
12
|
-
|
|
13
|
-
# TODO: Write general description for HEAD
|
|
14
|
-
HEAD = 'HEAD'.freeze,
|
|
15
|
-
|
|
16
10
|
# TODO: Write general description for POST
|
|
17
11
|
POST = 'POST'.freeze,
|
|
18
12
|
|
|
19
|
-
# TODO: Write general description for
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# TODO: Write general description for PATCH
|
|
23
|
-
PATCH = 'PATCH'.freeze,
|
|
24
|
-
|
|
25
|
-
# TODO: Write general description for DELETE
|
|
26
|
-
DELETE = 'DELETE'.freeze,
|
|
27
|
-
|
|
28
|
-
# TODO: Write general description for OPTIONS
|
|
29
|
-
OPTIONS = 'OPTIONS'.freeze,
|
|
30
|
-
|
|
31
|
-
# TODO: Write general description for TRACE
|
|
32
|
-
TRACE = 'TRACE'.freeze
|
|
13
|
+
# TODO: Write general description for GET
|
|
14
|
+
GET = 'GET'.freeze
|
|
33
15
|
].freeze
|
|
34
16
|
end
|
|
35
17
|
end
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# bandwidth
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
|
4
|
+
# ( https://apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Bandwidth
|
|
7
|
+
# This object represents all possible fields that may be included in callbacks
|
|
8
|
+
# related to conference events
|
|
9
|
+
class ConferenceCallback < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
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 :name
|
|
20
|
+
|
|
21
|
+
# TODO: Write general description for this method
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :event_type
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for this method
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :event_time
|
|
28
|
+
|
|
29
|
+
# TODO: Write general description for this method
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :tag
|
|
32
|
+
|
|
33
|
+
# TODO: Write general description for this method
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :call_id
|
|
36
|
+
|
|
37
|
+
# TODO: Write general description for this method
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :to
|
|
40
|
+
|
|
41
|
+
# TODO: Write general description for this method
|
|
42
|
+
# @return [String]
|
|
43
|
+
attr_accessor :from
|
|
44
|
+
|
|
45
|
+
# TODO: Write general description for this method
|
|
46
|
+
# @return [String]
|
|
47
|
+
attr_accessor :account_id
|
|
48
|
+
|
|
49
|
+
# TODO: Write general description for this method
|
|
50
|
+
# @return [String]
|
|
51
|
+
attr_accessor :recording_id
|
|
52
|
+
|
|
53
|
+
# TODO: Write general description for this method
|
|
54
|
+
# @return [Integer]
|
|
55
|
+
attr_accessor :channels
|
|
56
|
+
|
|
57
|
+
# TODO: Write general description for this method
|
|
58
|
+
# @return [String]
|
|
59
|
+
attr_accessor :start_time
|
|
60
|
+
|
|
61
|
+
# TODO: Write general description for this method
|
|
62
|
+
# @return [String]
|
|
63
|
+
attr_accessor :end_time
|
|
64
|
+
|
|
65
|
+
# TODO: Write general description for this method
|
|
66
|
+
# @return [String]
|
|
67
|
+
attr_accessor :duration
|
|
68
|
+
|
|
69
|
+
# TODO: Write general description for this method
|
|
70
|
+
# @return [String]
|
|
71
|
+
attr_accessor :file_format
|
|
72
|
+
|
|
73
|
+
# TODO: Write general description for this method
|
|
74
|
+
# @return [String]
|
|
75
|
+
attr_accessor :media_url
|
|
76
|
+
|
|
77
|
+
# TODO: Write general description for this method
|
|
78
|
+
# @return [String]
|
|
79
|
+
attr_accessor :status
|
|
80
|
+
|
|
81
|
+
# A mapping from model property names to API property names.
|
|
82
|
+
def self.names
|
|
83
|
+
@_hash = {} if @_hash.nil?
|
|
84
|
+
@_hash['conference_id'] = 'conferenceId'
|
|
85
|
+
@_hash['name'] = 'name'
|
|
86
|
+
@_hash['event_type'] = 'eventType'
|
|
87
|
+
@_hash['event_time'] = 'eventTime'
|
|
88
|
+
@_hash['tag'] = 'tag'
|
|
89
|
+
@_hash['call_id'] = 'callId'
|
|
90
|
+
@_hash['to'] = 'to'
|
|
91
|
+
@_hash['from'] = 'from'
|
|
92
|
+
@_hash['account_id'] = 'accountId'
|
|
93
|
+
@_hash['recording_id'] = 'recordingId'
|
|
94
|
+
@_hash['channels'] = 'channels'
|
|
95
|
+
@_hash['start_time'] = 'startTime'
|
|
96
|
+
@_hash['end_time'] = 'endTime'
|
|
97
|
+
@_hash['duration'] = 'duration'
|
|
98
|
+
@_hash['file_format'] = 'fileFormat'
|
|
99
|
+
@_hash['media_url'] = 'mediaUrl'
|
|
100
|
+
@_hash['status'] = 'status'
|
|
101
|
+
@_hash
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# An array for optional fields
|
|
105
|
+
def optionals
|
|
106
|
+
%w[
|
|
107
|
+
conference_id
|
|
108
|
+
name
|
|
109
|
+
event_type
|
|
110
|
+
event_time
|
|
111
|
+
tag
|
|
112
|
+
call_id
|
|
113
|
+
to
|
|
114
|
+
from
|
|
115
|
+
account_id
|
|
116
|
+
recording_id
|
|
117
|
+
channels
|
|
118
|
+
start_time
|
|
119
|
+
end_time
|
|
120
|
+
duration
|
|
121
|
+
file_format
|
|
122
|
+
media_url
|
|
123
|
+
status
|
|
124
|
+
]
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# An array for nullable fields
|
|
128
|
+
def nullables
|
|
129
|
+
[]
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def initialize(conference_id = nil,
|
|
133
|
+
name = nil,
|
|
134
|
+
event_type = nil,
|
|
135
|
+
event_time = nil,
|
|
136
|
+
tag = nil,
|
|
137
|
+
call_id = nil,
|
|
138
|
+
to = nil,
|
|
139
|
+
from = nil,
|
|
140
|
+
account_id = nil,
|
|
141
|
+
recording_id = nil,
|
|
142
|
+
channels = nil,
|
|
143
|
+
start_time = nil,
|
|
144
|
+
end_time = nil,
|
|
145
|
+
duration = nil,
|
|
146
|
+
file_format = nil,
|
|
147
|
+
media_url = nil,
|
|
148
|
+
status = nil)
|
|
149
|
+
@conference_id = conference_id unless conference_id == SKIP
|
|
150
|
+
@name = name unless name == SKIP
|
|
151
|
+
@event_type = event_type unless event_type == SKIP
|
|
152
|
+
@event_time = event_time unless event_time == SKIP
|
|
153
|
+
@tag = tag unless tag == SKIP
|
|
154
|
+
@call_id = call_id unless call_id == SKIP
|
|
155
|
+
@to = to unless to == SKIP
|
|
156
|
+
@from = from unless from == SKIP
|
|
157
|
+
@account_id = account_id unless account_id == SKIP
|
|
158
|
+
@recording_id = recording_id unless recording_id == SKIP
|
|
159
|
+
@channels = channels unless channels == SKIP
|
|
160
|
+
@start_time = start_time unless start_time == SKIP
|
|
161
|
+
@end_time = end_time unless end_time == SKIP
|
|
162
|
+
@duration = duration unless duration == SKIP
|
|
163
|
+
@file_format = file_format unless file_format == SKIP
|
|
164
|
+
@media_url = media_url unless media_url == SKIP
|
|
165
|
+
@status = status unless status == SKIP
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Creates an instance of the object from a hash.
|
|
169
|
+
def self.from_hash(hash)
|
|
170
|
+
return nil unless hash
|
|
171
|
+
|
|
172
|
+
# Extract variables from the hash.
|
|
173
|
+
conference_id = hash.key?('conferenceId') ? hash['conferenceId'] : SKIP
|
|
174
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
|
175
|
+
event_type = hash.key?('eventType') ? hash['eventType'] : SKIP
|
|
176
|
+
event_time = hash.key?('eventTime') ? hash['eventTime'] : SKIP
|
|
177
|
+
tag = hash.key?('tag') ? hash['tag'] : SKIP
|
|
178
|
+
call_id = hash.key?('callId') ? hash['callId'] : SKIP
|
|
179
|
+
to = hash.key?('to') ? hash['to'] : SKIP
|
|
180
|
+
from = hash.key?('from') ? hash['from'] : SKIP
|
|
181
|
+
account_id = hash.key?('accountId') ? hash['accountId'] : SKIP
|
|
182
|
+
recording_id = hash.key?('recordingId') ? hash['recordingId'] : SKIP
|
|
183
|
+
channels = hash.key?('channels') ? hash['channels'] : SKIP
|
|
184
|
+
start_time = hash.key?('startTime') ? hash['startTime'] : SKIP
|
|
185
|
+
end_time = hash.key?('endTime') ? hash['endTime'] : SKIP
|
|
186
|
+
duration = hash.key?('duration') ? hash['duration'] : SKIP
|
|
187
|
+
file_format = hash.key?('fileFormat') ? hash['fileFormat'] : SKIP
|
|
188
|
+
media_url = hash.key?('mediaUrl') ? hash['mediaUrl'] : SKIP
|
|
189
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
|
190
|
+
|
|
191
|
+
# Create object from extracted values.
|
|
192
|
+
ConferenceCallback.new(conference_id,
|
|
193
|
+
name,
|
|
194
|
+
event_type,
|
|
195
|
+
event_time,
|
|
196
|
+
tag,
|
|
197
|
+
call_id,
|
|
198
|
+
to,
|
|
199
|
+
from,
|
|
200
|
+
account_id,
|
|
201
|
+
recording_id,
|
|
202
|
+
channels,
|
|
203
|
+
start_time,
|
|
204
|
+
end_time,
|
|
205
|
+
duration,
|
|
206
|
+
file_format,
|
|
207
|
+
media_url,
|
|
208
|
+
status)
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
end
|
|
@@ -7,29 +7,11 @@ module Bandwidth
|
|
|
7
7
|
# ConferenceEventMethod.
|
|
8
8
|
class ConferenceEventMethodEnum
|
|
9
9
|
CONFERENCE_EVENT_METHOD_ENUM = [
|
|
10
|
-
# TODO: Write general description for GET
|
|
11
|
-
GET = 'GET'.freeze,
|
|
12
|
-
|
|
13
|
-
# TODO: Write general description for HEAD
|
|
14
|
-
HEAD = 'HEAD'.freeze,
|
|
15
|
-
|
|
16
10
|
# TODO: Write general description for POST
|
|
17
11
|
POST = 'POST'.freeze,
|
|
18
12
|
|
|
19
|
-
# TODO: Write general description for
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# TODO: Write general description for PATCH
|
|
23
|
-
PATCH = 'PATCH'.freeze,
|
|
24
|
-
|
|
25
|
-
# TODO: Write general description for DELETE
|
|
26
|
-
DELETE = 'DELETE'.freeze,
|
|
27
|
-
|
|
28
|
-
# TODO: Write general description for OPTIONS
|
|
29
|
-
OPTIONS = 'OPTIONS'.freeze,
|
|
30
|
-
|
|
31
|
-
# TODO: Write general description for TRACE
|
|
32
|
-
TRACE = 'TRACE'.freeze
|
|
13
|
+
# TODO: Write general description for GET
|
|
14
|
+
GET = 'GET'.freeze
|
|
33
15
|
].freeze
|
|
34
16
|
end
|
|
35
17
|
end
|
data/lib/bandwidth/voice_lib/voice/models/{conference_member_detail.rb → conference_member_state.rb}
RENAMED
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
# ( https://apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module Bandwidth
|
|
7
|
-
#
|
|
8
|
-
class
|
|
7
|
+
# ConferenceMemberState Model.
|
|
8
|
+
class ConferenceMemberState < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
9
12
|
# TODO: Write general description for this method
|
|
10
13
|
# @return [String]
|
|
11
14
|
attr_accessor :call_id
|
|
@@ -42,18 +45,37 @@ module Bandwidth
|
|
|
42
45
|
@_hash
|
|
43
46
|
end
|
|
44
47
|
|
|
48
|
+
# An array for optional fields
|
|
49
|
+
def optionals
|
|
50
|
+
%w[
|
|
51
|
+
call_id
|
|
52
|
+
conference_id
|
|
53
|
+
member_url
|
|
54
|
+
mute
|
|
55
|
+
hold
|
|
56
|
+
call_ids_to_coach
|
|
57
|
+
]
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# An array for nullable fields
|
|
61
|
+
def nullables
|
|
62
|
+
%w[
|
|
63
|
+
call_ids_to_coach
|
|
64
|
+
]
|
|
65
|
+
end
|
|
66
|
+
|
|
45
67
|
def initialize(call_id = nil,
|
|
46
68
|
conference_id = nil,
|
|
47
69
|
member_url = nil,
|
|
48
70
|
mute = nil,
|
|
49
71
|
hold = nil,
|
|
50
72
|
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
|
|
73
|
+
@call_id = call_id unless call_id == SKIP
|
|
74
|
+
@conference_id = conference_id unless conference_id == SKIP
|
|
75
|
+
@member_url = member_url unless member_url == SKIP
|
|
76
|
+
@mute = mute unless mute == SKIP
|
|
77
|
+
@hold = hold unless hold == SKIP
|
|
78
|
+
@call_ids_to_coach = call_ids_to_coach unless call_ids_to_coach == SKIP
|
|
57
79
|
end
|
|
58
80
|
|
|
59
81
|
# Creates an instance of the object from a hash.
|
|
@@ -61,20 +83,21 @@ module Bandwidth
|
|
|
61
83
|
return nil unless hash
|
|
62
84
|
|
|
63
85
|
# 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 =
|
|
86
|
+
call_id = hash.key?('callId') ? hash['callId'] : SKIP
|
|
87
|
+
conference_id = hash.key?('conferenceId') ? hash['conferenceId'] : SKIP
|
|
88
|
+
member_url = hash.key?('memberUrl') ? hash['memberUrl'] : SKIP
|
|
89
|
+
mute = hash.key?('mute') ? hash['mute'] : SKIP
|
|
90
|
+
hold = hash.key?('hold') ? hash['hold'] : SKIP
|
|
91
|
+
call_ids_to_coach =
|
|
92
|
+
hash.key?('callIdsToCoach') ? hash['callIdsToCoach'] : SKIP
|
|
70
93
|
|
|
71
94
|
# Create object from extracted values.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
95
|
+
ConferenceMemberState.new(call_id,
|
|
96
|
+
conference_id,
|
|
97
|
+
member_url,
|
|
98
|
+
mute,
|
|
99
|
+
hold,
|
|
100
|
+
call_ids_to_coach)
|
|
78
101
|
end
|
|
79
102
|
end
|
|
80
103
|
end
|