bandwidth-sdk 3.13.2 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +90 -13
  4. data/lib/bandwidth.rb +2 -0
  5. data/lib/bandwidth/api_helper.rb +5 -5
  6. data/lib/bandwidth/client.rb +15 -1
  7. data/lib/bandwidth/configuration.rb +40 -4
  8. data/lib/bandwidth/http/api_response.rb +2 -0
  9. data/lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb +22 -0
  10. data/lib/bandwidth/http/faraday_client.rb +14 -4
  11. data/lib/bandwidth/messaging_lib/messaging.rb +4 -0
  12. data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +135 -20
  13. data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +1 -1
  14. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb +23 -13
  15. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb +125 -0
  16. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb +60 -0
  17. data/lib/bandwidth/messaging_lib/messaging/models/media.rb +4 -4
  18. data/lib/bandwidth/messaging_lib/messaging/models/message_request.rb +21 -8
  19. data/lib/bandwidth/messaging_lib/messaging/models/page_info.rb +62 -0
  20. data/lib/bandwidth/messaging_lib/messaging/models/priority_enum.rb +19 -0
  21. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup.rb +20 -0
  22. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/client.rb +60 -0
  23. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb +1551 -0
  24. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb +49 -0
  25. data/lib/bandwidth/{two_factor_auth_lib/two_factor_auth/exceptions/invalid_request_exception.rb → phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb} +5 -5
  26. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb +35 -0
  27. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb +45 -0
  28. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb +74 -0
  29. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb +107 -0
  30. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth.rb +4 -2
  31. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/client.rb +4 -4
  32. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/base_controller.rb +1 -1
  33. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/{api_controller.rb → mfa_controller.rb} +65 -14
  34. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/error_with_request_exception.rb +34 -0
  35. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/forbidden_request_exception.rb +29 -0
  36. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/unauthorized_request_exception.rb +29 -0
  37. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb +0 -19
  38. data/lib/bandwidth/voice_lib/voice.rb +1 -1
  39. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +51 -52
  40. data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +1 -1
  41. data/lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb +77 -17
  42. data/lib/bandwidth/voice_lib/voice/models/{call_engine_modify_conference_request.rb → api_modify_conference_request.rb} +14 -14
  43. data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +3 -3
  44. data/lib/bandwidth/web_rtc_lib/web_rtc.rb +1 -0
  45. data/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +10 -1
  46. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +24 -24
  47. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +1 -1
  48. data/lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb +17 -0
  49. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb +11 -2
  50. data/test/controllers/controller_test_base.rb +21 -0
  51. data/test/http_response_catcher.rb +19 -0
  52. data/test/integration/test_integration.rb +583 -0
  53. data/test/test_helper.rb +94 -0
  54. metadata +66 -11
@@ -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: 3.13.2
4
+ version: 6.2.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-01-08 00:00:00.000000000 Z
11
+ date: 2021-07-12 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
@@ -106,6 +106,40 @@ dependencies:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
108
  version: 3.2.4
109
+ - !ruby/object:Gem::Dependency
110
+ name: minitest
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '5.14'
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: 5.14.1
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '5.14'
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: 5.14.1
129
+ - !ruby/object:Gem::Dependency
130
+ name: minitest-proveit
131
+ requirement: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - "~>"
134
+ - !ruby/object:Gem::Version
135
+ version: '1.0'
136
+ type: :development
137
+ prerelease: false
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - "~>"
141
+ - !ruby/object:Gem::Version
142
+ version: '1.0'
109
143
  description: Bandwidth's set of APIs
110
144
  email: support@apimatic.io
111
145
  executables: []
@@ -121,6 +155,7 @@ files:
121
155
  - lib/bandwidth/exceptions/api_exception.rb
122
156
  - lib/bandwidth/http/api_response.rb
123
157
  - lib/bandwidth/http/auth/messaging_basic_auth.rb
158
+ - lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb
124
159
  - lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
125
160
  - lib/bandwidth/http/auth/voice_basic_auth.rb
126
161
  - lib/bandwidth/http/auth/web_rtc_basic_auth.rb
@@ -137,16 +172,31 @@ files:
137
172
  - lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb
138
173
  - lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb
139
174
  - lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb
175
+ - lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb
176
+ - lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb
140
177
  - lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb
141
178
  - lib/bandwidth/messaging_lib/messaging/models/media.rb
142
179
  - lib/bandwidth/messaging_lib/messaging/models/message_request.rb
180
+ - lib/bandwidth/messaging_lib/messaging/models/page_info.rb
181
+ - lib/bandwidth/messaging_lib/messaging/models/priority_enum.rb
143
182
  - lib/bandwidth/messaging_lib/messaging/models/tag.rb
144
183
  - lib/bandwidth/models/base_model.rb
184
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup.rb
185
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/client.rb
186
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb
187
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb
188
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb
189
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb
190
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb
191
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb
192
+ - lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb
145
193
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth.rb
146
194
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/client.rb
147
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/api_controller.rb
148
195
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/base_controller.rb
149
- - lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/invalid_request_exception.rb
196
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/mfa_controller.rb
197
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/error_with_request_exception.rb
198
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/forbidden_request_exception.rb
199
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/unauthorized_request_exception.rb
150
200
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb
151
201
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_messaging_response.rb
152
202
  - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_code_response.rb
@@ -188,8 +238,8 @@ files:
188
238
  - lib/bandwidth/voice_lib/voice/models/api_call_state_response.rb
189
239
  - lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb
190
240
  - lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb
241
+ - lib/bandwidth/voice_lib/voice/models/api_modify_conference_request.rb
191
242
  - lib/bandwidth/voice_lib/voice/models/api_transcribe_recording_request.rb
192
- - lib/bandwidth/voice_lib/voice/models/call_engine_modify_conference_request.rb
193
243
  - lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb
194
244
  - lib/bandwidth/voice_lib/voice/models/conference_detail.rb
195
245
  - lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb
@@ -219,11 +269,16 @@ files:
219
269
  - lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb
220
270
  - lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb
221
271
  - lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb
272
+ - lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb
222
273
  - lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb
223
274
  - lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb
224
275
  - lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb
225
276
  - lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb
226
277
  - lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb
278
+ - test/controllers/controller_test_base.rb
279
+ - test/http_response_catcher.rb
280
+ - test/integration/test_integration.rb
281
+ - test/test_helper.rb
227
282
  homepage: https://apimatic.io
228
283
  licenses:
229
284
  - MIT
@@ -234,7 +289,7 @@ require_paths:
234
289
  - lib
235
290
  required_ruby_version: !ruby/object:Gem::Requirement
236
291
  requirements:
237
- - - "~>"
292
+ - - ">="
238
293
  - !ruby/object:Gem::Version
239
294
  version: '2.0'
240
295
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -243,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
298
  - !ruby/object:Gem::Version
244
299
  version: '0'
245
300
  requirements: []
246
- rubygems_version: 3.2.3
301
+ rubygems_version: 3.2.22
247
302
  signing_key:
248
303
  specification_version: 4
249
304
  summary: bandwidth