bandwidth-sdk 12.1.0 → 13.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -2
  3. data/Gemfile.lock +11 -20
  4. data/README.md +2 -0
  5. data/bandwidth-sdk.gemspec +3 -1
  6. data/bandwidth.yml +28 -22
  7. data/coverage/.last_run.json +1 -1
  8. data/coverage/.resultset.json +489 -756
  9. data/coverage/index.html +5225 -8162
  10. data/custom_templates/Gemfile.mustache +1 -2
  11. data/custom_templates/gemspec.mustache +2 -0
  12. data/docs/AnswerCallback.md +1 -1
  13. data/docs/BridgeCompleteCallback.md +1 -1
  14. data/docs/BridgeTargetCompleteCallback.md +1 -1
  15. data/docs/CallRecordingMetadata.md +2 -2
  16. data/docs/CallState.md +1 -1
  17. data/docs/CallTranscription.md +6 -6
  18. data/docs/CallTranscriptionDetectedLanguageEnum.md +15 -0
  19. data/docs/CallTranscriptionResponse.md +2 -2
  20. data/docs/CallTranscriptionTrackEnum.md +15 -0
  21. data/docs/ConferenceRecordingAvailableCallback.md +1 -1
  22. data/docs/ConferenceRecordingMetadata.md +1 -1
  23. data/docs/DisconnectCallback.md +1 -1
  24. data/docs/DtmfCallback.md +2 -2
  25. data/docs/GatherCallback.md +2 -2
  26. data/docs/InitiateCallback.md +1 -1
  27. data/docs/MachineDetectionCompleteCallback.md +1 -1
  28. data/docs/MessagingCodeResponse.md +1 -1
  29. data/docs/RecordingAvailableCallback.md +2 -2
  30. data/docs/RecordingCompleteCallback.md +2 -2
  31. data/docs/RecordingTranscriptionMetadata.md +1 -1
  32. data/docs/RedirectCallback.md +2 -2
  33. data/docs/TranscriptionAvailableCallback.md +2 -2
  34. data/docs/TranscriptionsApi.md +1 -1
  35. data/docs/TransferAnswerCallback.md +2 -2
  36. data/docs/TransferCompleteCallback.md +2 -2
  37. data/docs/TransferDisconnectCallback.md +2 -2
  38. data/lib/bandwidth-sdk/api/calls_api.rb +1 -1
  39. data/lib/bandwidth-sdk/api/conferences_api.rb +1 -1
  40. data/lib/bandwidth-sdk/api/media_api.rb +1 -1
  41. data/lib/bandwidth-sdk/api/messages_api.rb +1 -1
  42. data/lib/bandwidth-sdk/api/mfa_api.rb +1 -1
  43. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +1 -1
  44. data/lib/bandwidth-sdk/api/recordings_api.rb +1 -1
  45. data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
  46. data/lib/bandwidth-sdk/api/transcriptions_api.rb +3 -3
  47. data/lib/bandwidth-sdk/api_client.rb +44 -41
  48. data/lib/bandwidth-sdk/api_error.rb +1 -1
  49. data/lib/bandwidth-sdk/configuration.rb +11 -1
  50. data/lib/bandwidth-sdk/models/account_statistics.rb +2 -2
  51. data/lib/bandwidth-sdk/models/answer_callback.rb +2 -2
  52. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +2 -2
  53. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +2 -2
  54. data/lib/bandwidth-sdk/models/bxml/root.rb +0 -6
  55. data/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +0 -6
  56. data/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +0 -6
  57. data/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +0 -6
  58. data/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +0 -6
  59. data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
  60. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +2 -2
  61. data/lib/bandwidth-sdk/models/call_state.rb +2 -2
  62. data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
  63. data/lib/bandwidth-sdk/models/call_transcription.rb +11 -37
  64. data/lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb +41 -0
  65. data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +2 -2
  66. data/lib/bandwidth-sdk/models/call_transcription_response.rb +2 -2
  67. data/lib/bandwidth-sdk/models/call_transcription_track_enum.rb +40 -0
  68. data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
  69. data/lib/bandwidth-sdk/models/code_request.rb +2 -2
  70. data/lib/bandwidth-sdk/models/conference.rb +2 -2
  71. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +2 -2
  72. data/lib/bandwidth-sdk/models/conference_created_callback.rb +2 -2
  73. data/lib/bandwidth-sdk/models/conference_member.rb +2 -2
  74. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +2 -2
  75. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +2 -2
  76. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +2 -2
  77. data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +2 -2
  78. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +2 -2
  79. data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
  80. data/lib/bandwidth-sdk/models/create_call.rb +2 -2
  81. data/lib/bandwidth-sdk/models/create_call_response.rb +2 -2
  82. data/lib/bandwidth-sdk/models/create_lookup_response.rb +2 -2
  83. data/lib/bandwidth-sdk/models/create_message_request_error.rb +2 -2
  84. data/lib/bandwidth-sdk/models/deferred_result.rb +2 -2
  85. data/lib/bandwidth-sdk/models/disconnect_callback.rb +2 -2
  86. data/lib/bandwidth-sdk/models/diversion.rb +2 -2
  87. data/lib/bandwidth-sdk/models/dtmf_callback.rb +2 -2
  88. data/lib/bandwidth-sdk/models/field_error.rb +2 -2
  89. data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
  90. data/lib/bandwidth-sdk/models/gather_callback.rb +2 -2
  91. data/lib/bandwidth-sdk/models/inbound_message_callback.rb +2 -2
  92. data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +2 -2
  93. data/lib/bandwidth-sdk/models/initiate_callback.rb +2 -2
  94. data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
  95. data/lib/bandwidth-sdk/models/list_message_item.rb +2 -2
  96. data/lib/bandwidth-sdk/models/lookup_request.rb +2 -2
  97. data/lib/bandwidth-sdk/models/lookup_result.rb +2 -2
  98. data/lib/bandwidth-sdk/models/lookup_status.rb +2 -2
  99. data/lib/bandwidth-sdk/models/lookup_status_enum.rb +1 -1
  100. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +2 -2
  101. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +2 -2
  102. data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
  103. data/lib/bandwidth-sdk/models/machine_detection_result.rb +2 -2
  104. data/lib/bandwidth-sdk/models/media.rb +2 -2
  105. data/lib/bandwidth-sdk/models/message.rb +2 -2
  106. data/lib/bandwidth-sdk/models/message_delivered_callback.rb +2 -2
  107. data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +2 -2
  108. data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
  109. data/lib/bandwidth-sdk/models/message_failed_callback.rb +2 -2
  110. data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +2 -2
  111. data/lib/bandwidth-sdk/models/message_request.rb +2 -2
  112. data/lib/bandwidth-sdk/models/message_sending_callback.rb +2 -2
  113. data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +2 -2
  114. data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
  115. data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
  116. data/lib/bandwidth-sdk/models/messages_list.rb +2 -2
  117. data/lib/bandwidth-sdk/models/messaging_code_response.rb +2 -2
  118. data/lib/bandwidth-sdk/models/messaging_request_error.rb +2 -2
  119. data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +2 -2
  120. data/lib/bandwidth-sdk/models/mfa_request_error.rb +2 -2
  121. data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +2 -2
  122. data/lib/bandwidth-sdk/models/page_info.rb +2 -2
  123. data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
  124. data/lib/bandwidth-sdk/models/recording_available_callback.rb +2 -2
  125. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +2 -2
  126. data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
  127. data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +3 -3
  128. data/lib/bandwidth-sdk/models/recording_transcriptions.rb +2 -2
  129. data/lib/bandwidth-sdk/models/redirect_callback.rb +2 -2
  130. data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
  131. data/lib/bandwidth-sdk/models/stir_shaken.rb +2 -2
  132. data/lib/bandwidth-sdk/models/tag.rb +2 -2
  133. data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +2 -2
  134. data/lib/bandwidth-sdk/models/transcribe_recording.rb +2 -2
  135. data/lib/bandwidth-sdk/models/transcription.rb +2 -2
  136. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +2 -2
  137. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +2 -2
  138. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +2 -2
  139. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +2 -2
  140. data/lib/bandwidth-sdk/models/update_call.rb +2 -2
  141. data/lib/bandwidth-sdk/models/update_call_recording.rb +2 -2
  142. data/lib/bandwidth-sdk/models/update_conference.rb +2 -2
  143. data/lib/bandwidth-sdk/models/update_conference_member.rb +2 -2
  144. data/lib/bandwidth-sdk/models/verify_code_request.rb +2 -2
  145. data/lib/bandwidth-sdk/models/verify_code_response.rb +2 -2
  146. data/lib/bandwidth-sdk/models/voice_api_error.rb +2 -2
  147. data/lib/bandwidth-sdk/models/voice_code_response.rb +2 -2
  148. data/lib/bandwidth-sdk/version.rb +2 -2
  149. data/lib/bandwidth-sdk.rb +3 -1
  150. data/openapitools.json +1 -1
  151. data/spec/call_utils.rb +1 -1
  152. data/spec/smoke/calls_api_spec.rb +1 -6
  153. data/spec/smoke/conferences_api_spec.rb +0 -5
  154. data/spec/smoke/media_api_spec.rb +0 -5
  155. data/spec/smoke/messages_api_spec.rb +0 -5
  156. data/spec/smoke/mfa_api_spec.rb +0 -5
  157. data/spec/smoke/phone_number_lookup_api_spec.rb +0 -5
  158. data/spec/smoke/recordings_api_spec.rb +0 -5
  159. data/spec/smoke/statistics_api_spec.rb +0 -5
  160. data/spec/smoke/transcriptions_api_spec.rb +0 -5
  161. data/spec/spec_helper.rb +11 -4
  162. data/spec/unit/api/calls_api_spec.rb +98 -128
  163. data/spec/unit/api/conferences_api_spec.rb +63 -126
  164. data/spec/unit/api/media_api_spec.rb +17 -32
  165. data/spec/unit/api/messages_api_spec.rb +46 -136
  166. data/spec/unit/api/mfa_api_spec.rb +8 -24
  167. data/spec/unit/api/phone_number_lookup_api_spec.rb +23 -37
  168. data/spec/unit/api/recordings_api_spec.rb +83 -110
  169. data/spec/unit/api/statistics_api_spec.rb +7 -15
  170. data/spec/unit/api/transcriptions_api_spec.rb +18 -37
  171. data/spec/unit/client/api_client_spec.rb +4 -4
  172. metadata +62 -44
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -17,6 +17,8 @@ require 'tempfile'
17
17
  require 'time'
18
18
  require 'faraday'
19
19
  require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
20
+ require 'marcel'
21
+
20
22
 
21
23
  module Bandwidth
22
24
  class ApiClient
@@ -48,9 +50,11 @@ module Bandwidth
48
50
  # @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
49
51
  # the data deserialized from response body (could be nil), response status code and response headers.
50
52
  def call_api(http_method, path, opts = {})
53
+ stream = nil
51
54
  begin
52
55
  response = connection(opts).public_send(http_method.to_sym.downcase) do |req|
53
- build_request(http_method, path, req, opts)
56
+ request = build_request(http_method, path, req, opts)
57
+ stream = download_file(request) if opts[:return_type] == 'File' || opts[:return_type] == 'Binary'
54
58
  end
55
59
 
56
60
  if config.debugging
@@ -75,7 +79,9 @@ module Bandwidth
75
79
  fail ApiError.new('Connection failed')
76
80
  end
77
81
 
78
- if opts[:return_type]
82
+ if opts[:return_type] == 'File' || opts[:return_type] == 'Binary'
83
+ data = deserialize_file(response, stream)
84
+ elsif opts[:return_type]
79
85
  data = deserialize(response, opts[:return_type])
80
86
  else
81
87
  data = nil
@@ -117,7 +123,6 @@ module Bandwidth
117
123
 
118
124
  request.url url
119
125
  request.params = query_params
120
- download_file(request) if opts[:return_type] == 'File' || opts[:return_type] == 'Binary'
121
126
  request
122
127
  end
123
128
 
@@ -136,8 +141,7 @@ module Bandwidth
136
141
  form_params.each do |key, value|
137
142
  case value
138
143
  when ::File, ::Tempfile
139
- # TODO hardcode to application/octet-stream, need better way to detect content type
140
- data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path)
144
+ data[key] = Faraday::FilePart.new(value.path, Marcel::MimeType.for(Pathname.new(value.path)))
141
145
  when ::Array, nil
142
146
  # let Faraday handle Array and nil parameters
143
147
  data[key] = value
@@ -154,11 +158,40 @@ module Bandwidth
154
158
  end
155
159
 
156
160
  def download_file(request)
157
- @stream = []
161
+ stream = []
158
162
 
159
163
  # handle streaming Responses
160
164
  request.options.on_data = Proc.new do |chunk, overall_received_bytes|
161
- @stream << chunk
165
+ stream << chunk
166
+ end
167
+ stream
168
+ end
169
+
170
+ def deserialize_file(response, stream)
171
+ body = response.body
172
+ if @config.return_binary_data == true
173
+ # return byte stream
174
+ encoding = body.encoding
175
+ stream.join.force_encoding(encoding)
176
+ else
177
+ # return file instead of binary data
178
+ content_disposition = response.headers['Content-Disposition']
179
+ if content_disposition && content_disposition =~ /filename=/i
180
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
181
+ prefix = sanitize_filename(filename)
182
+ else
183
+ prefix = 'download-'
184
+ end
185
+ prefix = prefix + '-' unless prefix.end_with?('-')
186
+ encoding = body.encoding
187
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
188
+ tempfile.write(stream.join.force_encoding(encoding))
189
+ tempfile.close
190
+ config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
191
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
192
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
193
+ "explicitly with `tempfile.delete`"
194
+ tempfile
162
195
  end
163
196
  end
164
197
 
@@ -216,7 +249,7 @@ module Bandwidth
216
249
  # @param [String] mime MIME
217
250
  # @return [Boolean] True if the MIME is application/json
218
251
  def json_mime?(mime)
219
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
252
+ (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
220
253
  end
221
254
 
222
255
  # Deserialize the response to the given return type.
@@ -225,40 +258,10 @@ module Bandwidth
225
258
  # @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
226
259
  def deserialize(response, return_type)
227
260
  body = response.body
228
-
229
- # handle file downloading - return the File instance processed in request callbacks
230
- # note that response body is empty when the file is written in chunks in request on_body callback
231
- if return_type == 'File'
232
- if @config.return_binary_data == true
233
- # return byte stream
234
- encoding = body.encoding
235
- return @stream.join.force_encoding(encoding)
236
- else
237
- # return file instead of binary data
238
- content_disposition = response.headers['Content-Disposition']
239
- if content_disposition && content_disposition =~ /filename=/i
240
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
241
- prefix = sanitize_filename(filename)
242
- else
243
- prefix = 'download-'
244
- end
245
- prefix = prefix + '-' unless prefix.end_with?('-')
246
- encoding = body.encoding
247
- @tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
248
- @tempfile.write(@stream.join.force_encoding(encoding))
249
- @tempfile.close
250
- @config.logger.info "Temp file written to #{@tempfile.path}, please copy the file to a proper folder "\
251
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
252
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
253
- "explicitly with `tempfile.delete`"
254
- return @tempfile
255
- end
256
- end
257
-
258
261
  return nil if body.nil? || body.empty?
259
262
 
260
263
  # return response body directly for String return type
261
- return body if return_type == 'String'
264
+ return body.to_s if return_type == 'String'
262
265
 
263
266
  # ensuring a default content type
264
267
  content_type = response.headers['Content-Type'] || 'application/json'
@@ -325,7 +328,7 @@ module Bandwidth
325
328
  # @param [String] filename the filename to be sanitized
326
329
  # @return [String] the sanitized filename
327
330
  def sanitize_filename(filename)
328
- filename.gsub(/.*[\/\\]/, '')
331
+ filename.split(/[\/\\]/).last
329
332
  end
330
333
 
331
334
  def build_request_url(path, opts = {})
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -79,6 +79,14 @@ module Bandwidth
79
79
  # @return [true, false]
80
80
  attr_accessor :debugging
81
81
 
82
+ # Set this to ignore operation servers for the API client. This is useful when you need to
83
+ # send requests to a different server than the one specified in the OpenAPI document.
84
+ # Will default to the base url defined in the spec but can be overridden by setting
85
+ # `scheme`, `host`, `base_path` directly.
86
+ # Default to false.
87
+ # @return [true, false]
88
+ attr_accessor :ignore_operation_servers
89
+
82
90
  # Defines the logger used for debugging.
83
91
  # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
84
92
  #
@@ -170,6 +178,7 @@ module Bandwidth
170
178
  @return_binary_data = false
171
179
  @params_encoder = nil
172
180
  @debugging = false
181
+ @ignore_operation_servers = false
173
182
  @inject_format = false
174
183
  @force_ending_format = false
175
184
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
@@ -204,6 +213,7 @@ module Bandwidth
204
213
 
205
214
  # Returns base URL for specified operation based on server settings
206
215
  def base_url(operation = nil)
216
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
207
217
  if operation_server_settings.key?(operation) then
208
218
  index = server_operation_index.fetch(operation, server_index)
209
219
  server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -170,7 +170,7 @@ module Bandwidth
170
170
  else # model
171
171
  # models (e.g. Pet) or oneOf
172
172
  klass = Bandwidth.const_get(type)
173
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
174
174
  end
175
175
  end
176
176
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -315,7 +315,7 @@ module Bandwidth
315
315
  else # model
316
316
  # models (e.g. Pet) or oneOf
317
317
  klass = Bandwidth.const_get(type)
318
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
318
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
319
319
  end
320
320
  end
321
321
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -337,7 +337,7 @@ module Bandwidth
337
337
  else # model
338
338
  # models (e.g. Pet) or oneOf
339
339
  klass = Bandwidth.const_get(type)
340
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
340
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
341
341
  end
342
342
  end
343
343
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -305,7 +305,7 @@ module Bandwidth
305
305
  else # model
306
306
  # models (e.g. Pet) or oneOf
307
307
  klass = Bandwidth.const_get(type)
308
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
308
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
309
309
  end
310
310
  end
311
311
 
@@ -36,12 +36,6 @@ module Bandwidth
36
36
  @nested_verbs.push(*nested_verbs)
37
37
  end
38
38
 
39
- extend Gem::Deprecate
40
- def add_verb(nested_verbs)
41
- add_verbs(nested_verbs)
42
- end
43
- deprecate(:add_verb, 'add_verbs', 2024, 7)
44
-
45
39
  # Return BXML representaion of this response
46
40
  # @return [String] The XML response in string format.
47
41
  def to_bxml
@@ -37,12 +37,6 @@ module Bandwidth
37
37
  def add_audio_verbs(audio_verbs)
38
38
  @nested_verbs.push(*audio_verbs)
39
39
  end
40
-
41
- extend Gem::Deprecate
42
- def add_audio_verb(audio_verbs)
43
- add_audio_verbs(audio_verbs)
44
- end
45
- deprecate(:add_audio_verb, 'add_audio_verbs', 2024, 7)
46
40
  end
47
41
  end
48
42
  end
@@ -23,12 +23,6 @@ module Bandwidth
23
23
  def add_stream_params(stream_params)
24
24
  @nested_verbs.push(*stream_params)
25
25
  end
26
-
27
- extend Gem::Deprecate
28
- def add_stream_param(stream_params)
29
- add_stream_params(stream_params)
30
- end
31
- deprecate(:add_stream_param, 'add_stream_params', 2024, 7)
32
26
  end
33
27
  end
34
28
  end
@@ -24,12 +24,6 @@ module Bandwidth
24
24
  def add_custom_params(custom_params)
25
25
  @nested_verbs.push(*custom_params)
26
26
  end
27
-
28
- extend Gem::Deprecate
29
- def add_custom_param(custom_params)
30
- add_custom_params(custom_params)
31
- end
32
- deprecate(:add_custom_param, 'add_custom_params', 2024, 7)
33
27
  end
34
28
  end
35
29
  end
@@ -30,12 +30,6 @@ module Bandwidth
30
30
  def add_transfer_recipients(recipients)
31
31
  @nested_verbs.push(*recipients)
32
32
  end
33
-
34
- extend Gem::Deprecate
35
- def add_transfer_recipient(recipients)
36
- add_transfer_recipients(recipients)
37
- end
38
- deprecate(:add_transfer_recipient, 'add_transfer_recipients', 2024, 7)
39
33
  end
40
34
  end
41
35
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -351,7 +351,7 @@ module Bandwidth
351
351
  else # model
352
352
  # models (e.g. Pet) or oneOf
353
353
  klass = Bandwidth.const_get(type)
354
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
354
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
355
355
  end
356
356
  end
357
357
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -363,7 +363,7 @@ module Bandwidth
363
363
  else # model
364
364
  # models (e.g. Pet) or oneOf
365
365
  klass = Bandwidth.const_get(type)
366
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
366
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
367
367
  end
368
368
  end
369
369
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -15,14 +15,12 @@ require 'time'
15
15
 
16
16
  module Bandwidth
17
17
  class CallTranscription
18
- # The detected language for this transcription.
19
18
  attr_accessor :detected_language
20
19
 
21
- # Which `track` this transcription is derived from.
22
20
  attr_accessor :track
23
21
 
24
22
  # The transcription itself.
25
- attr_accessor :text
23
+ attr_accessor :transcript
26
24
 
27
25
  # How confident the transcription engine was in transcribing the associated audio (from `0` to `1`).
28
26
  attr_accessor :confidence
@@ -54,7 +52,7 @@ module Bandwidth
54
52
  {
55
53
  :'detected_language' => :'detectedLanguage',
56
54
  :'track' => :'track',
57
- :'text' => :'text',
55
+ :'transcript' => :'transcript',
58
56
  :'confidence' => :'confidence'
59
57
  }
60
58
  end
@@ -67,9 +65,9 @@ module Bandwidth
67
65
  # Attribute type mapping.
68
66
  def self.openapi_types
69
67
  {
70
- :'detected_language' => :'String',
71
- :'track' => :'String',
72
- :'text' => :'String',
68
+ :'detected_language' => :'CallTranscriptionDetectedLanguageEnum',
69
+ :'track' => :'CallTranscriptionTrackEnum',
70
+ :'transcript' => :'String',
73
71
  :'confidence' => :'Float'
74
72
  }
75
73
  end
@@ -103,8 +101,8 @@ module Bandwidth
103
101
  self.track = attributes[:'track']
104
102
  end
105
103
 
106
- if attributes.key?(:'text')
107
- self.text = attributes[:'text']
104
+ if attributes.key?(:'transcript')
105
+ self.transcript = attributes[:'transcript']
108
106
  end
109
107
 
110
108
  if attributes.key?(:'confidence')
@@ -132,35 +130,11 @@ module Bandwidth
132
130
  # @return true if the model is valid
133
131
  def valid?
134
132
  warn '[DEPRECATED] the `valid?` method is obsolete'
135
- detected_language_validator = EnumAttributeValidator.new('String', ['en-US', 'es-US', 'fr-FR'])
136
- return false unless detected_language_validator.valid?(@detected_language)
137
- track_validator = EnumAttributeValidator.new('String', ['inbound', 'outbound'])
138
- return false unless track_validator.valid?(@track)
139
133
  return false if !@confidence.nil? && @confidence > 1
140
134
  return false if !@confidence.nil? && @confidence < 0
141
135
  true
142
136
  end
143
137
 
144
- # Custom attribute writer method checking allowed values (enum).
145
- # @param [Object] detected_language Object to be assigned
146
- def detected_language=(detected_language)
147
- validator = EnumAttributeValidator.new('String', ['en-US', 'es-US', 'fr-FR'])
148
- unless validator.valid?(detected_language)
149
- fail ArgumentError, "invalid value for \"detected_language\", must be one of #{validator.allowable_values}."
150
- end
151
- @detected_language = detected_language
152
- end
153
-
154
- # Custom attribute writer method checking allowed values (enum).
155
- # @param [Object] track Object to be assigned
156
- def track=(track)
157
- validator = EnumAttributeValidator.new('String', ['inbound', 'outbound'])
158
- unless validator.valid?(track)
159
- fail ArgumentError, "invalid value for \"track\", must be one of #{validator.allowable_values}."
160
- end
161
- @track = track
162
- end
163
-
164
138
  # Custom attribute writer method with validation
165
139
  # @param [Object] confidence Value to be assigned
166
140
  def confidence=(confidence)
@@ -186,7 +160,7 @@ module Bandwidth
186
160
  self.class == o.class &&
187
161
  detected_language == o.detected_language &&
188
162
  track == o.track &&
189
- text == o.text &&
163
+ transcript == o.transcript &&
190
164
  confidence == o.confidence
191
165
  end
192
166
 
@@ -199,7 +173,7 @@ module Bandwidth
199
173
  # Calculates hash code according to all attributes.
200
174
  # @return [Integer] Hash code
201
175
  def hash
202
- [detected_language, track, text, confidence].hash
176
+ [detected_language, track, transcript, confidence].hash
203
177
  end
204
178
 
205
179
  # Builds the object from hash
@@ -264,7 +238,7 @@ module Bandwidth
264
238
  else # model
265
239
  # models (e.g. Pet) or oneOf
266
240
  klass = Bandwidth.const_get(type)
267
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
241
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
268
242
  end
269
243
  end
270
244
 
@@ -0,0 +1,41 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.7.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class CallTranscriptionDetectedLanguageEnum
18
+ EN_US = 'en-US'.freeze
19
+ ES_US = 'es-US'.freeze
20
+ FR_FR = 'fr-FR'.freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [EN_US, ES_US, FR_FR].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if CallTranscriptionDetectedLanguageEnum.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #CallTranscriptionDetectedLanguageEnum"
39
+ end
40
+ end
41
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -170,7 +170,7 @@ module Bandwidth
170
170
  else # model
171
171
  # models (e.g. Pet) or oneOf
172
172
  klass = Bandwidth.const_get(type)
173
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
174
174
  end
175
175
  end
176
176
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -191,7 +191,7 @@ module Bandwidth
191
191
  else # model
192
192
  # models (e.g. Pet) or oneOf
193
193
  klass = Bandwidth.const_get(type)
194
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
194
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
195
195
  end
196
196
  end
197
197
 
@@ -0,0 +1,40 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.7.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class CallTranscriptionTrackEnum
18
+ INBOUND = 'inbound'.freeze
19
+ OUTBOUND = 'outbound'.freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [INBOUND, OUTBOUND].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ return value if CallTranscriptionTrackEnum.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #CallTranscriptionTrackEnum"
38
+ end
39
+ end
40
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12