bandwidth-sdk 11.0.0.pre.beta.2.0 → 11.0.0.pre.beta.3.0

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