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
 
@@ -81,6 +81,7 @@ module Bandwidth
81
81
  # Show invalid properties with the reasons. Usually used together with valid?
82
82
  # @return Array for valid properties with the reasons
83
83
  def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
85
  invalid_properties = Array.new
85
86
  invalid_properties
86
87
  end
@@ -88,6 +89,7 @@ module Bandwidth
88
89
  # Check to see if the all the properties in the model are valid
89
90
  # @return true if the model is valid
90
91
  def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
93
  true
92
94
  end
93
95
 
@@ -117,37 +119,30 @@ module Bandwidth
117
119
  # @param [Hash] attributes Model attributes in the form of hash
118
120
  # @return [Object] Returns the model itself
119
121
  def self.build_from_hash(attributes)
120
- new.build_from_hash(attributes)
121
- end
122
-
123
- # Builds the object from hash
124
- # @param [Hash] attributes Model attributes in the form of hash
125
- # @return [Object] Returns the model itself
126
- def build_from_hash(attributes)
127
122
  return nil unless attributes.is_a?(Hash)
128
123
  attributes = attributes.transform_keys(&:to_sym)
129
- self.class.openapi_types.each_pair do |key, type|
130
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
131
- self.send("#{key}=", nil)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
132
128
  elsif type =~ /\AArray<(.*)>/i
133
129
  # check to ensure the input is an array given that the attribute
134
130
  # is documented as an array but the input is not
135
- if attributes[self.class.attribute_map[key]].is_a?(Array)
136
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
137
133
  end
138
- elsif !attributes[self.class.attribute_map[key]].nil?
139
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
140
136
  end
141
137
  end
142
-
143
- self
138
+ new(transformed_hash)
144
139
  end
145
140
 
146
141
  # Deserializes the data based on type
147
142
  # @param string type Data type
148
143
  # @param string value Value to be deserialized
149
144
  # @return [Object] Deserialized data
150
- def _deserialize(type, value)
145
+ def self._deserialize(type, value)
151
146
  case type.to_sym
152
147
  when :Time
153
148
  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
 
@@ -198,6 +198,7 @@ module Bandwidth
198
198
  # Show invalid properties with the reasons. Usually used together with valid?
199
199
  # @return Array for valid properties with the reasons
200
200
  def list_invalid_properties
201
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
201
202
  invalid_properties = Array.new
202
203
  invalid_properties
203
204
  end
@@ -205,18 +206,27 @@ module Bandwidth
205
206
  # Check to see if the all the properties in the model are valid
206
207
  # @return true if the model is valid
207
208
  def valid?
209
+ warn '[DEPRECATED] the `valid?` method is obsolete'
208
210
  true
209
211
  end
210
212
 
211
213
  # Custom attribute writer method with validation
212
214
  # @param [Object] to Value to be assigned
213
215
  def to=(to)
216
+ if to.nil?
217
+ fail ArgumentError, 'to cannot be nil'
218
+ end
219
+
214
220
  @to = to
215
221
  end
216
222
 
217
223
  # Custom attribute writer method with validation
218
224
  # @param [Object] media Value to be assigned
219
225
  def media=(media)
226
+ if media.nil?
227
+ fail ArgumentError, 'media cannot be nil'
228
+ end
229
+
220
230
  @media = media
221
231
  end
222
232
 
@@ -256,37 +266,30 @@ module Bandwidth
256
266
  # @param [Hash] attributes Model attributes in the form of hash
257
267
  # @return [Object] Returns the model itself
258
268
  def self.build_from_hash(attributes)
259
- new.build_from_hash(attributes)
260
- end
261
-
262
- # Builds the object from hash
263
- # @param [Hash] attributes Model attributes in the form of hash
264
- # @return [Object] Returns the model itself
265
- def build_from_hash(attributes)
266
269
  return nil unless attributes.is_a?(Hash)
267
270
  attributes = attributes.transform_keys(&:to_sym)
268
- self.class.openapi_types.each_pair do |key, type|
269
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
270
- self.send("#{key}=", nil)
271
+ transformed_hash = {}
272
+ openapi_types.each_pair do |key, type|
273
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
274
+ transformed_hash["#{key}"] = nil
271
275
  elsif type =~ /\AArray<(.*)>/i
272
276
  # check to ensure the input is an array given that the attribute
273
277
  # is documented as an array but the input is not
274
- if attributes[self.class.attribute_map[key]].is_a?(Array)
275
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
278
+ if attributes[attribute_map[key]].is_a?(Array)
279
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
276
280
  end
277
- elsif !attributes[self.class.attribute_map[key]].nil?
278
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
281
+ elsif !attributes[attribute_map[key]].nil?
282
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
279
283
  end
280
284
  end
281
-
282
- self
285
+ new(transformed_hash)
283
286
  end
284
287
 
285
288
  # Deserializes the data based on type
286
289
  # @param string type Data type
287
290
  # @param string value Value to be deserialized
288
291
  # @return [Object] Deserialized data
289
- def _deserialize(type, value)
292
+ def self._deserialize(type, value)
290
293
  case type.to_sym
291
294
  when :Time
292
295
  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,44 +126,64 @@ 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')
166
184
  self.tag = attributes[:'tag']
185
+ else
186
+ self.tag = nil
167
187
  end
168
188
 
169
189
  if attributes.key?(:'media')
@@ -180,6 +200,7 @@ module Bandwidth
180
200
  # Show invalid properties with the reasons. Usually used together with valid?
181
201
  # @return Array for valid properties with the reasons
182
202
  def list_invalid_properties
203
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
183
204
  invalid_properties = Array.new
184
205
  if @id.nil?
185
206
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -227,6 +248,7 @@ module Bandwidth
227
248
  # Check to see if the all the properties in the model are valid
228
249
  # @return true if the model is valid
229
250
  def valid?
251
+ warn '[DEPRECATED] the `valid?` method is obsolete'
230
252
  return false if @id.nil?
231
253
  return false if @owner.nil?
232
254
  return false if @application_id.nil?
@@ -285,37 +307,30 @@ module Bandwidth
285
307
  # @param [Hash] attributes Model attributes in the form of hash
286
308
  # @return [Object] Returns the model itself
287
309
  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
310
  return nil unless attributes.is_a?(Hash)
296
311
  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)
312
+ transformed_hash = {}
313
+ openapi_types.each_pair do |key, type|
314
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
315
+ transformed_hash["#{key}"] = nil
300
316
  elsif type =~ /\AArray<(.*)>/i
301
317
  # check to ensure the input is an array given that the attribute
302
318
  # 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) })
319
+ if attributes[attribute_map[key]].is_a?(Array)
320
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
305
321
  end
306
- elsif !attributes[self.class.attribute_map[key]].nil?
307
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
322
+ elsif !attributes[attribute_map[key]].nil?
323
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
308
324
  end
309
325
  end
310
-
311
- self
326
+ new(transformed_hash)
312
327
  end
313
328
 
314
329
  # Deserializes the data based on type
315
330
  # @param string type Data type
316
331
  # @param string value Value to be deserialized
317
332
  # @return [Object] Deserialized data
318
- def _deserialize(type, value)
333
+ def self._deserialize(type, value)
319
334
  case type.to_sym
320
335
  when :Time
321
336
  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
 
@@ -80,32 +80,45 @@ module Bandwidth
80
80
 
81
81
  if attributes.key?(:'time')
82
82
  self.time = attributes[:'time']
83
+ else
84
+ self.time = nil
83
85
  end
84
86
 
85
87
  if attributes.key?(:'type')
86
88
  self.type = attributes[:'type']
89
+ else
90
+ self.type = nil
87
91
  end
88
92
 
89
93
  if attributes.key?(:'to')
90
94
  self.to = attributes[:'to']
95
+ else
96
+ self.to = nil
91
97
  end
92
98
 
93
99
  if attributes.key?(:'description')
94
100
  self.description = attributes[:'description']
101
+ else
102
+ self.description = nil
95
103
  end
96
104
 
97
105
  if attributes.key?(:'message')
98
106
  self.message = attributes[:'message']
107
+ else
108
+ self.message = nil
99
109
  end
100
110
 
101
111
  if attributes.key?(:'error_code')
102
112
  self.error_code = attributes[:'error_code']
113
+ else
114
+ self.error_code = nil
103
115
  end
104
116
  end
105
117
 
106
118
  # Show invalid properties with the reasons. Usually used together with valid?
107
119
  # @return Array for valid properties with the reasons
108
120
  def list_invalid_properties
121
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
122
  invalid_properties = Array.new
110
123
  if @time.nil?
111
124
  invalid_properties.push('invalid value for "time", time cannot be nil.')
@@ -137,6 +150,7 @@ module Bandwidth
137
150
  # Check to see if the all the properties in the model are valid
138
151
  # @return true if the model is valid
139
152
  def valid?
153
+ warn '[DEPRECATED] the `valid?` method is obsolete'
140
154
  return false if @time.nil?
141
155
  return false if @type.nil?
142
156
  return false if @to.nil?
@@ -175,37 +189,30 @@ module Bandwidth
175
189
  # @param [Hash] attributes Model attributes in the form of hash
176
190
  # @return [Object] Returns the model itself
177
191
  def self.build_from_hash(attributes)
178
- new.build_from_hash(attributes)
179
- end
180
-
181
- # Builds the object from hash
182
- # @param [Hash] attributes Model attributes in the form of hash
183
- # @return [Object] Returns the model itself
184
- def build_from_hash(attributes)
185
192
  return nil unless attributes.is_a?(Hash)
186
193
  attributes = attributes.transform_keys(&:to_sym)
187
- self.class.openapi_types.each_pair do |key, type|
188
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
189
- self.send("#{key}=", nil)
194
+ transformed_hash = {}
195
+ openapi_types.each_pair do |key, type|
196
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = nil
190
198
  elsif type =~ /\AArray<(.*)>/i
191
199
  # check to ensure the input is an array given that the attribute
192
200
  # is documented as an array but the input is not
193
- if attributes[self.class.attribute_map[key]].is_a?(Array)
194
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
201
+ if attributes[attribute_map[key]].is_a?(Array)
202
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
195
203
  end
196
- elsif !attributes[self.class.attribute_map[key]].nil?
197
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
204
+ elsif !attributes[attribute_map[key]].nil?
205
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
198
206
  end
199
207
  end
200
-
201
- self
208
+ new(transformed_hash)
202
209
  end
203
210
 
204
211
  # Deserializes the data based on type
205
212
  # @param string type Data type
206
213
  # @param string value Value to be deserialized
207
214
  # @return [Object] Deserialized data
208
- def _deserialize(type, value)
215
+ def self._deserialize(type, value)
209
216
  case type.to_sym
210
217
  when :Time
211
218
  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,44 +126,64 @@ 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')
166
184
  self.tag = attributes[:'tag']
185
+ else
186
+ self.tag = nil
167
187
  end
168
188
 
169
189
  if attributes.key?(:'media')
@@ -174,12 +194,15 @@ module Bandwidth
174
194
 
175
195
  if attributes.key?(:'priority')
176
196
  self.priority = attributes[:'priority']
197
+ else
198
+ self.priority = nil
177
199
  end
178
200
  end
179
201
 
180
202
  # Show invalid properties with the reasons. Usually used together with valid?
181
203
  # @return Array for valid properties with the reasons
182
204
  def list_invalid_properties
205
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
183
206
  invalid_properties = Array.new
184
207
  if @id.nil?
185
208
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -231,6 +254,7 @@ module Bandwidth
231
254
  # Check to see if the all the properties in the model are valid
232
255
  # @return true if the model is valid
233
256
  def valid?
257
+ warn '[DEPRECATED] the `valid?` method is obsolete'
234
258
  return false if @id.nil?
235
259
  return false if @owner.nil?
236
260
  return false if @application_id.nil?
@@ -290,37 +314,30 @@ module Bandwidth
290
314
  # @param [Hash] attributes Model attributes in the form of hash
291
315
  # @return [Object] Returns the model itself
292
316
  def self.build_from_hash(attributes)
293
- new.build_from_hash(attributes)
294
- end
295
-
296
- # Builds the object from hash
297
- # @param [Hash] attributes Model attributes in the form of hash
298
- # @return [Object] Returns the model itself
299
- def build_from_hash(attributes)
300
317
  return nil unless attributes.is_a?(Hash)
301
318
  attributes = attributes.transform_keys(&:to_sym)
302
- self.class.openapi_types.each_pair do |key, type|
303
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
304
- self.send("#{key}=", nil)
319
+ transformed_hash = {}
320
+ openapi_types.each_pair do |key, type|
321
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
322
+ transformed_hash["#{key}"] = nil
305
323
  elsif type =~ /\AArray<(.*)>/i
306
324
  # check to ensure the input is an array given that the attribute
307
325
  # is documented as an array but the input is not
308
- if attributes[self.class.attribute_map[key]].is_a?(Array)
309
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
326
+ if attributes[attribute_map[key]].is_a?(Array)
327
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
310
328
  end
311
- elsif !attributes[self.class.attribute_map[key]].nil?
312
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
329
+ elsif !attributes[attribute_map[key]].nil?
330
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
313
331
  end
314
332
  end
315
-
316
- self
333
+ new(transformed_hash)
317
334
  end
318
335
 
319
336
  # Deserializes the data based on type
320
337
  # @param string type Data type
321
338
  # @param string value Value to be deserialized
322
339
  # @return [Object] Deserialized data
323
- def _deserialize(type, value)
340
+ def self._deserialize(type, value)
324
341
  case type.to_sym
325
342
  when :Time
326
343
  Time.parse(value)