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.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/bandwidth-sdk.gemspec +1 -1
  4. data/bandwidth.yml +26 -0
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +264 -295
  7. data/coverage/index.html +2839 -3180
  8. data/docs/CreateCall.md +2 -0
  9. data/lib/bandwidth-sdk/api/calls_api.rb +1 -1
  10. data/lib/bandwidth-sdk/api/conferences_api.rb +1 -1
  11. data/lib/bandwidth-sdk/api/media_api.rb +1 -1
  12. data/lib/bandwidth-sdk/api/messages_api.rb +1 -1
  13. data/lib/bandwidth-sdk/api/mfa_api.rb +1 -1
  14. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +1 -1
  15. data/lib/bandwidth-sdk/api/recordings_api.rb +1 -1
  16. data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
  17. data/lib/bandwidth-sdk/api_client.rb +1 -1
  18. data/lib/bandwidth-sdk/api_error.rb +1 -1
  19. data/lib/bandwidth-sdk/configuration.rb +10 -8
  20. data/lib/bandwidth-sdk/models/account_statistics.rb +13 -18
  21. data/lib/bandwidth-sdk/models/answer_callback.rb +13 -18
  22. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +13 -18
  23. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +13 -18
  24. data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
  25. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +13 -18
  26. data/lib/bandwidth-sdk/models/call_state.rb +13 -18
  27. data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
  28. data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
  29. data/lib/bandwidth-sdk/models/code_request.rb +28 -19
  30. data/lib/bandwidth-sdk/models/conference.rb +13 -18
  31. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +13 -18
  32. data/lib/bandwidth-sdk/models/conference_created_callback.rb +13 -18
  33. data/lib/bandwidth-sdk/models/conference_member.rb +13 -18
  34. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +13 -18
  35. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +13 -18
  36. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +13 -18
  37. data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +13 -18
  38. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +13 -18
  39. data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
  40. data/lib/bandwidth-sdk/models/create_call.rb +48 -19
  41. data/lib/bandwidth-sdk/models/create_call_response.rb +27 -18
  42. data/lib/bandwidth-sdk/models/create_lookup_response.rb +13 -18
  43. data/lib/bandwidth-sdk/models/create_message_request_error.rb +17 -18
  44. data/lib/bandwidth-sdk/models/deferred_result.rb +13 -18
  45. data/lib/bandwidth-sdk/models/disconnect_callback.rb +13 -18
  46. data/lib/bandwidth-sdk/models/diversion.rb +13 -18
  47. data/lib/bandwidth-sdk/models/dtmf_callback.rb +13 -18
  48. data/lib/bandwidth-sdk/models/field_error.rb +13 -18
  49. data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
  50. data/lib/bandwidth-sdk/models/gather_callback.rb +13 -18
  51. data/lib/bandwidth-sdk/models/inbound_message_callback.rb +23 -18
  52. data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +31 -18
  53. data/lib/bandwidth-sdk/models/initiate_callback.rb +13 -18
  54. data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
  55. data/lib/bandwidth-sdk/models/list_message_item.rb +13 -18
  56. data/lib/bandwidth-sdk/models/lookup_request.rb +15 -18
  57. data/lib/bandwidth-sdk/models/lookup_result.rb +13 -18
  58. data/lib/bandwidth-sdk/models/lookup_status.rb +13 -18
  59. data/lib/bandwidth-sdk/models/lookup_status_enum.rb +1 -1
  60. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +13 -18
  61. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +13 -18
  62. data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
  63. data/lib/bandwidth-sdk/models/machine_detection_result.rb +13 -18
  64. data/lib/bandwidth-sdk/models/media.rb +13 -18
  65. data/lib/bandwidth-sdk/models/message.rb +21 -18
  66. data/lib/bandwidth-sdk/models/message_delivered_callback.rb +23 -18
  67. data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +33 -18
  68. data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
  69. data/lib/bandwidth-sdk/models/message_failed_callback.rb +25 -18
  70. data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +35 -18
  71. data/lib/bandwidth-sdk/models/message_request.rb +24 -19
  72. data/lib/bandwidth-sdk/models/message_sending_callback.rb +23 -18
  73. data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +35 -18
  74. data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
  75. data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
  76. data/lib/bandwidth-sdk/models/messages_list.rb +13 -18
  77. data/lib/bandwidth-sdk/models/messaging_code_response.rb +13 -18
  78. data/lib/bandwidth-sdk/models/messaging_request_error.rb +17 -18
  79. data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +13 -18
  80. data/lib/bandwidth-sdk/models/mfa_request_error.rb +13 -18
  81. data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +13 -18
  82. data/lib/bandwidth-sdk/models/page_info.rb +13 -18
  83. data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
  84. data/lib/bandwidth-sdk/models/recording_available_callback.rb +13 -18
  85. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +13 -18
  86. data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
  87. data/lib/bandwidth-sdk/models/redirect_callback.rb +13 -18
  88. data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
  89. data/lib/bandwidth-sdk/models/stir_shaken.rb +13 -18
  90. data/lib/bandwidth-sdk/models/tag.rb +13 -18
  91. data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +13 -18
  92. data/lib/bandwidth-sdk/models/transcribe_recording.rb +13 -18
  93. data/lib/bandwidth-sdk/models/transcription.rb +13 -18
  94. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +13 -18
  95. data/lib/bandwidth-sdk/models/transcription_list.rb +13 -18
  96. data/lib/bandwidth-sdk/models/transcription_metadata.rb +13 -18
  97. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +13 -18
  98. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +13 -18
  99. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +13 -18
  100. data/lib/bandwidth-sdk/models/update_call.rb +13 -18
  101. data/lib/bandwidth-sdk/models/update_call_recording.rb +15 -18
  102. data/lib/bandwidth-sdk/models/update_conference.rb +13 -18
  103. data/lib/bandwidth-sdk/models/update_conference_member.rb +13 -18
  104. data/lib/bandwidth-sdk/models/verify_code_request.rb +19 -18
  105. data/lib/bandwidth-sdk/models/verify_code_response.rb +13 -18
  106. data/lib/bandwidth-sdk/models/voice_api_error.rb +13 -18
  107. data/lib/bandwidth-sdk/models/voice_code_response.rb +13 -18
  108. data/lib/bandwidth-sdk/version.rb +1 -1
  109. data/lib/bandwidth-sdk.rb +1 -1
  110. data/openapitools.json +1 -1
  111. data/spec/api/calls_api_spec.rb +2 -0
  112. data/spec/api_client_spec.rb +1 -1
  113. data/spec/configuration_spec.rb +19 -7
  114. data/spec/integration/calls_api_integration_spec.rb +2 -0
  115. data/spec/models/call_state_spec.rb +0 -13
  116. data/spec/models/deferred_result_spec.rb +1 -14
  117. data/spec/models/message_spec.rb +10 -17
  118. data/spec/models/verify_code_request_spec.rb +7 -15
  119. metadata +36 -36
@@ -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: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -246,6 +246,7 @@ module Bandwidth
246
246
  # Show invalid properties with the reasons. Usually used together with valid?
247
247
  # @return Array for valid properties with the reasons
248
248
  def list_invalid_properties
249
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
249
250
  invalid_properties = Array.new
250
251
  invalid_properties
251
252
  end
@@ -253,6 +254,7 @@ module Bandwidth
253
254
  # Check to see if the all the properties in the model are valid
254
255
  # @return true if the model is valid
255
256
  def valid?
257
+ warn '[DEPRECATED] the `valid?` method is obsolete'
256
258
  true
257
259
  end
258
260
 
@@ -297,37 +299,30 @@ module Bandwidth
297
299
  # @param [Hash] attributes Model attributes in the form of hash
298
300
  # @return [Object] Returns the model itself
299
301
  def self.build_from_hash(attributes)
300
- new.build_from_hash(attributes)
301
- end
302
-
303
- # Builds the object from hash
304
- # @param [Hash] attributes Model attributes in the form of hash
305
- # @return [Object] Returns the model itself
306
- def build_from_hash(attributes)
307
302
  return nil unless attributes.is_a?(Hash)
308
303
  attributes = attributes.transform_keys(&:to_sym)
309
- self.class.openapi_types.each_pair do |key, type|
310
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
311
- self.send("#{key}=", nil)
304
+ transformed_hash = {}
305
+ openapi_types.each_pair do |key, type|
306
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
307
+ transformed_hash["#{key}"] = nil
312
308
  elsif type =~ /\AArray<(.*)>/i
313
309
  # check to ensure the input is an array given that the attribute
314
310
  # is documented as an array but the input is not
315
- if attributes[self.class.attribute_map[key]].is_a?(Array)
316
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
311
+ if attributes[attribute_map[key]].is_a?(Array)
312
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
317
313
  end
318
- elsif !attributes[self.class.attribute_map[key]].nil?
319
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
314
+ elsif !attributes[attribute_map[key]].nil?
315
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
320
316
  end
321
317
  end
322
-
323
- self
318
+ new(transformed_hash)
324
319
  end
325
320
 
326
321
  # Deserializes the data based on type
327
322
  # @param string type Data type
328
323
  # @param string value Value to be deserialized
329
324
  # @return [Object] Deserialized data
330
- def _deserialize(type, value)
325
+ def self._deserialize(type, value)
331
326
  case type.to_sym
332
327
  when :Time
333
328
  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: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -264,6 +264,7 @@ module Bandwidth
264
264
  # Show invalid properties with the reasons. Usually used together with valid?
265
265
  # @return Array for valid properties with the reasons
266
266
  def list_invalid_properties
267
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
267
268
  invalid_properties = Array.new
268
269
  invalid_properties
269
270
  end
@@ -271,6 +272,7 @@ module Bandwidth
271
272
  # Check to see if the all the properties in the model are valid
272
273
  # @return true if the model is valid
273
274
  def valid?
275
+ warn '[DEPRECATED] the `valid?` method is obsolete'
274
276
  true
275
277
  end
276
278
 
@@ -317,37 +319,30 @@ module Bandwidth
317
319
  # @param [Hash] attributes Model attributes in the form of hash
318
320
  # @return [Object] Returns the model itself
319
321
  def self.build_from_hash(attributes)
320
- new.build_from_hash(attributes)
321
- end
322
-
323
- # Builds the object from hash
324
- # @param [Hash] attributes Model attributes in the form of hash
325
- # @return [Object] Returns the model itself
326
- def build_from_hash(attributes)
327
322
  return nil unless attributes.is_a?(Hash)
328
323
  attributes = attributes.transform_keys(&:to_sym)
329
- self.class.openapi_types.each_pair do |key, type|
330
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
331
- self.send("#{key}=", nil)
324
+ transformed_hash = {}
325
+ openapi_types.each_pair do |key, type|
326
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
327
+ transformed_hash["#{key}"] = nil
332
328
  elsif type =~ /\AArray<(.*)>/i
333
329
  # check to ensure the input is an array given that the attribute
334
330
  # is documented as an array but the input is not
335
- if attributes[self.class.attribute_map[key]].is_a?(Array)
336
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
331
+ if attributes[attribute_map[key]].is_a?(Array)
332
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
337
333
  end
338
- elsif !attributes[self.class.attribute_map[key]].nil?
339
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
334
+ elsif !attributes[attribute_map[key]].nil?
335
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
340
336
  end
341
337
  end
342
-
343
- self
338
+ new(transformed_hash)
344
339
  end
345
340
 
346
341
  # Deserializes the data based on type
347
342
  # @param string type Data type
348
343
  # @param string value Value to be deserialized
349
344
  # @return [Object] Deserialized data
350
- def _deserialize(type, value)
345
+ def self._deserialize(type, value)
351
346
  case type.to_sym
352
347
  when :Time
353
348
  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: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -182,6 +182,7 @@ module Bandwidth
182
182
  # Show invalid properties with the reasons. Usually used together with valid?
183
183
  # @return Array for valid properties with the reasons
184
184
  def list_invalid_properties
185
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
185
186
  invalid_properties = Array.new
186
187
  if !@username.nil? && @username.to_s.length > 1024
187
188
  invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.')
@@ -209,6 +210,7 @@ module Bandwidth
209
210
  # Check to see if the all the properties in the model are valid
210
211
  # @return true if the model is valid
211
212
  def valid?
213
+ warn '[DEPRECATED] the `valid?` method is obsolete'
212
214
  return false if !@username.nil? && @username.to_s.length > 1024
213
215
  return false if !@password.nil? && @password.to_s.length > 1024
214
216
  return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024
@@ -300,37 +302,30 @@ module Bandwidth
300
302
  # @param [Hash] attributes Model attributes in the form of hash
301
303
  # @return [Object] Returns the model itself
302
304
  def self.build_from_hash(attributes)
303
- new.build_from_hash(attributes)
304
- end
305
-
306
- # Builds the object from hash
307
- # @param [Hash] attributes Model attributes in the form of hash
308
- # @return [Object] Returns the model itself
309
- def build_from_hash(attributes)
310
305
  return nil unless attributes.is_a?(Hash)
311
306
  attributes = attributes.transform_keys(&:to_sym)
312
- self.class.openapi_types.each_pair do |key, type|
313
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
314
- self.send("#{key}=", nil)
307
+ transformed_hash = {}
308
+ openapi_types.each_pair do |key, type|
309
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
310
+ transformed_hash["#{key}"] = nil
315
311
  elsif type =~ /\AArray<(.*)>/i
316
312
  # check to ensure the input is an array given that the attribute
317
313
  # is documented as an array but the input is not
318
- if attributes[self.class.attribute_map[key]].is_a?(Array)
319
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
314
+ if attributes[attribute_map[key]].is_a?(Array)
315
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
320
316
  end
321
- elsif !attributes[self.class.attribute_map[key]].nil?
322
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
317
+ elsif !attributes[attribute_map[key]].nil?
318
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
323
319
  end
324
320
  end
325
-
326
- self
321
+ new(transformed_hash)
327
322
  end
328
323
 
329
324
  # Deserializes the data based on type
330
325
  # @param string type Data type
331
326
  # @param string value Value to be deserialized
332
327
  # @return [Object] Deserialized data
333
- def _deserialize(type, value)
328
+ def self._deserialize(type, value)
334
329
  case type.to_sym
335
330
  when :Time
336
331
  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: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -81,12 +81,15 @@ module Bandwidth
81
81
 
82
82
  if attributes.key?(:'state')
83
83
  self.state = attributes[:'state']
84
+ else
85
+ self.state = nil
84
86
  end
85
87
  end
86
88
 
87
89
  # Show invalid properties with the reasons. Usually used together with valid?
88
90
  # @return Array for valid properties with the reasons
89
91
  def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
93
  invalid_properties = Array.new
91
94
  if @state.nil?
92
95
  invalid_properties.push('invalid value for "state", state cannot be nil.')
@@ -98,6 +101,7 @@ module Bandwidth
98
101
  # Check to see if the all the properties in the model are valid
99
102
  # @return true if the model is valid
100
103
  def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
105
  return false if @state.nil?
102
106
  true
103
107
  end
@@ -126,37 +130,30 @@ module Bandwidth
126
130
  # @param [Hash] attributes Model attributes in the form of hash
127
131
  # @return [Object] Returns the model itself
128
132
  def self.build_from_hash(attributes)
129
- new.build_from_hash(attributes)
130
- end
131
-
132
- # Builds the object from hash
133
- # @param [Hash] attributes Model attributes in the form of hash
134
- # @return [Object] Returns the model itself
135
- def build_from_hash(attributes)
136
133
  return nil unless attributes.is_a?(Hash)
137
134
  attributes = attributes.transform_keys(&:to_sym)
138
- self.class.openapi_types.each_pair do |key, type|
139
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
140
- self.send("#{key}=", nil)
135
+ transformed_hash = {}
136
+ openapi_types.each_pair do |key, type|
137
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
138
+ transformed_hash["#{key}"] = nil
141
139
  elsif type =~ /\AArray<(.*)>/i
142
140
  # check to ensure the input is an array given that the attribute
143
141
  # is documented as an array but the input is not
144
- if attributes[self.class.attribute_map[key]].is_a?(Array)
145
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
142
+ if attributes[attribute_map[key]].is_a?(Array)
143
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
146
144
  end
147
- elsif !attributes[self.class.attribute_map[key]].nil?
148
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
145
+ elsif !attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
149
147
  end
150
148
  end
151
-
152
- self
149
+ new(transformed_hash)
153
150
  end
154
151
 
155
152
  # Deserializes the data based on type
156
153
  # @param string type Data type
157
154
  # @param string value Value to be deserialized
158
155
  # @return [Object] Deserialized data
159
- def _deserialize(type, value)
156
+ def self._deserialize(type, value)
160
157
  case type.to_sym
161
158
  when :Time
162
159
  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: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -172,6 +172,7 @@ module Bandwidth
172
172
  # Show invalid properties with the reasons. Usually used together with valid?
173
173
  # @return Array for valid properties with the reasons
174
174
  def list_invalid_properties
175
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
175
176
  invalid_properties = Array.new
176
177
  if !@username.nil? && @username.to_s.length > 1024
177
178
  invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.')
@@ -195,6 +196,7 @@ module Bandwidth
195
196
  # Check to see if the all the properties in the model are valid
196
197
  # @return true if the model is valid
197
198
  def valid?
199
+ warn '[DEPRECATED] the `valid?` method is obsolete'
198
200
  return false if !@username.nil? && @username.to_s.length > 1024
199
201
  return false if !@password.nil? && @password.to_s.length > 1024
200
202
  return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024
@@ -274,37 +276,30 @@ module Bandwidth
274
276
  # @param [Hash] attributes Model attributes in the form of hash
275
277
  # @return [Object] Returns the model itself
276
278
  def self.build_from_hash(attributes)
277
- new.build_from_hash(attributes)
278
- end
279
-
280
- # Builds the object from hash
281
- # @param [Hash] attributes Model attributes in the form of hash
282
- # @return [Object] Returns the model itself
283
- def build_from_hash(attributes)
284
279
  return nil unless attributes.is_a?(Hash)
285
280
  attributes = attributes.transform_keys(&:to_sym)
286
- self.class.openapi_types.each_pair do |key, type|
287
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
288
- self.send("#{key}=", nil)
281
+ transformed_hash = {}
282
+ openapi_types.each_pair do |key, type|
283
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
284
+ transformed_hash["#{key}"] = nil
289
285
  elsif type =~ /\AArray<(.*)>/i
290
286
  # check to ensure the input is an array given that the attribute
291
287
  # is documented as an array but the input is not
292
- if attributes[self.class.attribute_map[key]].is_a?(Array)
293
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
288
+ if attributes[attribute_map[key]].is_a?(Array)
289
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
294
290
  end
295
- elsif !attributes[self.class.attribute_map[key]].nil?
296
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
291
+ elsif !attributes[attribute_map[key]].nil?
292
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
297
293
  end
298
294
  end
299
-
300
- self
295
+ new(transformed_hash)
301
296
  end
302
297
 
303
298
  # Deserializes the data based on type
304
299
  # @param string type Data type
305
300
  # @param string value Value to be deserialized
306
301
  # @return [Object] Deserialized data
307
- def _deserialize(type, value)
302
+ def self._deserialize(type, value)
308
303
  case type.to_sym
309
304
  when :Time
310
305
  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: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -87,6 +87,7 @@ module Bandwidth
87
87
  # Show invalid properties with the reasons. Usually used together with valid?
88
88
  # @return Array for valid properties with the reasons
89
89
  def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
91
  invalid_properties = Array.new
91
92
  invalid_properties
92
93
  end
@@ -94,6 +95,7 @@ module Bandwidth
94
95
  # Check to see if the all the properties in the model are valid
95
96
  # @return true if the model is valid
96
97
  def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
99
  true
98
100
  end
99
101
 
@@ -123,37 +125,30 @@ module Bandwidth
123
125
  # @param [Hash] attributes Model attributes in the form of hash
124
126
  # @return [Object] Returns the model itself
125
127
  def self.build_from_hash(attributes)
126
- new.build_from_hash(attributes)
127
- end
128
-
129
- # Builds the object from hash
130
- # @param [Hash] attributes Model attributes in the form of hash
131
- # @return [Object] Returns the model itself
132
- def build_from_hash(attributes)
133
128
  return nil unless attributes.is_a?(Hash)
134
129
  attributes = attributes.transform_keys(&:to_sym)
135
- self.class.openapi_types.each_pair do |key, type|
136
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
137
- self.send("#{key}=", nil)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
138
134
  elsif type =~ /\AArray<(.*)>/i
139
135
  # check to ensure the input is an array given that the attribute
140
136
  # is documented as an array but the input is not
141
- if attributes[self.class.attribute_map[key]].is_a?(Array)
142
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
143
139
  end
144
- elsif !attributes[self.class.attribute_map[key]].nil?
145
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
146
142
  end
147
143
  end
148
-
149
- self
144
+ new(transformed_hash)
150
145
  end
151
146
 
152
147
  # Deserializes the data based on type
153
148
  # @param string type Data type
154
149
  # @param string value Value to be deserialized
155
150
  # @return [Object] Deserialized data
156
- def _deserialize(type, value)
151
+ def self._deserialize(type, value)
157
152
  case type.to_sym
158
153
  when :Time
159
154
  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: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -75,6 +75,8 @@ module Bandwidth
75
75
 
76
76
  if attributes.key?(:'to')
77
77
  self.to = attributes[:'to']
78
+ else
79
+ self.to = nil
78
80
  end
79
81
 
80
82
  if attributes.key?(:'scope')
@@ -83,16 +85,21 @@ module Bandwidth
83
85
 
84
86
  if attributes.key?(:'expiration_time_in_minutes')
85
87
  self.expiration_time_in_minutes = attributes[:'expiration_time_in_minutes']
88
+ else
89
+ self.expiration_time_in_minutes = nil
86
90
  end
87
91
 
88
92
  if attributes.key?(:'code')
89
93
  self.code = attributes[:'code']
94
+ else
95
+ self.code = nil
90
96
  end
91
97
  end
92
98
 
93
99
  # Show invalid properties with the reasons. Usually used together with valid?
94
100
  # @return Array for valid properties with the reasons
95
101
  def list_invalid_properties
102
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
103
  invalid_properties = Array.new
97
104
  if @to.nil?
98
105
  invalid_properties.push('invalid value for "to", to cannot be nil.')
@@ -133,6 +140,7 @@ module Bandwidth
133
140
  # Check to see if the all the properties in the model are valid
134
141
  # @return true if the model is valid
135
142
  def valid?
143
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
144
  return false if @to.nil?
137
145
  return false if @to !~ Regexp.new(/^\+[1-9]\d{1,14}$/)
138
146
  return false if @expiration_time_in_minutes.nil?
@@ -222,37 +230,30 @@ module Bandwidth
222
230
  # @param [Hash] attributes Model attributes in the form of hash
223
231
  # @return [Object] Returns the model itself
224
232
  def self.build_from_hash(attributes)
225
- new.build_from_hash(attributes)
226
- end
227
-
228
- # Builds the object from hash
229
- # @param [Hash] attributes Model attributes in the form of hash
230
- # @return [Object] Returns the model itself
231
- def build_from_hash(attributes)
232
233
  return nil unless attributes.is_a?(Hash)
233
234
  attributes = attributes.transform_keys(&:to_sym)
234
- self.class.openapi_types.each_pair do |key, type|
235
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
236
- self.send("#{key}=", nil)
235
+ transformed_hash = {}
236
+ openapi_types.each_pair do |key, type|
237
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
238
+ transformed_hash["#{key}"] = nil
237
239
  elsif type =~ /\AArray<(.*)>/i
238
240
  # check to ensure the input is an array given that the attribute
239
241
  # is documented as an array but the input is not
240
- if attributes[self.class.attribute_map[key]].is_a?(Array)
241
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
242
+ if attributes[attribute_map[key]].is_a?(Array)
243
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
242
244
  end
243
- elsif !attributes[self.class.attribute_map[key]].nil?
244
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
245
+ elsif !attributes[attribute_map[key]].nil?
246
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
245
247
  end
246
248
  end
247
-
248
- self
249
+ new(transformed_hash)
249
250
  end
250
251
 
251
252
  # Deserializes the data based on type
252
253
  # @param string type Data type
253
254
  # @param string value Value to be deserialized
254
255
  # @return [Object] Deserialized data
255
- def _deserialize(type, value)
256
+ def self._deserialize(type, value)
256
257
  case type.to_sym
257
258
  when :Time
258
259
  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: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -66,6 +66,7 @@ module Bandwidth
66
66
  # Show invalid properties with the reasons. Usually used together with valid?
67
67
  # @return Array for valid properties with the reasons
68
68
  def list_invalid_properties
69
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
69
70
  invalid_properties = Array.new
70
71
  invalid_properties
71
72
  end
@@ -73,6 +74,7 @@ module Bandwidth
73
74
  # Check to see if the all the properties in the model are valid
74
75
  # @return true if the model is valid
75
76
  def valid?
77
+ warn '[DEPRECATED] the `valid?` method is obsolete'
76
78
  true
77
79
  end
78
80
 
@@ -100,37 +102,30 @@ module Bandwidth
100
102
  # @param [Hash] attributes Model attributes in the form of hash
101
103
  # @return [Object] Returns the model itself
102
104
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
105
  return nil unless attributes.is_a?(Hash)
111
106
  attributes = attributes.transform_keys(&:to_sym)
112
- self.class.openapi_types.each_pair do |key, type|
113
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
107
+ transformed_hash = {}
108
+ openapi_types.each_pair do |key, type|
109
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
110
+ transformed_hash["#{key}"] = nil
115
111
  elsif type =~ /\AArray<(.*)>/i
116
112
  # check to ensure the input is an array given that the attribute
117
113
  # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ if attributes[attribute_map[key]].is_a?(Array)
115
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
120
116
  end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ elsif !attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
119
  end
124
120
  end
125
-
126
- self
121
+ new(transformed_hash)
127
122
  end
128
123
 
129
124
  # Deserializes the data based on type
130
125
  # @param string type Data type
131
126
  # @param string value Value to be deserialized
132
127
  # @return [Object] Deserialized data
133
- def _deserialize(type, value)
128
+ def self._deserialize(type, value)
134
129
  case type.to_sym
135
130
  when :Time
136
131
  Time.parse(value)