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
 
@@ -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,6 +76,7 @@ module Bandwidth
76
76
  # Show invalid properties with the reasons. Usually used together with valid?
77
77
  # @return Array for valid properties with the reasons
78
78
  def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
80
  invalid_properties = Array.new
80
81
  invalid_properties
81
82
  end
@@ -83,6 +84,7 @@ module Bandwidth
83
84
  # Check to see if the all the properties in the model are valid
84
85
  # @return true if the model is valid
85
86
  def valid?
87
+ warn '[DEPRECATED] the `valid?` method is obsolete'
86
88
  true
87
89
  end
88
90
 
@@ -111,37 +113,30 @@ module Bandwidth
111
113
  # @param [Hash] attributes Model attributes in the form of hash
112
114
  # @return [Object] Returns the model itself
113
115
  def self.build_from_hash(attributes)
114
- new.build_from_hash(attributes)
115
- end
116
-
117
- # Builds the object from hash
118
- # @param [Hash] attributes Model attributes in the form of hash
119
- # @return [Object] Returns the model itself
120
- def build_from_hash(attributes)
121
116
  return nil unless attributes.is_a?(Hash)
122
117
  attributes = attributes.transform_keys(&:to_sym)
123
- self.class.openapi_types.each_pair do |key, type|
124
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
125
- self.send("#{key}=", nil)
118
+ transformed_hash = {}
119
+ openapi_types.each_pair do |key, type|
120
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
121
+ transformed_hash["#{key}"] = nil
126
122
  elsif type =~ /\AArray<(.*)>/i
127
123
  # check to ensure the input is an array given that the attribute
128
124
  # is documented as an array but the input is not
129
- if attributes[self.class.attribute_map[key]].is_a?(Array)
130
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
125
+ if attributes[attribute_map[key]].is_a?(Array)
126
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
127
  end
132
- elsif !attributes[self.class.attribute_map[key]].nil?
133
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
+ elsif !attributes[attribute_map[key]].nil?
129
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
130
  end
135
131
  end
136
-
137
- self
132
+ new(transformed_hash)
138
133
  end
139
134
 
140
135
  # Deserializes the data based on type
141
136
  # @param string type Data type
142
137
  # @param string value Value to be deserialized
143
138
  # @return [Object] Deserialized data
144
- def _deserialize(type, value)
139
+ def self._deserialize(type, value)
145
140
  case type.to_sym
146
141
  when :Time
147
142
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -81,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
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
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,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
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
 
@@ -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)