bandwidth-sdk 6.1.0 → 8.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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +89 -12
  3. data/lib/bandwidth.rb +5 -2
  4. data/lib/bandwidth/api_helper.rb +5 -17
  5. data/lib/bandwidth/client.rb +23 -9
  6. data/lib/bandwidth/configuration.rb +54 -18
  7. data/lib/bandwidth/http/auth/{two_factor_auth_basic_auth.rb → multi_factor_auth_basic_auth.rb} +3 -3
  8. data/lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb +22 -0
  9. data/lib/bandwidth/http/faraday_client.rb +5 -2
  10. data/lib/bandwidth/messaging_lib/messaging/client.rb +14 -5
  11. data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +25 -29
  12. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb +47 -2
  13. data/lib/bandwidth/messaging_lib/messaging/models/media.rb +5 -75
  14. data/lib/bandwidth/models/base_model.rb +19 -8
  15. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth.rb +23 -0
  16. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/client.rb +15 -6
  17. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/controllers/base_controller.rb +0 -0
  18. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/controllers/mfa_controller.rb +7 -7
  19. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/exceptions/error_with_request_exception.rb +0 -0
  20. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/exceptions/forbidden_request_exception.rb +0 -0
  21. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/exceptions/unauthorized_request_exception.rb +0 -0
  22. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_code_request_schema.rb +0 -0
  23. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_messaging_response.rb +0 -0
  24. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_verify_code_response.rb +0 -0
  25. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_verify_request_schema.rb +0 -0
  26. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth → multi_factor_auth_lib/multi_factor_auth}/models/two_factor_voice_response.rb +0 -0
  27. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup.rb +20 -0
  28. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/client.rb +60 -0
  29. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb +1551 -0
  30. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb +49 -0
  31. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb +29 -0
  32. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb +35 -0
  33. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb +45 -0
  34. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb +74 -0
  35. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb +107 -0
  36. data/lib/bandwidth/utilities/date_time_helper.rb +156 -0
  37. data/lib/bandwidth/voice_lib/voice.rb +14 -18
  38. data/lib/bandwidth/voice_lib/voice/client.rb +14 -5
  39. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +248 -230
  40. data/lib/bandwidth/voice_lib/voice/exceptions/{api_error_response_exception.rb → api_error_exception.rb} +2 -2
  41. data/lib/bandwidth/voice_lib/voice/models/{recording_metadata_response.rb → call_recording_metadata.rb} +47 -28
  42. data/lib/bandwidth/voice_lib/voice/models/call_state.rb +232 -0
  43. data/lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb +2 -20
  44. data/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb +2 -20
  45. data/lib/bandwidth/voice_lib/voice/models/{conference_member_detail.rb → conference_member_state.rb} +8 -8
  46. data/lib/bandwidth/voice_lib/voice/models/{conference_recording_metadata_response.rb → conference_recording_metadata.rb} +34 -18
  47. data/lib/bandwidth/voice_lib/voice/models/{conference_detail.rb → conference_state.rb} +22 -14
  48. data/lib/bandwidth/voice_lib/voice/models/{api_create_call_request.rb → create_call_request.rb} +35 -59
  49. data/lib/bandwidth/voice_lib/voice/models/{api_call_response.rb → create_call_response.rb} +28 -23
  50. data/lib/bandwidth/voice_lib/voice/models/{modify_call_recording_state.rb → modify_call_recording_request.rb} +4 -4
  51. data/lib/bandwidth/voice_lib/voice/models/{api_modify_call_request.rb → modify_call_request.rb} +25 -25
  52. data/lib/bandwidth/voice_lib/voice/models/{api_modify_conference_request.rb → modify_conference_request.rb} +11 -11
  53. data/lib/bandwidth/voice_lib/voice/models/state1_enum.rb +7 -4
  54. data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +4 -7
  55. data/lib/bandwidth/voice_lib/voice/models/{api_transcribe_recording_request.rb → transcribe_recording_request.rb} +8 -8
  56. data/lib/bandwidth/voice_lib/voice/models/{transcription.rb → transcription_metadata.rb} +19 -10
  57. data/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb +7 -2
  58. data/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +14 -5
  59. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +14 -14
  60. data/lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb +2 -2
  61. data/test/controllers/controller_test_base.rb +21 -0
  62. data/test/http_response_catcher.rb +19 -0
  63. data/test/integration/test_integration.rb +39 -13
  64. data/test/test_helper.rb +94 -0
  65. metadata +47 -37
  66. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth.rb +0 -22
  67. data/lib/bandwidth/voice_lib/voice/models/api_call_state_response.rb +0 -164
  68. data/lib/bandwidth/voice_lib/voice/models/disconnect_cause_enum.rb +0 -47
  69. data/lib/bandwidth/voice_lib/voice/models/state2_enum.rb +0 -20
  70. data/lib/bandwidth/voice_lib/voice/models/status1_enum.rb +0 -29
  71. data/lib/bandwidth/voice_lib/voice/models/status3_enum.rb +0 -32
@@ -0,0 +1,94 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ require 'tempfile'
7
+ require 'open-uri'
8
+
9
+ class TestHelper
10
+
11
+ @cache = Hash.new
12
+
13
+ # Class method to compare the received headers with the expected headers.
14
+ # @param [Hash] A hash of expected headers (keys in lower case).
15
+ # @param [Hash] A hash of received headers.
16
+ # @param [Boolean, optional] A flag which determines if we allow extra headers.
17
+ def self.match_headers(expected_headers,
18
+ received_headers,
19
+ allow_extra: true)
20
+ return false if ((received_headers.length < expected_headers.length) ||
21
+ ((allow_extra == false) && (received_headers.length > expected_headers.length)))
22
+
23
+ received_headers = Hash[received_headers.map{|k, v| [k.to_s.downcase, v]}]
24
+ expected_headers.each do |e_key, e_value|
25
+ return false unless received_headers.key?(e_key)
26
+ return false if ((e_value != nil) &&
27
+ (e_value != received_headers[e_key]))
28
+ end
29
+
30
+ return true
31
+ end
32
+
33
+ # Class method to compare the received body with the expected body.
34
+ # @param [Dynamic] The expected body.
35
+ # @param [Dynamic] The received body.
36
+ # @param [Boolean, optional] A flag which determines if we check values in dictionaries.
37
+ # @param [Boolean, optional] A flag which determines if we check the order of array elements.
38
+ # @param [Boolean, optional] A flag which determines if we check the count of array elements.
39
+ def self.match_body(expected_body,
40
+ received_body,
41
+ check_values: false,
42
+ check_order: false,
43
+ check_count: false)
44
+ if expected_body.instance_of? Hash
45
+ return false unless received_body.instance_of? Hash
46
+ for key in expected_body.keys
47
+ return false unless received_body.keys.include? key
48
+ if check_values or expected_body[key].instance_of? Hash
49
+ return false unless TestHelper.match_body(expected_body[key],
50
+ received_body[key],
51
+ check_values: check_values,
52
+ check_order: check_order,
53
+ check_count: check_count)
54
+ end
55
+ end
56
+ elsif expected_body.instance_of? Array
57
+ return False unless received_body.instance_of? Array
58
+ if check_count == true && (expected_body.length != received_body.length)
59
+ return false
60
+ else
61
+ previous_matches = Array.new
62
+ expected_body.each.with_index do |expected_element, i|
63
+ matches = (received_body.map.with_index do |received_element, j|
64
+ j if TestHelper.match_body(expected_element,
65
+ received_element,
66
+ check_values: check_values,
67
+ check_order: check_order,
68
+ check_count: check_count)
69
+ end).compact
70
+ return false if matches.length == 0
71
+ if check_order == true
72
+ return false if (i != 0 && matches.map{|x| previous_matches.map{|y| y > x}.all?}.all?)
73
+ previous_matches = matches
74
+ end
75
+ end
76
+ end
77
+ elsif expected_body != received_body
78
+ return false
79
+ end
80
+ return true
81
+ end
82
+
83
+ # Class method which takes a URL, downloads the file (if not already downloaded
84
+ # for this test session) and returns the path of the file.
85
+ # @param [String] The URL of the required file.
86
+ def self.get_file(url)
87
+ unless @cache.keys.include? url
88
+ @cache[url] = Tempfile.new('APIMatic')
89
+ @cache[url].binmode
90
+ @cache[url].write(open(url, {ssl_ca_cert: Certifi.where}).read)
91
+ end
92
+ return @cache[url].path
93
+ end
94
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bandwidth-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 8.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - APIMatic SDK Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-23 00:00:00.000000000 Z
11
+ date: 2021-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -31,9 +31,9 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
- - - ">="
34
+ - - "<="
35
35
  - !ruby/object:Gem::Version
36
- version: 1.0.1
36
+ version: 1.3.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -41,9 +41,9 @@ dependencies:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
43
  version: '1.0'
44
- - - ">="
44
+ - - "<="
45
45
  - !ruby/object:Gem::Version
46
- version: 1.0.1
46
+ version: 1.3.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: faraday_middleware
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -155,7 +155,8 @@ files:
155
155
  - lib/bandwidth/exceptions/api_exception.rb
156
156
  - lib/bandwidth/http/api_response.rb
157
157
  - lib/bandwidth/http/auth/messaging_basic_auth.rb
158
- - lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
158
+ - lib/bandwidth/http/auth/multi_factor_auth_basic_auth.rb
159
+ - lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb
159
160
  - lib/bandwidth/http/auth/voice_basic_auth.rb
160
161
  - lib/bandwidth/http/auth/web_rtc_basic_auth.rb
161
162
  - lib/bandwidth/http/faraday_client.rb
@@ -180,18 +181,28 @@ files:
180
181
  - lib/bandwidth/messaging_lib/messaging/models/priority_enum.rb
181
182
  - lib/bandwidth/messaging_lib/messaging/models/tag.rb
182
183
  - lib/bandwidth/models/base_model.rb
183
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth.rb
184
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/client.rb
185
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/base_controller.rb
186
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/mfa_controller.rb
187
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/error_with_request_exception.rb
188
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/forbidden_request_exception.rb
189
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/unauthorized_request_exception.rb
190
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb
191
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_messaging_response.rb
192
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_code_response.rb
193
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb
194
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_voice_response.rb
184
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth.rb
185
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/client.rb
186
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/base_controller.rb
187
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/mfa_controller.rb
188
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb
189
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/forbidden_request_exception.rb
190
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/unauthorized_request_exception.rb
191
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb
192
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_messaging_response.rb
193
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_code_response.rb
194
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb
195
+ - lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_voice_response.rb
196
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup.rb
197
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/client.rb
198
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb
199
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb
200
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb
201
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb
202
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb
203
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb
204
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb
205
+ - lib/bandwidth/utilities/date_time_helper.rb
195
206
  - lib/bandwidth/utilities/file_wrapper.rb
196
207
  - lib/bandwidth/voice_lib/bxml/bxml.rb
197
208
  - lib/bandwidth/voice_lib/bxml/verbs/bridge.rb
@@ -221,36 +232,32 @@ files:
221
232
  - lib/bandwidth/voice_lib/voice/client.rb
222
233
  - lib/bandwidth/voice_lib/voice/controllers/api_controller.rb
223
234
  - lib/bandwidth/voice_lib/voice/controllers/base_controller.rb
224
- - lib/bandwidth/voice_lib/voice/exceptions/api_error_response_exception.rb
235
+ - lib/bandwidth/voice_lib/voice/exceptions/api_error_exception.rb
225
236
  - lib/bandwidth/voice_lib/voice/models/answer_fallback_method_enum.rb
226
237
  - lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb
227
- - lib/bandwidth/voice_lib/voice/models/api_call_response.rb
228
- - lib/bandwidth/voice_lib/voice/models/api_call_state_response.rb
229
- - lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb
230
- - lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb
231
- - lib/bandwidth/voice_lib/voice/models/api_modify_conference_request.rb
232
- - lib/bandwidth/voice_lib/voice/models/api_transcribe_recording_request.rb
238
+ - lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb
239
+ - lib/bandwidth/voice_lib/voice/models/call_state.rb
233
240
  - lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb
234
- - lib/bandwidth/voice_lib/voice/models/conference_detail.rb
235
241
  - lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb
236
- - lib/bandwidth/voice_lib/voice/models/conference_member_detail.rb
237
- - lib/bandwidth/voice_lib/voice/models/conference_recording_metadata_response.rb
242
+ - lib/bandwidth/voice_lib/voice/models/conference_member_state.rb
243
+ - lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb
244
+ - lib/bandwidth/voice_lib/voice/models/conference_state.rb
245
+ - lib/bandwidth/voice_lib/voice/models/create_call_request.rb
246
+ - lib/bandwidth/voice_lib/voice/models/create_call_response.rb
238
247
  - lib/bandwidth/voice_lib/voice/models/direction_enum.rb
239
- - lib/bandwidth/voice_lib/voice/models/disconnect_cause_enum.rb
240
248
  - lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb
241
249
  - lib/bandwidth/voice_lib/voice/models/file_format_enum.rb
242
- - lib/bandwidth/voice_lib/voice/models/modify_call_recording_state.rb
243
- - lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb
250
+ - lib/bandwidth/voice_lib/voice/models/modify_call_recording_request.rb
251
+ - lib/bandwidth/voice_lib/voice/models/modify_call_request.rb
252
+ - lib/bandwidth/voice_lib/voice/models/modify_conference_request.rb
244
253
  - lib/bandwidth/voice_lib/voice/models/redirect_fallback_method_enum.rb
245
254
  - lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb
246
255
  - lib/bandwidth/voice_lib/voice/models/state1_enum.rb
247
- - lib/bandwidth/voice_lib/voice/models/state2_enum.rb
248
256
  - lib/bandwidth/voice_lib/voice/models/state_enum.rb
249
- - lib/bandwidth/voice_lib/voice/models/status1_enum.rb
250
- - lib/bandwidth/voice_lib/voice/models/status3_enum.rb
251
257
  - lib/bandwidth/voice_lib/voice/models/status_enum.rb
258
+ - lib/bandwidth/voice_lib/voice/models/transcribe_recording_request.rb
252
259
  - lib/bandwidth/voice_lib/voice/models/transcript.rb
253
- - lib/bandwidth/voice_lib/voice/models/transcription.rb
260
+ - lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb
254
261
  - lib/bandwidth/voice_lib/voice/models/transcription_response.rb
255
262
  - lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb
256
263
  - lib/bandwidth/web_rtc_lib/web_rtc.rb
@@ -265,7 +272,10 @@ files:
265
272
  - lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb
266
273
  - lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
267
274
  - lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb
275
+ - test/controllers/controller_test_base.rb
276
+ - test/http_response_catcher.rb
268
277
  - test/integration/test_integration.rb
278
+ - test/test_helper.rb
269
279
  homepage: https://apimatic.io
270
280
  licenses:
271
281
  - MIT
@@ -285,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
295
  - !ruby/object:Gem::Version
286
296
  version: '0'
287
297
  requirements: []
288
- rubygems_version: 3.2.3
298
+ rubygems_version: 3.2.22
289
299
  signing_key:
290
300
  specification_version: 4
291
301
  summary: bandwidth
@@ -1,22 +0,0 @@
1
- # bandwidth
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
-
7
- require_relative 'two_factor_auth/client.rb'
8
-
9
- # Models
10
- require_relative 'two_factor_auth/models/two_factor_code_request_schema.rb'
11
- require_relative 'two_factor_auth/models/two_factor_voice_response.rb'
12
- require_relative 'two_factor_auth/models/two_factor_messaging_response.rb'
13
- require_relative 'two_factor_auth/models/two_factor_verify_request_schema.rb'
14
- require_relative 'two_factor_auth/models/two_factor_verify_code_response.rb'
15
-
16
- # Exceptions
17
- require_relative 'two_factor_auth/exceptions/error_with_request_exception.rb'
18
- require_relative 'two_factor_auth/exceptions/unauthorized_request_exception.rb'
19
- require_relative 'two_factor_auth/exceptions/forbidden_request_exception.rb'
20
- # Controllers
21
- require_relative 'two_factor_auth/controllers/base_controller.rb'
22
- require_relative 'two_factor_auth/controllers/mfa_controller.rb'
@@ -1,164 +0,0 @@
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
- # ApiCallStateResponse Model.
9
- class ApiCallStateResponse < BaseModel
10
- # TODO: Write general description for this method
11
- # @return [String]
12
- attr_accessor :call_id
13
-
14
- # TODO: Write general description for this method
15
- # @return [String]
16
- attr_accessor :parent_call_id
17
-
18
- # TODO: Write general description for this method
19
- # @return [String]
20
- attr_accessor :application_id
21
-
22
- # TODO: Write general description for this method
23
- # @return [String]
24
- attr_accessor :account_id
25
-
26
- # TODO: Write general description for this method
27
- # @return [String]
28
- attr_accessor :to
29
-
30
- # TODO: Write general description for this method
31
- # @return [String]
32
- attr_accessor :from
33
-
34
- # TODO: Write general description for this method
35
- # @return [String]
36
- attr_accessor :direction
37
-
38
- # TODO: Write general description for this method
39
- # @return [StateEnum]
40
- attr_accessor :state
41
-
42
- # TODO: Write general description for this method
43
- # @return [DateTime]
44
- attr_accessor :start_time
45
-
46
- # TODO: Write general description for this method
47
- # @return [DateTime]
48
- attr_accessor :answer_time
49
-
50
- # TODO: Write general description for this method
51
- # @return [DateTime]
52
- attr_accessor :end_time
53
-
54
- # TODO: Write general description for this method
55
- # @return [DisconnectCauseEnum]
56
- attr_accessor :disconnect_cause
57
-
58
- # TODO: Write general description for this method
59
- # @return [String]
60
- attr_accessor :error_message
61
-
62
- # TODO: Write general description for this method
63
- # @return [String]
64
- attr_accessor :error_id
65
-
66
- # TODO: Write general description for this method
67
- # @return [DateTime]
68
- attr_accessor :last_update
69
-
70
- # A mapping from model property names to API property names.
71
- def self.names
72
- @_hash = {} if @_hash.nil?
73
- @_hash['call_id'] = 'callId'
74
- @_hash['parent_call_id'] = 'parentCallId'
75
- @_hash['application_id'] = 'applicationId'
76
- @_hash['account_id'] = 'accountId'
77
- @_hash['to'] = 'to'
78
- @_hash['from'] = 'from'
79
- @_hash['direction'] = 'direction'
80
- @_hash['state'] = 'state'
81
- @_hash['start_time'] = 'startTime'
82
- @_hash['answer_time'] = 'answerTime'
83
- @_hash['end_time'] = 'endTime'
84
- @_hash['disconnect_cause'] = 'disconnectCause'
85
- @_hash['error_message'] = 'errorMessage'
86
- @_hash['error_id'] = 'errorId'
87
- @_hash['last_update'] = 'lastUpdate'
88
- @_hash
89
- end
90
-
91
- def initialize(call_id = nil,
92
- parent_call_id = nil,
93
- application_id = nil,
94
- account_id = nil,
95
- to = nil,
96
- from = nil,
97
- direction = nil,
98
- state = nil,
99
- start_time = nil,
100
- answer_time = nil,
101
- end_time = nil,
102
- disconnect_cause = nil,
103
- error_message = nil,
104
- error_id = nil,
105
- last_update = nil)
106
- @call_id = call_id
107
- @parent_call_id = parent_call_id
108
- @application_id = application_id
109
- @account_id = account_id
110
- @to = to
111
- @from = from
112
- @direction = direction
113
- @state = state
114
- @start_time = start_time
115
- @answer_time = answer_time
116
- @end_time = end_time
117
- @disconnect_cause = disconnect_cause
118
- @error_message = error_message
119
- @error_id = error_id
120
- @last_update = last_update
121
- end
122
-
123
- # Creates an instance of the object from a hash.
124
- def self.from_hash(hash)
125
- return nil unless hash
126
-
127
- # Extract variables from the hash.
128
- call_id = hash['callId']
129
- parent_call_id = hash['parentCallId']
130
- application_id = hash['applicationId']
131
- account_id = hash['accountId']
132
- to = hash['to']
133
- from = hash['from']
134
- direction = hash['direction']
135
- state = hash['state']
136
- start_time = APIHelper.rfc3339(hash['startTime']) if hash['startTime']
137
- answer_time = APIHelper.rfc3339(hash['answerTime']) if
138
- hash['answerTime']
139
- end_time = APIHelper.rfc3339(hash['endTime']) if hash['endTime']
140
- disconnect_cause = hash['disconnectCause']
141
- error_message = hash['errorMessage']
142
- error_id = hash['errorId']
143
- last_update = APIHelper.rfc3339(hash['lastUpdate']) if
144
- hash['lastUpdate']
145
-
146
- # Create object from extracted values.
147
- ApiCallStateResponse.new(call_id,
148
- parent_call_id,
149
- application_id,
150
- account_id,
151
- to,
152
- from,
153
- direction,
154
- state,
155
- start_time,
156
- answer_time,
157
- end_time,
158
- disconnect_cause,
159
- error_message,
160
- error_id,
161
- last_update)
162
- end
163
- end
164
- end
@@ -1,47 +0,0 @@
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