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
 
@@ -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)
@@ -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
 
@@ -116,16 +116,22 @@ module Bandwidth
116
116
 
117
117
  if attributes.key?(:'application_id')
118
118
  self.application_id = attributes[:'application_id']
119
+ else
120
+ self.application_id = nil
119
121
  end
120
122
 
121
123
  if attributes.key?(:'to')
122
124
  if (value = attributes[:'to']).is_a?(Array)
123
125
  self.to = value
124
126
  end
127
+ else
128
+ self.to = nil
125
129
  end
126
130
 
127
131
  if attributes.key?(:'from')
128
132
  self.from = attributes[:'from']
133
+ else
134
+ self.from = nil
129
135
  end
130
136
 
131
137
  if attributes.key?(:'text')
@@ -154,6 +160,7 @@ module Bandwidth
154
160
  # Show invalid properties with the reasons. Usually used together with valid?
155
161
  # @return Array for valid properties with the reasons
156
162
  def list_invalid_properties
163
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
157
164
  invalid_properties = Array.new
158
165
  if @application_id.nil?
159
166
  invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
@@ -177,6 +184,7 @@ module Bandwidth
177
184
  # Check to see if the all the properties in the model are valid
178
185
  # @return true if the model is valid
179
186
  def valid?
187
+ warn '[DEPRECATED] the `valid?` method is obsolete'
180
188
  return false if @application_id.nil?
181
189
  return false if @to.nil?
182
190
  return false if @from.nil?
@@ -197,7 +205,11 @@ module Bandwidth
197
205
  # Custom attribute writer method with validation
198
206
  # @param [Object] text Value to be assigned
199
207
  def text=(text)
200
- if !text.nil? && text.to_s.length > 2048
208
+ if text.nil?
209
+ fail ArgumentError, 'text cannot be nil'
210
+ end
211
+
212
+ if text.to_s.length > 2048
201
213
  fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 2048.'
202
214
  end
203
215
 
@@ -235,37 +247,30 @@ module Bandwidth
235
247
  # @param [Hash] attributes Model attributes in the form of hash
236
248
  # @return [Object] Returns the model itself
237
249
  def self.build_from_hash(attributes)
238
- new.build_from_hash(attributes)
239
- end
240
-
241
- # Builds the object from hash
242
- # @param [Hash] attributes Model attributes in the form of hash
243
- # @return [Object] Returns the model itself
244
- def build_from_hash(attributes)
245
250
  return nil unless attributes.is_a?(Hash)
246
251
  attributes = attributes.transform_keys(&:to_sym)
247
- self.class.openapi_types.each_pair do |key, type|
248
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
249
- self.send("#{key}=", nil)
252
+ transformed_hash = {}
253
+ openapi_types.each_pair do |key, type|
254
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
255
+ transformed_hash["#{key}"] = nil
250
256
  elsif type =~ /\AArray<(.*)>/i
251
257
  # check to ensure the input is an array given that the attribute
252
258
  # is documented as an array but the input is not
253
- if attributes[self.class.attribute_map[key]].is_a?(Array)
254
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
259
+ if attributes[attribute_map[key]].is_a?(Array)
260
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
255
261
  end
256
- elsif !attributes[self.class.attribute_map[key]].nil?
257
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
262
+ elsif !attributes[attribute_map[key]].nil?
263
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
258
264
  end
259
265
  end
260
-
261
- self
266
+ new(transformed_hash)
262
267
  end
263
268
 
264
269
  # Deserializes the data based on type
265
270
  # @param string type Data type
266
271
  # @param string value Value to be deserialized
267
272
  # @return [Object] Deserialized data
268
- def _deserialize(type, value)
273
+ def self._deserialize(type, value)
269
274
  case type.to_sym
270
275
  when :Time
271
276
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
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
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')
@@ -170,16 +188,21 @@ module Bandwidth
170
188
  if (value = attributes[:'media']).is_a?(Array)
171
189
  self.media = value
172
190
  end
191
+ else
192
+ self.media = nil
173
193
  end
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)
@@ -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
 
@@ -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
 
@@ -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
 
@@ -84,6 +84,7 @@ module Bandwidth
84
84
  # Show invalid properties with the reasons. Usually used together with valid?
85
85
  # @return Array for valid properties with the reasons
86
86
  def list_invalid_properties
87
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
88
  invalid_properties = Array.new
88
89
  invalid_properties
89
90
  end
@@ -91,6 +92,7 @@ module Bandwidth
91
92
  # Check to see if the all the properties in the model are valid
92
93
  # @return true if the model is valid
93
94
  def valid?
95
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
96
  true
95
97
  end
96
98
 
@@ -120,37 +122,30 @@ module Bandwidth
120
122
  # @param [Hash] attributes Model attributes in the form of hash
121
123
  # @return [Object] Returns the model itself
122
124
  def self.build_from_hash(attributes)
123
- new.build_from_hash(attributes)
124
- end
125
-
126
- # Builds the object from hash
127
- # @param [Hash] attributes Model attributes in the form of hash
128
- # @return [Object] Returns the model itself
129
- def build_from_hash(attributes)
130
125
  return nil unless attributes.is_a?(Hash)
131
126
  attributes = attributes.transform_keys(&:to_sym)
132
- self.class.openapi_types.each_pair do |key, type|
133
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
- self.send("#{key}=", nil)
127
+ transformed_hash = {}
128
+ openapi_types.each_pair do |key, type|
129
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
130
+ transformed_hash["#{key}"] = nil
135
131
  elsif type =~ /\AArray<(.*)>/i
136
132
  # check to ensure the input is an array given that the attribute
137
133
  # is documented as an array but the input is not
138
- if attributes[self.class.attribute_map[key]].is_a?(Array)
139
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
+ if attributes[attribute_map[key]].is_a?(Array)
135
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
136
  end
141
- elsif !attributes[self.class.attribute_map[key]].nil?
142
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ elsif !attributes[attribute_map[key]].nil?
138
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
139
  end
144
140
  end
145
-
146
- self
141
+ new(transformed_hash)
147
142
  end
148
143
 
149
144
  # Deserializes the data based on type
150
145
  # @param string type Data type
151
146
  # @param string value Value to be deserialized
152
147
  # @return [Object] Deserialized data
153
- def _deserialize(type, value)
148
+ def self._deserialize(type, value)
154
149
  case type.to_sym
155
150
  when :Time
156
151
  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)