bandwidth-sdk 11.0.0.pre.beta.2.0 → 11.0.0.pre.beta.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/bandwidth-sdk.gemspec +1 -1
- data/bandwidth.yml +26 -0
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +264 -295
- data/coverage/index.html +2839 -3180
- data/docs/CreateCall.md +2 -0
- data/lib/bandwidth-sdk/api/calls_api.rb +1 -1
- data/lib/bandwidth-sdk/api/conferences_api.rb +1 -1
- data/lib/bandwidth-sdk/api/media_api.rb +1 -1
- data/lib/bandwidth-sdk/api/messages_api.rb +1 -1
- data/lib/bandwidth-sdk/api/mfa_api.rb +1 -1
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +1 -1
- data/lib/bandwidth-sdk/api/recordings_api.rb +1 -1
- data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
- data/lib/bandwidth-sdk/api_client.rb +1 -1
- data/lib/bandwidth-sdk/api_error.rb +1 -1
- data/lib/bandwidth-sdk/configuration.rb +10 -8
- data/lib/bandwidth-sdk/models/account_statistics.rb +13 -18
- data/lib/bandwidth-sdk/models/answer_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +13 -18
- data/lib/bandwidth-sdk/models/call_state.rb +13 -18
- data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/code_request.rb +28 -19
- data/lib/bandwidth-sdk/models/conference.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_member.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/create_call.rb +48 -19
- data/lib/bandwidth-sdk/models/create_call_response.rb +27 -18
- data/lib/bandwidth-sdk/models/create_lookup_response.rb +13 -18
- data/lib/bandwidth-sdk/models/create_message_request_error.rb +17 -18
- data/lib/bandwidth-sdk/models/deferred_result.rb +13 -18
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/diversion.rb +13 -18
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/field_error.rb +13 -18
- data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/gather_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/inbound_message_callback.rb +23 -18
- data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +31 -18
- data/lib/bandwidth-sdk/models/initiate_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/list_message_item.rb +13 -18
- data/lib/bandwidth-sdk/models/lookup_request.rb +15 -18
- data/lib/bandwidth-sdk/models/lookup_result.rb +13 -18
- data/lib/bandwidth-sdk/models/lookup_status.rb +13 -18
- data/lib/bandwidth-sdk/models/lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +13 -18
- data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_result.rb +13 -18
- data/lib/bandwidth-sdk/models/media.rb +13 -18
- data/lib/bandwidth-sdk/models/message.rb +21 -18
- data/lib/bandwidth-sdk/models/message_delivered_callback.rb +23 -18
- data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +33 -18
- data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_failed_callback.rb +25 -18
- data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +35 -18
- data/lib/bandwidth-sdk/models/message_request.rb +24 -19
- data/lib/bandwidth-sdk/models/message_sending_callback.rb +23 -18
- data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +35 -18
- data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/messages_list.rb +13 -18
- data/lib/bandwidth-sdk/models/messaging_code_response.rb +13 -18
- data/lib/bandwidth-sdk/models/messaging_request_error.rb +17 -18
- data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/mfa_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/page_info.rb +13 -18
- data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/redirect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/stir_shaken.rb +13 -18
- data/lib/bandwidth-sdk/models/tag.rb +13 -18
- data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/transcribe_recording.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription_list.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription_metadata.rb +13 -18
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/update_call.rb +13 -18
- data/lib/bandwidth-sdk/models/update_call_recording.rb +15 -18
- data/lib/bandwidth-sdk/models/update_conference.rb +13 -18
- data/lib/bandwidth-sdk/models/update_conference_member.rb +13 -18
- data/lib/bandwidth-sdk/models/verify_code_request.rb +19 -18
- data/lib/bandwidth-sdk/models/verify_code_response.rb +13 -18
- data/lib/bandwidth-sdk/models/voice_api_error.rb +13 -18
- data/lib/bandwidth-sdk/models/voice_code_response.rb +13 -18
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +1 -1
- data/openapitools.json +1 -1
- data/spec/api/calls_api_spec.rb +2 -0
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +19 -7
- data/spec/integration/calls_api_integration_spec.rb +2 -0
- data/spec/models/call_state_spec.rb +0 -13
- data/spec/models/deferred_result_spec.rb +1 -14
- data/spec/models/message_spec.rb +10 -17
- data/spec/models/verify_code_request_spec.rb +7 -15
- metadata +36 -36
data/docs/CreateCall.md
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **to** | **String** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | |
|
8
8
|
| **from** | **String** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). | |
|
9
|
+
| **display_name** | **String** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. | [optional] |
|
9
10
|
| **uui** | **String** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] |
|
10
11
|
| **application_id** | **String** | The id of the application associated with the `from` number. | |
|
11
12
|
| **answer_url** | **String** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | |
|
@@ -32,6 +33,7 @@ require 'bandwidth-sdk'
|
|
32
33
|
instance = Bandwidth::CreateCall.new(
|
33
34
|
to: +19195551234,
|
34
35
|
from: +19195554321,
|
36
|
+
display_name: John Doe,
|
35
37
|
uui: eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64,
|
36
38
|
application_id: 1234-qwer-5679-tyui,
|
37
39
|
answer_url: https://www.myCallbackServer.example/webhooks/answer,
|
@@ -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:
|
9
|
+
OpenAPI Generator version: 7.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -151,7 +151,7 @@ module Bandwidth
|
|
151
151
|
@scheme = 'http'
|
152
152
|
@host = 'localhost'
|
153
153
|
@base_path = ''
|
154
|
-
@server_index =
|
154
|
+
@server_index = nil
|
155
155
|
@server_operation_index = {}
|
156
156
|
@server_variables = {}
|
157
157
|
@server_operation_variables = {}
|
@@ -204,10 +204,12 @@ module Bandwidth
|
|
204
204
|
|
205
205
|
# Returns base URL for specified operation based on server settings
|
206
206
|
def base_url(operation = nil)
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
207
|
+
if operation_server_settings.key?(operation) then
|
208
|
+
index = server_operation_index.fetch(operation, server_index)
|
209
|
+
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
210
|
+
else
|
211
|
+
server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
|
212
|
+
end
|
211
213
|
end
|
212
214
|
|
213
215
|
# Gets API key (with prefix if set).
|
@@ -479,8 +481,8 @@ module Bandwidth
|
|
479
481
|
servers = server_settings if servers == nil
|
480
482
|
|
481
483
|
# check array index out of bound
|
482
|
-
if (index < 0 || index >= servers.size)
|
483
|
-
fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
|
484
|
+
if (index.nil? || index < 0 || index >= servers.size)
|
485
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
484
486
|
end
|
485
487
|
|
486
488
|
server = servers[index]
|
@@ -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:
|
9
|
+
OpenAPI Generator version: 7.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -75,6 +75,7 @@ module Bandwidth
|
|
75
75
|
# Show invalid properties with the reasons. Usually used together with valid?
|
76
76
|
# @return Array for valid properties with the reasons
|
77
77
|
def list_invalid_properties
|
78
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
78
79
|
invalid_properties = Array.new
|
79
80
|
invalid_properties
|
80
81
|
end
|
@@ -82,6 +83,7 @@ module Bandwidth
|
|
82
83
|
# Check to see if the all the properties in the model are valid
|
83
84
|
# @return true if the model is valid
|
84
85
|
def valid?
|
86
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
85
87
|
true
|
86
88
|
end
|
87
89
|
|
@@ -110,37 +112,30 @@ module Bandwidth
|
|
110
112
|
# @param [Hash] attributes Model attributes in the form of hash
|
111
113
|
# @return [Object] Returns the model itself
|
112
114
|
def self.build_from_hash(attributes)
|
113
|
-
new.build_from_hash(attributes)
|
114
|
-
end
|
115
|
-
|
116
|
-
# Builds the object from hash
|
117
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
-
# @return [Object] Returns the model itself
|
119
|
-
def build_from_hash(attributes)
|
120
115
|
return nil unless attributes.is_a?(Hash)
|
121
116
|
attributes = attributes.transform_keys(&:to_sym)
|
122
|
-
|
123
|
-
|
124
|
-
|
117
|
+
transformed_hash = {}
|
118
|
+
openapi_types.each_pair do |key, type|
|
119
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
120
|
+
transformed_hash["#{key}"] = nil
|
125
121
|
elsif type =~ /\AArray<(.*)>/i
|
126
122
|
# check to ensure the input is an array given that the attribute
|
127
123
|
# is documented as an array but the input is not
|
128
|
-
if attributes[
|
129
|
-
|
124
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
125
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
130
126
|
end
|
131
|
-
elsif !attributes[
|
132
|
-
|
127
|
+
elsif !attributes[attribute_map[key]].nil?
|
128
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
133
129
|
end
|
134
130
|
end
|
135
|
-
|
136
|
-
self
|
131
|
+
new(transformed_hash)
|
137
132
|
end
|
138
133
|
|
139
134
|
# Deserializes the data based on type
|
140
135
|
# @param string type Data type
|
141
136
|
# @param string value Value to be deserialized
|
142
137
|
# @return [Object] Deserialized data
|
143
|
-
def _deserialize(type, value)
|
138
|
+
def self._deserialize(type, value)
|
144
139
|
case type.to_sym
|
145
140
|
when :Time
|
146
141
|
Time.parse(value)
|
@@ -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:
|
9
|
+
OpenAPI Generator version: 7.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -208,6 +208,7 @@ module Bandwidth
|
|
208
208
|
# Show invalid properties with the reasons. Usually used together with valid?
|
209
209
|
# @return Array for valid properties with the reasons
|
210
210
|
def list_invalid_properties
|
211
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
211
212
|
invalid_properties = Array.new
|
212
213
|
invalid_properties
|
213
214
|
end
|
@@ -215,6 +216,7 @@ module Bandwidth
|
|
215
216
|
# Check to see if the all the properties in the model are valid
|
216
217
|
# @return true if the model is valid
|
217
218
|
def valid?
|
219
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
218
220
|
true
|
219
221
|
end
|
220
222
|
|
@@ -255,37 +257,30 @@ module Bandwidth
|
|
255
257
|
# @param [Hash] attributes Model attributes in the form of hash
|
256
258
|
# @return [Object] Returns the model itself
|
257
259
|
def self.build_from_hash(attributes)
|
258
|
-
new.build_from_hash(attributes)
|
259
|
-
end
|
260
|
-
|
261
|
-
# Builds the object from hash
|
262
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
263
|
-
# @return [Object] Returns the model itself
|
264
|
-
def build_from_hash(attributes)
|
265
260
|
return nil unless attributes.is_a?(Hash)
|
266
261
|
attributes = attributes.transform_keys(&:to_sym)
|
267
|
-
|
268
|
-
|
269
|
-
|
262
|
+
transformed_hash = {}
|
263
|
+
openapi_types.each_pair do |key, type|
|
264
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
265
|
+
transformed_hash["#{key}"] = nil
|
270
266
|
elsif type =~ /\AArray<(.*)>/i
|
271
267
|
# check to ensure the input is an array given that the attribute
|
272
268
|
# is documented as an array but the input is not
|
273
|
-
if attributes[
|
274
|
-
|
269
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
270
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
275
271
|
end
|
276
|
-
elsif !attributes[
|
277
|
-
|
272
|
+
elsif !attributes[attribute_map[key]].nil?
|
273
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
278
274
|
end
|
279
275
|
end
|
280
|
-
|
281
|
-
self
|
276
|
+
new(transformed_hash)
|
282
277
|
end
|
283
278
|
|
284
279
|
# Deserializes the data based on type
|
285
280
|
# @param string type Data type
|
286
281
|
# @param string value Value to be deserialized
|
287
282
|
# @return [Object] Deserialized data
|
288
|
-
def _deserialize(type, value)
|
283
|
+
def self._deserialize(type, value)
|
289
284
|
case type.to_sym
|
290
285
|
when :Time
|
291
286
|
Time.parse(value)
|
@@ -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:
|
9
|
+
OpenAPI Generator version: 7.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -228,6 +228,7 @@ module Bandwidth
|
|
228
228
|
# Show invalid properties with the reasons. Usually used together with valid?
|
229
229
|
# @return Array for valid properties with the reasons
|
230
230
|
def list_invalid_properties
|
231
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
231
232
|
invalid_properties = Array.new
|
232
233
|
invalid_properties
|
233
234
|
end
|
@@ -235,6 +236,7 @@ module Bandwidth
|
|
235
236
|
# Check to see if the all the properties in the model are valid
|
236
237
|
# @return true if the model is valid
|
237
238
|
def valid?
|
239
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
238
240
|
true
|
239
241
|
end
|
240
242
|
|
@@ -277,37 +279,30 @@ module Bandwidth
|
|
277
279
|
# @param [Hash] attributes Model attributes in the form of hash
|
278
280
|
# @return [Object] Returns the model itself
|
279
281
|
def self.build_from_hash(attributes)
|
280
|
-
new.build_from_hash(attributes)
|
281
|
-
end
|
282
|
-
|
283
|
-
# Builds the object from hash
|
284
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
285
|
-
# @return [Object] Returns the model itself
|
286
|
-
def build_from_hash(attributes)
|
287
282
|
return nil unless attributes.is_a?(Hash)
|
288
283
|
attributes = attributes.transform_keys(&:to_sym)
|
289
|
-
|
290
|
-
|
291
|
-
|
284
|
+
transformed_hash = {}
|
285
|
+
openapi_types.each_pair do |key, type|
|
286
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
287
|
+
transformed_hash["#{key}"] = nil
|
292
288
|
elsif type =~ /\AArray<(.*)>/i
|
293
289
|
# check to ensure the input is an array given that the attribute
|
294
290
|
# is documented as an array but the input is not
|
295
|
-
if attributes[
|
296
|
-
|
291
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
292
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
297
293
|
end
|
298
|
-
elsif !attributes[
|
299
|
-
|
294
|
+
elsif !attributes[attribute_map[key]].nil?
|
295
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
300
296
|
end
|
301
297
|
end
|
302
|
-
|
303
|
-
self
|
298
|
+
new(transformed_hash)
|
304
299
|
end
|
305
300
|
|
306
301
|
# Deserializes the data based on type
|
307
302
|
# @param string type Data type
|
308
303
|
# @param string value Value to be deserialized
|
309
304
|
# @return [Object] Deserialized data
|
310
|
-
def _deserialize(type, value)
|
305
|
+
def self._deserialize(type, value)
|
311
306
|
case type.to_sym
|
312
307
|
when :Time
|
313
308
|
Time.parse(value)
|
@@ -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:
|
9
|
+
OpenAPI Generator version: 7.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -199,6 +199,7 @@ module Bandwidth
|
|
199
199
|
# Show invalid properties with the reasons. Usually used together with valid?
|
200
200
|
# @return Array for valid properties with the reasons
|
201
201
|
def list_invalid_properties
|
202
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
202
203
|
invalid_properties = Array.new
|
203
204
|
invalid_properties
|
204
205
|
end
|
@@ -206,6 +207,7 @@ module Bandwidth
|
|
206
207
|
# Check to see if the all the properties in the model are valid
|
207
208
|
# @return true if the model is valid
|
208
209
|
def valid?
|
210
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
209
211
|
true
|
210
212
|
end
|
211
213
|
|
@@ -245,37 +247,30 @@ module Bandwidth
|
|
245
247
|
# @param [Hash] attributes Model attributes in the form of hash
|
246
248
|
# @return [Object] Returns the model itself
|
247
249
|
def self.build_from_hash(attributes)
|
248
|
-
new.build_from_hash(attributes)
|
249
|
-
end
|
250
|
-
|
251
|
-
# Builds the object from hash
|
252
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
253
|
-
# @return [Object] Returns the model itself
|
254
|
-
def build_from_hash(attributes)
|
255
250
|
return nil unless attributes.is_a?(Hash)
|
256
251
|
attributes = attributes.transform_keys(&:to_sym)
|
257
|
-
|
258
|
-
|
259
|
-
|
252
|
+
transformed_hash = {}
|
253
|
+
openapi_types.each_pair do |key, type|
|
254
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
255
|
+
transformed_hash["#{key}"] = nil
|
260
256
|
elsif type =~ /\AArray<(.*)>/i
|
261
257
|
# check to ensure the input is an array given that the attribute
|
262
258
|
# is documented as an array but the input is not
|
263
|
-
if attributes[
|
264
|
-
|
259
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
260
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
265
261
|
end
|
266
|
-
elsif !attributes[
|
267
|
-
|
262
|
+
elsif !attributes[attribute_map[key]].nil?
|
263
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
268
264
|
end
|
269
265
|
end
|
270
|
-
|
271
|
-
self
|
266
|
+
new(transformed_hash)
|
272
267
|
end
|
273
268
|
|
274
269
|
# Deserializes the data based on type
|
275
270
|
# @param string type Data type
|
276
271
|
# @param string value Value to be deserialized
|
277
272
|
# @return [Object] Deserialized data
|
278
|
-
def _deserialize(type, value)
|
273
|
+
def self._deserialize(type, value)
|
279
274
|
case type.to_sym
|
280
275
|
when :Time
|
281
276
|
Time.parse(value)
|
@@ -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:
|
9
|
+
OpenAPI Generator version: 7.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -240,6 +240,7 @@ module Bandwidth
|
|
240
240
|
# Show invalid properties with the reasons. Usually used together with valid?
|
241
241
|
# @return Array for valid properties with the reasons
|
242
242
|
def list_invalid_properties
|
243
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
243
244
|
invalid_properties = Array.new
|
244
245
|
invalid_properties
|
245
246
|
end
|
@@ -247,6 +248,7 @@ module Bandwidth
|
|
247
248
|
# Check to see if the all the properties in the model are valid
|
248
249
|
# @return true if the model is valid
|
249
250
|
def valid?
|
251
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
250
252
|
true
|
251
253
|
end
|
252
254
|
|
@@ -291,37 +293,30 @@ module Bandwidth
|
|
291
293
|
# @param [Hash] attributes Model attributes in the form of hash
|
292
294
|
# @return [Object] Returns the model itself
|
293
295
|
def self.build_from_hash(attributes)
|
294
|
-
new.build_from_hash(attributes)
|
295
|
-
end
|
296
|
-
|
297
|
-
# Builds the object from hash
|
298
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
299
|
-
# @return [Object] Returns the model itself
|
300
|
-
def build_from_hash(attributes)
|
301
296
|
return nil unless attributes.is_a?(Hash)
|
302
297
|
attributes = attributes.transform_keys(&:to_sym)
|
303
|
-
|
304
|
-
|
305
|
-
|
298
|
+
transformed_hash = {}
|
299
|
+
openapi_types.each_pair do |key, type|
|
300
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
301
|
+
transformed_hash["#{key}"] = nil
|
306
302
|
elsif type =~ /\AArray<(.*)>/i
|
307
303
|
# check to ensure the input is an array given that the attribute
|
308
304
|
# is documented as an array but the input is not
|
309
|
-
if attributes[
|
310
|
-
|
305
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
306
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
311
307
|
end
|
312
|
-
elsif !attributes[
|
313
|
-
|
308
|
+
elsif !attributes[attribute_map[key]].nil?
|
309
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
314
310
|
end
|
315
311
|
end
|
316
|
-
|
317
|
-
self
|
312
|
+
new(transformed_hash)
|
318
313
|
end
|
319
314
|
|
320
315
|
# Deserializes the data based on type
|
321
316
|
# @param string type Data type
|
322
317
|
# @param string value Value to be deserialized
|
323
318
|
# @return [Object] Deserialized data
|
324
|
-
def _deserialize(type, value)
|
319
|
+
def self._deserialize(type, value)
|
325
320
|
case type.to_sym
|
326
321
|
when :Time
|
327
322
|
Time.parse(value)
|
@@ -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:
|
9
|
+
OpenAPI Generator version: 7.0.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -252,6 +252,7 @@ module Bandwidth
|
|
252
252
|
# Show invalid properties with the reasons. Usually used together with valid?
|
253
253
|
# @return Array for valid properties with the reasons
|
254
254
|
def list_invalid_properties
|
255
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
255
256
|
invalid_properties = Array.new
|
256
257
|
invalid_properties
|
257
258
|
end
|
@@ -259,6 +260,7 @@ module Bandwidth
|
|
259
260
|
# Check to see if the all the properties in the model are valid
|
260
261
|
# @return true if the model is valid
|
261
262
|
def valid?
|
263
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
262
264
|
true
|
263
265
|
end
|
264
266
|
|
@@ -303,37 +305,30 @@ module Bandwidth
|
|
303
305
|
# @param [Hash] attributes Model attributes in the form of hash
|
304
306
|
# @return [Object] Returns the model itself
|
305
307
|
def self.build_from_hash(attributes)
|
306
|
-
new.build_from_hash(attributes)
|
307
|
-
end
|
308
|
-
|
309
|
-
# Builds the object from hash
|
310
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
311
|
-
# @return [Object] Returns the model itself
|
312
|
-
def build_from_hash(attributes)
|
313
308
|
return nil unless attributes.is_a?(Hash)
|
314
309
|
attributes = attributes.transform_keys(&:to_sym)
|
315
|
-
|
316
|
-
|
317
|
-
|
310
|
+
transformed_hash = {}
|
311
|
+
openapi_types.each_pair do |key, type|
|
312
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
313
|
+
transformed_hash["#{key}"] = nil
|
318
314
|
elsif type =~ /\AArray<(.*)>/i
|
319
315
|
# check to ensure the input is an array given that the attribute
|
320
316
|
# is documented as an array but the input is not
|
321
|
-
if attributes[
|
322
|
-
|
317
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
318
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
323
319
|
end
|
324
|
-
elsif !attributes[
|
325
|
-
|
320
|
+
elsif !attributes[attribute_map[key]].nil?
|
321
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
326
322
|
end
|
327
323
|
end
|
328
|
-
|
329
|
-
self
|
324
|
+
new(transformed_hash)
|
330
325
|
end
|
331
326
|
|
332
327
|
# Deserializes the data based on type
|
333
328
|
# @param string type Data type
|
334
329
|
# @param string value Value to be deserialized
|
335
330
|
# @return [Object] Deserialized data
|
336
|
-
def _deserialize(type, value)
|
331
|
+
def self._deserialize(type, value)
|
337
332
|
case type.to_sym
|
338
333
|
when :Time
|
339
334
|
Time.parse(value)
|