bandwidth-sdk 7.1.0 → 9.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/bandwidth/api_helper.rb +20 -17
- data/lib/bandwidth/configuration.rb +7 -19
- data/lib/bandwidth/http/faraday_client.rb +1 -1
- data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +53 -42
- 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 +65 -32
- 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 +23 -6
- 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 +11 -0
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/base_controller.rb +3 -5
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/mfa_controller.rb +21 -16
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb +5 -2
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/forbidden_request_exception.rb +4 -1
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/unauthorized_request_exception.rb +4 -1
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb +27 -12
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_messaging_response.rb +17 -2
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_code_response.rb +17 -2
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb +29 -10
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_voice_response.rb +17 -2
- 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 +2 -2
- data/lib/bandwidth/utilities/file_wrapper.rb +1 -2
- data/lib/bandwidth/voice_lib/bxml/verbs/ring.rb +2 -1
- data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +173 -161
- data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +3 -5
- data/lib/bandwidth/voice_lib/voice/exceptions/api_error_exception.rb +6 -3
- data/lib/bandwidth/voice_lib/voice/models/call_callback.rb +343 -0
- data/lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb +78 -37
- data/lib/bandwidth/voice_lib/voice/models/call_state.rb +94 -42
- data/lib/bandwidth/voice_lib/voice/models/conference_callback.rb +211 -0
- data/lib/bandwidth/voice_lib/voice/models/conference_member_state.rb +35 -12
- data/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb +55 -24
- data/lib/bandwidth/voice_lib/voice/models/conference_state.rb +54 -17
- data/lib/bandwidth/voice_lib/voice/models/create_call_request.rb +173 -96
- data/lib/bandwidth/voice_lib/voice/models/create_call_response.rb +85 -41
- 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_request.rb +15 -2
- data/lib/bandwidth/voice_lib/voice/models/modify_call_request.rb +59 -19
- data/lib/bandwidth/voice_lib/voice/models/modify_conference_request.rb +55 -18
- data/lib/bandwidth/voice_lib/voice/models/transcribe_recording_request.rb +40 -12
- data/lib/bandwidth/voice_lib/voice/models/transcript.rb +20 -4
- data/lib/bandwidth/voice_lib/voice/models/transcription.rb +80 -0
- data/lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb +26 -8
- data/lib/bandwidth/voice_lib/voice/models/transcription_response.rb +18 -1
- data/lib/bandwidth/voice_lib/voice.rb +7 -1
- data/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb +5 -4
- data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +61 -50
- 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 +19 -18
- data/test/integration/test_integration.rb +110 -62
- metadata +13 -6
@@ -6,6 +6,9 @@
|
|
6
6
|
module Bandwidth
|
7
7
|
# CreateCallRequest Model.
|
8
8
|
class CreateCallRequest < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
9
12
|
# Format is E164
|
10
13
|
# @return [String]
|
11
14
|
attr_accessor :from
|
@@ -14,111 +17,134 @@ module Bandwidth
|
|
14
17
|
# @return [String]
|
15
18
|
attr_accessor :to
|
16
19
|
|
17
|
-
#
|
18
|
-
#
|
19
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
20
|
-
#
|
20
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
21
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
22
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
23
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
24
|
+
# characters, including parameters and separators.
|
21
25
|
# @return [String]
|
22
26
|
attr_accessor :uui
|
23
27
|
|
24
|
-
#
|
25
|
-
#
|
26
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
27
|
-
#
|
28
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
29
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
30
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
31
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
32
|
+
# characters, including parameters and separators.
|
28
33
|
# @return [Float]
|
29
34
|
attr_accessor :call_timeout
|
30
35
|
|
31
|
-
#
|
32
|
-
#
|
33
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
34
|
-
#
|
36
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
37
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
38
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
39
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
40
|
+
# characters, including parameters and separators.
|
35
41
|
# @return [Float]
|
36
42
|
attr_accessor :callback_timeout
|
37
43
|
|
38
|
-
#
|
39
|
-
#
|
40
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
41
|
-
#
|
44
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
45
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
46
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
47
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
48
|
+
# characters, including parameters and separators.
|
42
49
|
# @return [String]
|
43
50
|
attr_accessor :answer_url
|
44
51
|
|
45
|
-
#
|
46
|
-
#
|
47
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
48
|
-
#
|
52
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
53
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
54
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
55
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
56
|
+
# characters, including parameters and separators.
|
49
57
|
# @return [String]
|
50
58
|
attr_accessor :answer_fallback_url
|
51
59
|
|
52
|
-
#
|
53
|
-
#
|
54
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
55
|
-
#
|
60
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
61
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
62
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
63
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
64
|
+
# characters, including parameters and separators.
|
56
65
|
# @return [String]
|
57
66
|
attr_accessor :username
|
58
67
|
|
59
|
-
#
|
60
|
-
#
|
61
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
62
|
-
#
|
68
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
69
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
70
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
71
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
72
|
+
# characters, including parameters and separators.
|
63
73
|
# @return [String]
|
64
74
|
attr_accessor :password
|
65
75
|
|
66
|
-
#
|
67
|
-
#
|
68
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
69
|
-
#
|
76
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
77
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
78
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
79
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
80
|
+
# characters, including parameters and separators.
|
70
81
|
# @return [String]
|
71
82
|
attr_accessor :fallback_username
|
72
83
|
|
73
|
-
#
|
74
|
-
#
|
75
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
76
|
-
#
|
84
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
85
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
86
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
87
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
88
|
+
# characters, including parameters and separators.
|
77
89
|
# @return [String]
|
78
90
|
attr_accessor :fallback_password
|
79
91
|
|
80
|
-
#
|
81
|
-
#
|
82
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
83
|
-
#
|
92
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
93
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
94
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
95
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
96
|
+
# characters, including parameters and separators.
|
84
97
|
# @return [AnswerMethodEnum]
|
85
98
|
attr_accessor :answer_method
|
86
99
|
|
87
|
-
#
|
88
|
-
#
|
89
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
90
|
-
#
|
100
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
101
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
102
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
103
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
104
|
+
# characters, including parameters and separators.
|
91
105
|
# @return [AnswerFallbackMethodEnum]
|
92
106
|
attr_accessor :answer_fallback_method
|
93
107
|
|
94
|
-
#
|
95
|
-
#
|
96
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
97
|
-
#
|
108
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
109
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
110
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
111
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
112
|
+
# characters, including parameters and separators.
|
98
113
|
# @return [String]
|
99
114
|
attr_accessor :disconnect_url
|
100
115
|
|
101
|
-
#
|
102
|
-
#
|
103
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
104
|
-
#
|
116
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
117
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
118
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
119
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
120
|
+
# characters, including parameters and separators.
|
105
121
|
# @return [DisconnectMethodEnum]
|
106
122
|
attr_accessor :disconnect_method
|
107
123
|
|
108
|
-
#
|
109
|
-
#
|
110
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
111
|
-
#
|
124
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
125
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
126
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
127
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
128
|
+
# characters, including parameters and separators.
|
112
129
|
# @return [String]
|
113
130
|
attr_accessor :tag
|
114
131
|
|
115
|
-
#
|
116
|
-
#
|
117
|
-
# described in https://tools.ietf.org/html/rfc7433.
|
118
|
-
#
|
132
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
133
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
134
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
135
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
136
|
+
# characters, including parameters and separators.
|
119
137
|
# @return [String]
|
120
138
|
attr_accessor :application_id
|
121
139
|
|
140
|
+
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE
|
141
|
+
# when calling a SIP URI. Each value must end with an 'encoding' parameter
|
142
|
+
# as described in https://tools.ietf.org/html/rfc7433. Only 'jwt' and
|
143
|
+
# 'base64' encodings are allowed. The entire value cannot exceed 350
|
144
|
+
# characters, including parameters and separators.
|
145
|
+
# @return [MachineDetectionRequest]
|
146
|
+
attr_accessor :machine_detection
|
147
|
+
|
122
148
|
# A mapping from model property names to API property names.
|
123
149
|
def self.names
|
124
150
|
@_hash = {} if @_hash.nil?
|
@@ -139,9 +165,49 @@ module Bandwidth
|
|
139
165
|
@_hash['disconnect_method'] = 'disconnectMethod'
|
140
166
|
@_hash['tag'] = 'tag'
|
141
167
|
@_hash['application_id'] = 'applicationId'
|
168
|
+
@_hash['machine_detection'] = 'machineDetection'
|
142
169
|
@_hash
|
143
170
|
end
|
144
171
|
|
172
|
+
# An array for optional fields
|
173
|
+
def optionals
|
174
|
+
%w[
|
175
|
+
uui
|
176
|
+
call_timeout
|
177
|
+
callback_timeout
|
178
|
+
answer_fallback_url
|
179
|
+
username
|
180
|
+
password
|
181
|
+
fallback_username
|
182
|
+
fallback_password
|
183
|
+
answer_method
|
184
|
+
answer_fallback_method
|
185
|
+
disconnect_url
|
186
|
+
disconnect_method
|
187
|
+
tag
|
188
|
+
machine_detection
|
189
|
+
]
|
190
|
+
end
|
191
|
+
|
192
|
+
# An array for nullable fields
|
193
|
+
def nullables
|
194
|
+
%w[
|
195
|
+
uui
|
196
|
+
call_timeout
|
197
|
+
callback_timeout
|
198
|
+
answer_fallback_url
|
199
|
+
username
|
200
|
+
password
|
201
|
+
fallback_username
|
202
|
+
fallback_password
|
203
|
+
answer_method
|
204
|
+
answer_fallback_method
|
205
|
+
disconnect_url
|
206
|
+
disconnect_method
|
207
|
+
tag
|
208
|
+
]
|
209
|
+
end
|
210
|
+
|
145
211
|
def initialize(from = nil,
|
146
212
|
to = nil,
|
147
213
|
answer_url = nil,
|
@@ -158,24 +224,26 @@ module Bandwidth
|
|
158
224
|
answer_fallback_method = nil,
|
159
225
|
disconnect_url = nil,
|
160
226
|
disconnect_method = nil,
|
161
|
-
tag = nil
|
162
|
-
|
163
|
-
@
|
164
|
-
@
|
165
|
-
@
|
166
|
-
@
|
167
|
-
@
|
168
|
-
@
|
169
|
-
@
|
170
|
-
@
|
171
|
-
@
|
172
|
-
@
|
173
|
-
@
|
174
|
-
@
|
175
|
-
@
|
176
|
-
@
|
177
|
-
@
|
178
|
-
@
|
227
|
+
tag = nil,
|
228
|
+
machine_detection = nil)
|
229
|
+
@from = from unless from == SKIP
|
230
|
+
@to = to unless to == SKIP
|
231
|
+
@uui = uui unless uui == SKIP
|
232
|
+
@call_timeout = call_timeout unless call_timeout == SKIP
|
233
|
+
@callback_timeout = callback_timeout unless callback_timeout == SKIP
|
234
|
+
@answer_url = answer_url unless answer_url == SKIP
|
235
|
+
@answer_fallback_url = answer_fallback_url unless answer_fallback_url == SKIP
|
236
|
+
@username = username unless username == SKIP
|
237
|
+
@password = password unless password == SKIP
|
238
|
+
@fallback_username = fallback_username unless fallback_username == SKIP
|
239
|
+
@fallback_password = fallback_password unless fallback_password == SKIP
|
240
|
+
@answer_method = answer_method unless answer_method == SKIP
|
241
|
+
@answer_fallback_method = answer_fallback_method unless answer_fallback_method == SKIP
|
242
|
+
@disconnect_url = disconnect_url unless disconnect_url == SKIP
|
243
|
+
@disconnect_method = disconnect_method unless disconnect_method == SKIP
|
244
|
+
@tag = tag unless tag == SKIP
|
245
|
+
@application_id = application_id unless application_id == SKIP
|
246
|
+
@machine_detection = machine_detection unless machine_detection == SKIP
|
179
247
|
end
|
180
248
|
|
181
249
|
# Creates an instance of the object from a hash.
|
@@ -183,23 +251,31 @@ module Bandwidth
|
|
183
251
|
return nil unless hash
|
184
252
|
|
185
253
|
# Extract variables from the hash.
|
186
|
-
from = hash['from']
|
187
|
-
to = hash['to']
|
188
|
-
answer_url = hash['answerUrl']
|
189
|
-
application_id = hash['applicationId']
|
190
|
-
uui = hash['uui']
|
191
|
-
call_timeout = hash['callTimeout']
|
192
|
-
callback_timeout =
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
254
|
+
from = hash.key?('from') ? hash['from'] : SKIP
|
255
|
+
to = hash.key?('to') ? hash['to'] : SKIP
|
256
|
+
answer_url = hash.key?('answerUrl') ? hash['answerUrl'] : SKIP
|
257
|
+
application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP
|
258
|
+
uui = hash.key?('uui') ? hash['uui'] : SKIP
|
259
|
+
call_timeout = hash.key?('callTimeout') ? hash['callTimeout'] : SKIP
|
260
|
+
callback_timeout =
|
261
|
+
hash.key?('callbackTimeout') ? hash['callbackTimeout'] : SKIP
|
262
|
+
answer_fallback_url =
|
263
|
+
hash.key?('answerFallbackUrl') ? hash['answerFallbackUrl'] : SKIP
|
264
|
+
username = hash.key?('username') ? hash['username'] : SKIP
|
265
|
+
password = hash.key?('password') ? hash['password'] : SKIP
|
266
|
+
fallback_username =
|
267
|
+
hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP
|
268
|
+
fallback_password =
|
269
|
+
hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP
|
270
|
+
answer_method = hash.key?('answerMethod') ? hash['answerMethod'] : SKIP
|
271
|
+
answer_fallback_method =
|
272
|
+
hash.key?('answerFallbackMethod') ? hash['answerFallbackMethod'] : SKIP
|
273
|
+
disconnect_url = hash.key?('disconnectUrl') ? hash['disconnectUrl'] : SKIP
|
274
|
+
disconnect_method =
|
275
|
+
hash.key?('disconnectMethod') ? hash['disconnectMethod'] : SKIP
|
276
|
+
tag = hash.key?('tag') ? hash['tag'] : SKIP
|
277
|
+
machine_detection = MachineDetectionConfiguration.from_hash(hash['machineDetection']) if
|
278
|
+
hash['machineDetection']
|
203
279
|
|
204
280
|
# Create object from extracted values.
|
205
281
|
CreateCallRequest.new(from,
|
@@ -218,7 +294,8 @@ module Bandwidth
|
|
218
294
|
answer_fallback_method,
|
219
295
|
disconnect_url,
|
220
296
|
disconnect_method,
|
221
|
-
tag
|
297
|
+
tag,
|
298
|
+
machine_detection)
|
222
299
|
end
|
223
300
|
end
|
224
301
|
end
|
@@ -7,6 +7,9 @@ require 'date'
|
|
7
7
|
module Bandwidth
|
8
8
|
# CreateCallResponse Model.
|
9
9
|
class CreateCallResponse < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
10
13
|
# TODO: Write general description for this method
|
11
14
|
# @return [String]
|
12
15
|
attr_accessor :account_id
|
@@ -113,6 +116,38 @@ module Bandwidth
|
|
113
116
|
@_hash
|
114
117
|
end
|
115
118
|
|
119
|
+
# An array for optional fields
|
120
|
+
def optionals
|
121
|
+
%w[
|
122
|
+
start_time
|
123
|
+
call_timeout
|
124
|
+
callback_timeout
|
125
|
+
answer_fallback_url
|
126
|
+
answer_fallback_method
|
127
|
+
disconnect_url
|
128
|
+
username
|
129
|
+
password
|
130
|
+
fallback_username
|
131
|
+
fallback_password
|
132
|
+
tag
|
133
|
+
]
|
134
|
+
end
|
135
|
+
|
136
|
+
# An array for nullable fields
|
137
|
+
def nullables
|
138
|
+
%w[
|
139
|
+
answer_fallback_url
|
140
|
+
answer_fallback_method
|
141
|
+
disconnect_url
|
142
|
+
disconnect_method
|
143
|
+
username
|
144
|
+
password
|
145
|
+
fallback_username
|
146
|
+
fallback_password
|
147
|
+
tag
|
148
|
+
]
|
149
|
+
end
|
150
|
+
|
116
151
|
def initialize(account_id = nil,
|
117
152
|
call_id = nil,
|
118
153
|
application_id = nil,
|
@@ -133,26 +168,26 @@ module Bandwidth
|
|
133
168
|
fallback_username = nil,
|
134
169
|
fallback_password = nil,
|
135
170
|
tag = nil)
|
136
|
-
@account_id = account_id
|
137
|
-
@call_id = call_id
|
138
|
-
@application_id = application_id
|
139
|
-
@to = to
|
140
|
-
@from = from
|
141
|
-
@start_time = start_time
|
142
|
-
@call_url = call_url
|
143
|
-
@call_timeout = call_timeout
|
144
|
-
@callback_timeout = callback_timeout
|
145
|
-
@answer_url = answer_url
|
146
|
-
@answer_method = answer_method
|
147
|
-
@answer_fallback_url = answer_fallback_url
|
148
|
-
@answer_fallback_method = answer_fallback_method
|
149
|
-
@disconnect_url = disconnect_url
|
150
|
-
@disconnect_method = disconnect_method
|
151
|
-
@username = username
|
152
|
-
@password = password
|
153
|
-
@fallback_username = fallback_username
|
154
|
-
@fallback_password = fallback_password
|
155
|
-
@tag = tag
|
171
|
+
@account_id = account_id unless account_id == SKIP
|
172
|
+
@call_id = call_id unless call_id == SKIP
|
173
|
+
@application_id = application_id unless application_id == SKIP
|
174
|
+
@to = to unless to == SKIP
|
175
|
+
@from = from unless from == SKIP
|
176
|
+
@start_time = start_time unless start_time == SKIP
|
177
|
+
@call_url = call_url unless call_url == SKIP
|
178
|
+
@call_timeout = call_timeout unless call_timeout == SKIP
|
179
|
+
@callback_timeout = callback_timeout unless callback_timeout == SKIP
|
180
|
+
@answer_url = answer_url unless answer_url == SKIP
|
181
|
+
@answer_method = answer_method unless answer_method == SKIP
|
182
|
+
@answer_fallback_url = answer_fallback_url unless answer_fallback_url == SKIP
|
183
|
+
@answer_fallback_method = answer_fallback_method unless answer_fallback_method == SKIP
|
184
|
+
@disconnect_url = disconnect_url unless disconnect_url == SKIP
|
185
|
+
@disconnect_method = disconnect_method unless disconnect_method == SKIP
|
186
|
+
@username = username unless username == SKIP
|
187
|
+
@password = password unless password == SKIP
|
188
|
+
@fallback_username = fallback_username unless fallback_username == SKIP
|
189
|
+
@fallback_password = fallback_password unless fallback_password == SKIP
|
190
|
+
@tag = tag unless tag == SKIP
|
156
191
|
end
|
157
192
|
|
158
193
|
# Creates an instance of the object from a hash.
|
@@ -160,27 +195,36 @@ module Bandwidth
|
|
160
195
|
return nil unless hash
|
161
196
|
|
162
197
|
# Extract variables from the hash.
|
163
|
-
account_id = hash['accountId']
|
164
|
-
call_id = hash['callId']
|
165
|
-
application_id = hash['applicationId']
|
166
|
-
to = hash['to']
|
167
|
-
from = hash['from']
|
168
|
-
call_url = hash['callUrl']
|
169
|
-
answer_url = hash['answerUrl']
|
170
|
-
answer_method = hash['answerMethod']
|
171
|
-
disconnect_method =
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
198
|
+
account_id = hash.key?('accountId') ? hash['accountId'] : SKIP
|
199
|
+
call_id = hash.key?('callId') ? hash['callId'] : SKIP
|
200
|
+
application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP
|
201
|
+
to = hash.key?('to') ? hash['to'] : SKIP
|
202
|
+
from = hash.key?('from') ? hash['from'] : SKIP
|
203
|
+
call_url = hash.key?('callUrl') ? hash['callUrl'] : SKIP
|
204
|
+
answer_url = hash.key?('answerUrl') ? hash['answerUrl'] : SKIP
|
205
|
+
answer_method = hash.key?('answerMethod') ? hash['answerMethod'] : SKIP
|
206
|
+
disconnect_method =
|
207
|
+
hash.key?('disconnectMethod') ? hash['disconnectMethod'] : SKIP
|
208
|
+
start_time = if hash.key?('startTime')
|
209
|
+
(DateTimeHelper.from_rfc3339(hash['startTime']) if hash['startTime'])
|
210
|
+
else
|
211
|
+
SKIP
|
212
|
+
end
|
213
|
+
call_timeout = hash.key?('callTimeout') ? hash['callTimeout'] : SKIP
|
214
|
+
callback_timeout =
|
215
|
+
hash.key?('callbackTimeout') ? hash['callbackTimeout'] : SKIP
|
216
|
+
answer_fallback_url =
|
217
|
+
hash.key?('answerFallbackUrl') ? hash['answerFallbackUrl'] : SKIP
|
218
|
+
answer_fallback_method =
|
219
|
+
hash.key?('answerFallbackMethod') ? hash['answerFallbackMethod'] : SKIP
|
220
|
+
disconnect_url = hash.key?('disconnectUrl') ? hash['disconnectUrl'] : SKIP
|
221
|
+
username = hash.key?('username') ? hash['username'] : SKIP
|
222
|
+
password = hash.key?('password') ? hash['password'] : SKIP
|
223
|
+
fallback_username =
|
224
|
+
hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP
|
225
|
+
fallback_password =
|
226
|
+
hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP
|
227
|
+
tag = hash.key?('tag') ? hash['tag'] : SKIP
|
184
228
|
|
185
229
|
# Create object from extracted values.
|
186
230
|
CreateCallResponse.new(account_id,
|
@@ -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
|
+
# Diversion Model.
|
8
|
+
class Diversion < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :reason
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :privacy
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :unknown
|
23
|
+
|
24
|
+
# TODO: Write general description for this method
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :orig_to
|
27
|
+
|
28
|
+
# A mapping from model property names to API property names.
|
29
|
+
def self.names
|
30
|
+
@_hash = {} if @_hash.nil?
|
31
|
+
@_hash['reason'] = 'reason'
|
32
|
+
@_hash['privacy'] = 'privacy'
|
33
|
+
@_hash['unknown'] = 'unknown'
|
34
|
+
@_hash['orig_to'] = 'origTo'
|
35
|
+
@_hash
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for optional fields
|
39
|
+
def optionals
|
40
|
+
%w[
|
41
|
+
reason
|
42
|
+
privacy
|
43
|
+
unknown
|
44
|
+
orig_to
|
45
|
+
]
|
46
|
+
end
|
47
|
+
|
48
|
+
# An array for nullable fields
|
49
|
+
def nullables
|
50
|
+
[]
|
51
|
+
end
|
52
|
+
|
53
|
+
def initialize(reason = nil,
|
54
|
+
privacy = nil,
|
55
|
+
unknown = nil,
|
56
|
+
orig_to = nil)
|
57
|
+
@reason = reason unless reason == SKIP
|
58
|
+
@privacy = privacy unless privacy == SKIP
|
59
|
+
@unknown = unknown unless unknown == SKIP
|
60
|
+
@orig_to = orig_to unless orig_to == SKIP
|
61
|
+
end
|
62
|
+
|
63
|
+
# Creates an instance of the object from a hash.
|
64
|
+
def self.from_hash(hash)
|
65
|
+
return nil unless hash
|
66
|
+
|
67
|
+
# Extract variables from the hash.
|
68
|
+
reason = hash.key?('reason') ? hash['reason'] : SKIP
|
69
|
+
privacy = hash.key?('privacy') ? hash['privacy'] : SKIP
|
70
|
+
unknown = hash.key?('unknown') ? hash['unknown'] : SKIP
|
71
|
+
orig_to = hash.key?('origTo') ? hash['origTo'] : SKIP
|
72
|
+
|
73
|
+
# Create object from extracted values.
|
74
|
+
Diversion.new(reason,
|
75
|
+
privacy,
|
76
|
+
unknown,
|
77
|
+
orig_to)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# bandwidth
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module Bandwidth
|
7
|
+
# FallbackMethod.
|
8
|
+
class FallbackMethodEnum
|
9
|
+
FALLBACK_METHOD_ENUM = [
|
10
|
+
# TODO: Write general description for POST
|
11
|
+
POST = 'POST'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for GET
|
14
|
+
GET = 'GET'.freeze
|
15
|
+
].freeze
|
16
|
+
end
|
17
|
+
end
|