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
 
@@ -178,6 +178,7 @@ module Bandwidth
178
178
  # Show invalid properties with the reasons. Usually used together with valid?
179
179
  # @return Array for valid properties with the reasons
180
180
  def list_invalid_properties
181
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
181
182
  invalid_properties = Array.new
182
183
  invalid_properties
183
184
  end
@@ -185,6 +186,7 @@ module Bandwidth
185
186
  # Check to see if the all the properties in the model are valid
186
187
  # @return true if the model is valid
187
188
  def valid?
189
+ warn '[DEPRECATED] the `valid?` method is obsolete'
188
190
  true
189
191
  end
190
192
 
@@ -222,37 +224,30 @@ module Bandwidth
222
224
  # @param [Hash] attributes Model attributes in the form of hash
223
225
  # @return [Object] Returns the model itself
224
226
  def self.build_from_hash(attributes)
225
- new.build_from_hash(attributes)
226
- end
227
-
228
- # Builds the object from hash
229
- # @param [Hash] attributes Model attributes in the form of hash
230
- # @return [Object] Returns the model itself
231
- def build_from_hash(attributes)
232
227
  return nil unless attributes.is_a?(Hash)
233
228
  attributes = attributes.transform_keys(&:to_sym)
234
- self.class.openapi_types.each_pair do |key, type|
235
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
236
- self.send("#{key}=", nil)
229
+ transformed_hash = {}
230
+ openapi_types.each_pair do |key, type|
231
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
232
+ transformed_hash["#{key}"] = nil
237
233
  elsif type =~ /\AArray<(.*)>/i
238
234
  # check to ensure the input is an array given that the attribute
239
235
  # is documented as an array but the input is not
240
- if attributes[self.class.attribute_map[key]].is_a?(Array)
241
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
236
+ if attributes[attribute_map[key]].is_a?(Array)
237
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
242
238
  end
243
- elsif !attributes[self.class.attribute_map[key]].nil?
244
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
239
+ elsif !attributes[attribute_map[key]].nil?
240
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
245
241
  end
246
242
  end
247
-
248
- self
243
+ new(transformed_hash)
249
244
  end
250
245
 
251
246
  # Deserializes the data based on type
252
247
  # @param string type Data type
253
248
  # @param string value Value to be deserialized
254
249
  # @return [Object] Deserialized data
255
- def _deserialize(type, value)
250
+ def self._deserialize(type, value)
256
251
  case type.to_sym
257
252
  when :Time
258
253
  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
 
@@ -104,6 +104,7 @@ module Bandwidth
104
104
  # Show invalid properties with the reasons. Usually used together with valid?
105
105
  # @return Array for valid properties with the reasons
106
106
  def list_invalid_properties
107
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
108
  invalid_properties = Array.new
108
109
  invalid_properties
109
110
  end
@@ -111,6 +112,7 @@ module Bandwidth
111
112
  # Check to see if the all the properties in the model are valid
112
113
  # @return true if the model is valid
113
114
  def valid?
115
+ warn '[DEPRECATED] the `valid?` method is obsolete'
114
116
  true
115
117
  end
116
118
 
@@ -142,37 +144,30 @@ module Bandwidth
142
144
  # @param [Hash] attributes Model attributes in the form of hash
143
145
  # @return [Object] Returns the model itself
144
146
  def self.build_from_hash(attributes)
145
- new.build_from_hash(attributes)
146
- end
147
-
148
- # Builds the object from hash
149
- # @param [Hash] attributes Model attributes in the form of hash
150
- # @return [Object] Returns the model itself
151
- def build_from_hash(attributes)
152
147
  return nil unless attributes.is_a?(Hash)
153
148
  attributes = attributes.transform_keys(&:to_sym)
154
- self.class.openapi_types.each_pair do |key, type|
155
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
156
- self.send("#{key}=", nil)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
157
153
  elsif type =~ /\AArray<(.*)>/i
158
154
  # check to ensure the input is an array given that the attribute
159
155
  # is documented as an array but the input is not
160
- if attributes[self.class.attribute_map[key]].is_a?(Array)
161
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
162
158
  end
163
- elsif !attributes[self.class.attribute_map[key]].nil?
164
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
165
161
  end
166
162
  end
167
-
168
- self
163
+ new(transformed_hash)
169
164
  end
170
165
 
171
166
  # Deserializes the data based on type
172
167
  # @param string type Data type
173
168
  # @param string value Value to be deserialized
174
169
  # @return [Object] Deserialized data
175
- def _deserialize(type, value)
170
+ def self._deserialize(type, value)
176
171
  case type.to_sym
177
172
  when :Time
178
173
  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
 
@@ -21,6 +21,9 @@ module Bandwidth
21
21
  # A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`).
22
22
  attr_accessor :from
23
23
 
24
+ # The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines.
25
+ attr_accessor :display_name
26
+
24
27
  # A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.
25
28
  attr_accessor :uui
26
29
 
@@ -95,6 +98,7 @@ module Bandwidth
95
98
  {
96
99
  :'to' => :'to',
97
100
  :'from' => :'from',
101
+ :'display_name' => :'displayName',
98
102
  :'uui' => :'uui',
99
103
  :'application_id' => :'applicationId',
100
104
  :'answer_url' => :'answerUrl',
@@ -125,6 +129,7 @@ module Bandwidth
125
129
  {
126
130
  :'to' => :'String',
127
131
  :'from' => :'String',
132
+ :'display_name' => :'String',
128
133
  :'uui' => :'String',
129
134
  :'application_id' => :'String',
130
135
  :'answer_url' => :'String',
@@ -148,6 +153,7 @@ module Bandwidth
148
153
  # List of attributes with nullable: true
149
154
  def self.openapi_nullable
150
155
  Set.new([
156
+ :'display_name',
151
157
  :'uui',
152
158
  :'answer_method',
153
159
  :'username',
@@ -182,10 +188,18 @@ module Bandwidth
182
188
 
183
189
  if attributes.key?(:'to')
184
190
  self.to = attributes[:'to']
191
+ else
192
+ self.to = nil
185
193
  end
186
194
 
187
195
  if attributes.key?(:'from')
188
196
  self.from = attributes[:'from']
197
+ else
198
+ self.from = nil
199
+ end
200
+
201
+ if attributes.key?(:'display_name')
202
+ self.display_name = attributes[:'display_name']
189
203
  end
190
204
 
191
205
  if attributes.key?(:'uui')
@@ -194,10 +208,14 @@ module Bandwidth
194
208
 
195
209
  if attributes.key?(:'application_id')
196
210
  self.application_id = attributes[:'application_id']
211
+ else
212
+ self.application_id = nil
197
213
  end
198
214
 
199
215
  if attributes.key?(:'answer_url')
200
216
  self.answer_url = attributes[:'answer_url']
217
+ else
218
+ self.answer_url = nil
201
219
  end
202
220
 
203
221
  if attributes.key?(:'answer_method')
@@ -272,6 +290,7 @@ module Bandwidth
272
290
  # Show invalid properties with the reasons. Usually used together with valid?
273
291
  # @return Array for valid properties with the reasons
274
292
  def list_invalid_properties
293
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
275
294
  invalid_properties = Array.new
276
295
  if @to.nil?
277
296
  invalid_properties.push('invalid value for "to", to cannot be nil.')
@@ -281,6 +300,10 @@ module Bandwidth
281
300
  invalid_properties.push('invalid value for "from", from cannot be nil.')
282
301
  end
283
302
 
303
+ if !@display_name.nil? && @display_name.to_s.length > 256
304
+ invalid_properties.push('invalid value for "display_name", the character length must be smaller than or equal to 256.')
305
+ end
306
+
284
307
  if @application_id.nil?
285
308
  invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
286
309
  end
@@ -351,8 +374,10 @@ module Bandwidth
351
374
  # Check to see if the all the properties in the model are valid
352
375
  # @return true if the model is valid
353
376
  def valid?
377
+ warn '[DEPRECATED] the `valid?` method is obsolete'
354
378
  return false if @to.nil?
355
379
  return false if @from.nil?
380
+ return false if !@display_name.nil? && @display_name.to_s.length > 256
356
381
  return false if @application_id.nil?
357
382
  return false if @answer_url.nil?
358
383
  return false if @answer_url.to_s.length > 2048
@@ -372,6 +397,16 @@ module Bandwidth
372
397
  true
373
398
  end
374
399
 
400
+ # Custom attribute writer method with validation
401
+ # @param [Object] display_name Value to be assigned
402
+ def display_name=(display_name)
403
+ if !display_name.nil? && display_name.to_s.length > 256
404
+ fail ArgumentError, 'invalid value for "display_name", the character length must be smaller than or equal to 256.'
405
+ end
406
+
407
+ @display_name = display_name
408
+ end
409
+
375
410
  # Custom attribute writer method with validation
376
411
  # @param [Object] answer_url Value to be assigned
377
412
  def answer_url=(answer_url)
@@ -505,6 +540,7 @@ module Bandwidth
505
540
  self.class == o.class &&
506
541
  to == o.to &&
507
542
  from == o.from &&
543
+ display_name == o.display_name &&
508
544
  uui == o.uui &&
509
545
  application_id == o.application_id &&
510
546
  answer_url == o.answer_url &&
@@ -533,44 +569,37 @@ module Bandwidth
533
569
  # Calculates hash code according to all attributes.
534
570
  # @return [Integer] Hash code
535
571
  def hash
536
- [to, from, uui, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash
572
+ [to, from, display_name, uui, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash
537
573
  end
538
574
 
539
575
  # Builds the object from hash
540
576
  # @param [Hash] attributes Model attributes in the form of hash
541
577
  # @return [Object] Returns the model itself
542
578
  def self.build_from_hash(attributes)
543
- new.build_from_hash(attributes)
544
- end
545
-
546
- # Builds the object from hash
547
- # @param [Hash] attributes Model attributes in the form of hash
548
- # @return [Object] Returns the model itself
549
- def build_from_hash(attributes)
550
579
  return nil unless attributes.is_a?(Hash)
551
580
  attributes = attributes.transform_keys(&:to_sym)
552
- self.class.openapi_types.each_pair do |key, type|
553
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
554
- self.send("#{key}=", nil)
581
+ transformed_hash = {}
582
+ openapi_types.each_pair do |key, type|
583
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
584
+ transformed_hash["#{key}"] = nil
555
585
  elsif type =~ /\AArray<(.*)>/i
556
586
  # check to ensure the input is an array given that the attribute
557
587
  # is documented as an array but the input is not
558
- if attributes[self.class.attribute_map[key]].is_a?(Array)
559
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
588
+ if attributes[attribute_map[key]].is_a?(Array)
589
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
560
590
  end
561
- elsif !attributes[self.class.attribute_map[key]].nil?
562
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
591
+ elsif !attributes[attribute_map[key]].nil?
592
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
563
593
  end
564
594
  end
565
-
566
- self
595
+ new(transformed_hash)
567
596
  end
568
597
 
569
598
  # Deserializes the data based on type
570
599
  # @param string type Data type
571
600
  # @param string value Value to be deserialized
572
601
  # @return [Object] Deserialized data
573
- def _deserialize(type, value)
602
+ def self._deserialize(type, value)
574
603
  case type.to_sym
575
604
  when :Time
576
605
  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
 
@@ -191,22 +191,32 @@ module Bandwidth
191
191
 
192
192
  if attributes.key?(:'application_id')
193
193
  self.application_id = attributes[:'application_id']
194
+ else
195
+ self.application_id = nil
194
196
  end
195
197
 
196
198
  if attributes.key?(:'account_id')
197
199
  self.account_id = attributes[:'account_id']
200
+ else
201
+ self.account_id = nil
198
202
  end
199
203
 
200
204
  if attributes.key?(:'call_id')
201
205
  self.call_id = attributes[:'call_id']
206
+ else
207
+ self.call_id = nil
202
208
  end
203
209
 
204
210
  if attributes.key?(:'to')
205
211
  self.to = attributes[:'to']
212
+ else
213
+ self.to = nil
206
214
  end
207
215
 
208
216
  if attributes.key?(:'from')
209
217
  self.from = attributes[:'from']
218
+ else
219
+ self.from = nil
210
220
  end
211
221
 
212
222
  if attributes.key?(:'enqueued_time')
@@ -215,6 +225,8 @@ module Bandwidth
215
225
 
216
226
  if attributes.key?(:'call_url')
217
227
  self.call_url = attributes[:'call_url']
228
+ else
229
+ self.call_url = nil
218
230
  end
219
231
 
220
232
  if attributes.key?(:'call_timeout')
@@ -237,6 +249,8 @@ module Bandwidth
237
249
 
238
250
  if attributes.key?(:'answer_url')
239
251
  self.answer_url = attributes[:'answer_url']
252
+ else
253
+ self.answer_url = nil
240
254
  end
241
255
 
242
256
  if attributes.key?(:'answer_fallback_method')
@@ -283,6 +297,7 @@ module Bandwidth
283
297
  # Show invalid properties with the reasons. Usually used together with valid?
284
298
  # @return Array for valid properties with the reasons
285
299
  def list_invalid_properties
300
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
286
301
  invalid_properties = Array.new
287
302
  if @application_id.nil?
288
303
  invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
@@ -334,6 +349,7 @@ module Bandwidth
334
349
  # Check to see if the all the properties in the model are valid
335
350
  # @return true if the model is valid
336
351
  def valid?
352
+ warn '[DEPRECATED] the `valid?` method is obsolete'
337
353
  return false if @application_id.nil?
338
354
  return false if @account_id.nil?
339
355
  return false if @call_id.nil?
@@ -432,37 +448,30 @@ module Bandwidth
432
448
  # @param [Hash] attributes Model attributes in the form of hash
433
449
  # @return [Object] Returns the model itself
434
450
  def self.build_from_hash(attributes)
435
- new.build_from_hash(attributes)
436
- end
437
-
438
- # Builds the object from hash
439
- # @param [Hash] attributes Model attributes in the form of hash
440
- # @return [Object] Returns the model itself
441
- def build_from_hash(attributes)
442
451
  return nil unless attributes.is_a?(Hash)
443
452
  attributes = attributes.transform_keys(&:to_sym)
444
- self.class.openapi_types.each_pair do |key, type|
445
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
446
- self.send("#{key}=", nil)
453
+ transformed_hash = {}
454
+ openapi_types.each_pair do |key, type|
455
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
456
+ transformed_hash["#{key}"] = nil
447
457
  elsif type =~ /\AArray<(.*)>/i
448
458
  # check to ensure the input is an array given that the attribute
449
459
  # is documented as an array but the input is not
450
- if attributes[self.class.attribute_map[key]].is_a?(Array)
451
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
460
+ if attributes[attribute_map[key]].is_a?(Array)
461
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
452
462
  end
453
- elsif !attributes[self.class.attribute_map[key]].nil?
454
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
463
+ elsif !attributes[attribute_map[key]].nil?
464
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
455
465
  end
456
466
  end
457
-
458
- self
467
+ new(transformed_hash)
459
468
  end
460
469
 
461
470
  # Deserializes the data based on type
462
471
  # @param string type Data type
463
472
  # @param string value Value to be deserialized
464
473
  # @return [Object] Deserialized data
465
- def _deserialize(type, value)
474
+ def self._deserialize(type, value)
466
475
  case type.to_sym
467
476
  when :Time
468
477
  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
 
@@ -97,6 +97,7 @@ module Bandwidth
97
97
  # Show invalid properties with the reasons. Usually used together with valid?
98
98
  # @return Array for valid properties with the reasons
99
99
  def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
101
  invalid_properties = Array.new
101
102
  invalid_properties
102
103
  end
@@ -104,6 +105,7 @@ module Bandwidth
104
105
  # Check to see if the all the properties in the model are valid
105
106
  # @return true if the model is valid
106
107
  def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
109
  true
108
110
  end
109
111
 
@@ -132,37 +134,30 @@ module Bandwidth
132
134
  # @param [Hash] attributes Model attributes in the form of hash
133
135
  # @return [Object] Returns the model itself
134
136
  def self.build_from_hash(attributes)
135
- new.build_from_hash(attributes)
136
- end
137
-
138
- # Builds the object from hash
139
- # @param [Hash] attributes Model attributes in the form of hash
140
- # @return [Object] Returns the model itself
141
- def build_from_hash(attributes)
142
137
  return nil unless attributes.is_a?(Hash)
143
138
  attributes = attributes.transform_keys(&:to_sym)
144
- self.class.openapi_types.each_pair do |key, type|
145
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
146
- self.send("#{key}=", nil)
139
+ transformed_hash = {}
140
+ openapi_types.each_pair do |key, type|
141
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = nil
147
143
  elsif type =~ /\AArray<(.*)>/i
148
144
  # check to ensure the input is an array given that the attribute
149
145
  # is documented as an array but the input is not
150
- if attributes[self.class.attribute_map[key]].is_a?(Array)
151
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
146
+ if attributes[attribute_map[key]].is_a?(Array)
147
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
152
148
  end
153
- elsif !attributes[self.class.attribute_map[key]].nil?
154
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ elsif !attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
155
151
  end
156
152
  end
157
-
158
- self
153
+ new(transformed_hash)
159
154
  end
160
155
 
161
156
  # Deserializes the data based on type
162
157
  # @param string type Data type
163
158
  # @param string value Value to be deserialized
164
159
  # @return [Object] Deserialized data
165
- def _deserialize(type, value)
160
+ def self._deserialize(type, value)
166
161
  case type.to_sym
167
162
  when :Time
168
163
  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
 
@@ -67,10 +67,14 @@ module Bandwidth
67
67
 
68
68
  if attributes.key?(:'type')
69
69
  self.type = attributes[:'type']
70
+ else
71
+ self.type = nil
70
72
  end
71
73
 
72
74
  if attributes.key?(:'description')
73
75
  self.description = attributes[:'description']
76
+ else
77
+ self.description = nil
74
78
  end
75
79
 
76
80
  if attributes.key?(:'field_errors')
@@ -83,6 +87,7 @@ module Bandwidth
83
87
  # Show invalid properties with the reasons. Usually used together with valid?
84
88
  # @return Array for valid properties with the reasons
85
89
  def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
91
  invalid_properties = Array.new
87
92
  if @type.nil?
88
93
  invalid_properties.push('invalid value for "type", type cannot be nil.')
@@ -98,6 +103,7 @@ module Bandwidth
98
103
  # Check to see if the all the properties in the model are valid
99
104
  # @return true if the model is valid
100
105
  def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
107
  return false if @type.nil?
102
108
  return false if @description.nil?
103
109
  true
@@ -129,37 +135,30 @@ module Bandwidth
129
135
  # @param [Hash] attributes Model attributes in the form of hash
130
136
  # @return [Object] Returns the model itself
131
137
  def self.build_from_hash(attributes)
132
- new.build_from_hash(attributes)
133
- end
134
-
135
- # Builds the object from hash
136
- # @param [Hash] attributes Model attributes in the form of hash
137
- # @return [Object] Returns the model itself
138
- def build_from_hash(attributes)
139
138
  return nil unless attributes.is_a?(Hash)
140
139
  attributes = attributes.transform_keys(&:to_sym)
141
- self.class.openapi_types.each_pair do |key, type|
142
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
143
- self.send("#{key}=", nil)
140
+ transformed_hash = {}
141
+ openapi_types.each_pair do |key, type|
142
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = nil
144
144
  elsif type =~ /\AArray<(.*)>/i
145
145
  # check to ensure the input is an array given that the attribute
146
146
  # is documented as an array but the input is not
147
- if attributes[self.class.attribute_map[key]].is_a?(Array)
148
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
147
+ if attributes[attribute_map[key]].is_a?(Array)
148
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
149
  end
150
- elsif !attributes[self.class.attribute_map[key]].nil?
151
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
+ elsif !attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
152
  end
153
153
  end
154
-
155
- self
154
+ new(transformed_hash)
156
155
  end
157
156
 
158
157
  # Deserializes the data based on type
159
158
  # @param string type Data type
160
159
  # @param string value Value to be deserialized
161
160
  # @return [Object] Deserialized data
162
- def _deserialize(type, value)
161
+ def self._deserialize(type, value)
163
162
  case type.to_sym
164
163
  when :Time
165
164
  Time.parse(value)