bandwidth-sdk 11.0.0.pre.beta.2.0 → 11.0.0.pre.beta.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bandwidth-sdk.gemspec +1 -1
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +262 -295
- data/coverage/index.html +2527 -2890
- data/lib/bandwidth-sdk/api/calls_api.rb +1 -1
- data/lib/bandwidth-sdk/api/conferences_api.rb +1 -1
- data/lib/bandwidth-sdk/api/media_api.rb +1 -1
- data/lib/bandwidth-sdk/api/messages_api.rb +1 -1
- data/lib/bandwidth-sdk/api/mfa_api.rb +1 -1
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +1 -1
- data/lib/bandwidth-sdk/api/recordings_api.rb +1 -1
- data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
- data/lib/bandwidth-sdk/api_client.rb +1 -1
- data/lib/bandwidth-sdk/api_error.rb +1 -1
- data/lib/bandwidth-sdk/configuration.rb +10 -8
- data/lib/bandwidth-sdk/models/account_statistics.rb +13 -18
- data/lib/bandwidth-sdk/models/answer_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +13 -18
- data/lib/bandwidth-sdk/models/call_state.rb +13 -18
- data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/code_request.rb +28 -19
- data/lib/bandwidth-sdk/models/conference.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_member.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/create_call.rb +21 -18
- data/lib/bandwidth-sdk/models/create_call_response.rb +27 -18
- data/lib/bandwidth-sdk/models/create_lookup_response.rb +13 -18
- data/lib/bandwidth-sdk/models/create_message_request_error.rb +17 -18
- data/lib/bandwidth-sdk/models/deferred_result.rb +13 -18
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/diversion.rb +13 -18
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/field_error.rb +13 -18
- data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/gather_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/inbound_message_callback.rb +23 -18
- data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +31 -18
- data/lib/bandwidth-sdk/models/initiate_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/list_message_item.rb +13 -18
- data/lib/bandwidth-sdk/models/lookup_request.rb +15 -18
- data/lib/bandwidth-sdk/models/lookup_result.rb +13 -18
- data/lib/bandwidth-sdk/models/lookup_status.rb +13 -18
- data/lib/bandwidth-sdk/models/lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +13 -18
- data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_result.rb +13 -18
- data/lib/bandwidth-sdk/models/media.rb +13 -18
- data/lib/bandwidth-sdk/models/message.rb +21 -18
- data/lib/bandwidth-sdk/models/message_delivered_callback.rb +23 -18
- data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +33 -18
- data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_failed_callback.rb +25 -18
- data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +35 -18
- data/lib/bandwidth-sdk/models/message_request.rb +24 -19
- data/lib/bandwidth-sdk/models/message_sending_callback.rb +23 -18
- data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +35 -18
- data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/messages_list.rb +13 -18
- data/lib/bandwidth-sdk/models/messaging_code_response.rb +13 -18
- data/lib/bandwidth-sdk/models/messaging_request_error.rb +17 -18
- data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/mfa_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/page_info.rb +13 -18
- data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/redirect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/stir_shaken.rb +13 -18
- data/lib/bandwidth-sdk/models/tag.rb +13 -18
- data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/transcribe_recording.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription_list.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription_metadata.rb +13 -18
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/update_call.rb +13 -18
- data/lib/bandwidth-sdk/models/update_call_recording.rb +15 -18
- data/lib/bandwidth-sdk/models/update_conference.rb +13 -18
- data/lib/bandwidth-sdk/models/update_conference_member.rb +13 -18
- data/lib/bandwidth-sdk/models/verify_code_request.rb +19 -18
- data/lib/bandwidth-sdk/models/verify_code_response.rb +13 -18
- data/lib/bandwidth-sdk/models/voice_api_error.rb +13 -18
- data/lib/bandwidth-sdk/models/voice_code_response.rb +13 -18
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +19 -7
- data/spec/models/call_state_spec.rb +0 -13
- data/spec/models/deferred_result_spec.rb +1 -14
- data/spec/models/message_spec.rb +10 -17
- data/spec/models/verify_code_request_spec.rb +7 -15
- metadata +2 -2
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: letstalk@bandwidth.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
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
|
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
|
-
|
248
|
-
|
249
|
-
|
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[
|
254
|
-
|
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[
|
257
|
-
|
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:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -76,28 +76,39 @@ module Bandwidth
|
|
76
76
|
|
77
77
|
if attributes.key?(:'time')
|
78
78
|
self.time = attributes[:'time']
|
79
|
+
else
|
80
|
+
self.time = nil
|
79
81
|
end
|
80
82
|
|
81
83
|
if attributes.key?(:'type')
|
82
84
|
self.type = attributes[:'type']
|
85
|
+
else
|
86
|
+
self.type = nil
|
83
87
|
end
|
84
88
|
|
85
89
|
if attributes.key?(:'to')
|
86
90
|
self.to = attributes[:'to']
|
91
|
+
else
|
92
|
+
self.to = nil
|
87
93
|
end
|
88
94
|
|
89
95
|
if attributes.key?(:'description')
|
90
96
|
self.description = attributes[:'description']
|
97
|
+
else
|
98
|
+
self.description = nil
|
91
99
|
end
|
92
100
|
|
93
101
|
if attributes.key?(:'message')
|
94
102
|
self.message = attributes[:'message']
|
103
|
+
else
|
104
|
+
self.message = nil
|
95
105
|
end
|
96
106
|
end
|
97
107
|
|
98
108
|
# Show invalid properties with the reasons. Usually used together with valid?
|
99
109
|
# @return Array for valid properties with the reasons
|
100
110
|
def list_invalid_properties
|
111
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
101
112
|
invalid_properties = Array.new
|
102
113
|
if @time.nil?
|
103
114
|
invalid_properties.push('invalid value for "time", time cannot be nil.')
|
@@ -125,6 +136,7 @@ module Bandwidth
|
|
125
136
|
# Check to see if the all the properties in the model are valid
|
126
137
|
# @return true if the model is valid
|
127
138
|
def valid?
|
139
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
128
140
|
return false if @time.nil?
|
129
141
|
return false if @type.nil?
|
130
142
|
return false if @to.nil?
|
@@ -161,37 +173,30 @@ module Bandwidth
|
|
161
173
|
# @param [Hash] attributes Model attributes in the form of hash
|
162
174
|
# @return [Object] Returns the model itself
|
163
175
|
def self.build_from_hash(attributes)
|
164
|
-
new.build_from_hash(attributes)
|
165
|
-
end
|
166
|
-
|
167
|
-
# Builds the object from hash
|
168
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
169
|
-
# @return [Object] Returns the model itself
|
170
|
-
def build_from_hash(attributes)
|
171
176
|
return nil unless attributes.is_a?(Hash)
|
172
177
|
attributes = attributes.transform_keys(&:to_sym)
|
173
|
-
|
174
|
-
|
175
|
-
|
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[
|
180
|
-
|
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[
|
183
|
-
|
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:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -126,40 +126,58 @@ module Bandwidth
|
|
126
126
|
|
127
127
|
if attributes.key?(:'id')
|
128
128
|
self.id = attributes[:'id']
|
129
|
+
else
|
130
|
+
self.id = nil
|
129
131
|
end
|
130
132
|
|
131
133
|
if attributes.key?(:'owner')
|
132
134
|
self.owner = attributes[:'owner']
|
135
|
+
else
|
136
|
+
self.owner = nil
|
133
137
|
end
|
134
138
|
|
135
139
|
if attributes.key?(:'application_id')
|
136
140
|
self.application_id = attributes[:'application_id']
|
141
|
+
else
|
142
|
+
self.application_id = nil
|
137
143
|
end
|
138
144
|
|
139
145
|
if attributes.key?(:'time')
|
140
146
|
self.time = attributes[:'time']
|
147
|
+
else
|
148
|
+
self.time = nil
|
141
149
|
end
|
142
150
|
|
143
151
|
if attributes.key?(:'segment_count')
|
144
152
|
self.segment_count = attributes[:'segment_count']
|
153
|
+
else
|
154
|
+
self.segment_count = nil
|
145
155
|
end
|
146
156
|
|
147
157
|
if attributes.key?(:'direction')
|
148
158
|
self.direction = attributes[:'direction']
|
159
|
+
else
|
160
|
+
self.direction = nil
|
149
161
|
end
|
150
162
|
|
151
163
|
if attributes.key?(:'to')
|
152
164
|
if (value = attributes[:'to']).is_a?(Array)
|
153
165
|
self.to = value
|
154
166
|
end
|
167
|
+
else
|
168
|
+
self.to = nil
|
155
169
|
end
|
156
170
|
|
157
171
|
if attributes.key?(:'from')
|
158
172
|
self.from = attributes[:'from']
|
173
|
+
else
|
174
|
+
self.from = nil
|
159
175
|
end
|
160
176
|
|
161
177
|
if attributes.key?(:'text')
|
162
178
|
self.text = attributes[:'text']
|
179
|
+
else
|
180
|
+
self.text = nil
|
163
181
|
end
|
164
182
|
|
165
183
|
if attributes.key?(:'tag')
|
@@ -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
|
-
|
303
|
-
|
304
|
-
|
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[
|
309
|
-
|
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[
|
312
|
-
|
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:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
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
|
-
|
133
|
-
|
134
|
-
|
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[
|
139
|
-
|
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[
|
142
|
-
|
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:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
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
|
-
|
113
|
-
|
114
|
-
|
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[
|
119
|
-
|
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[
|
122
|
-
|
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)
|
@@ -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:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -63,16 +63,21 @@ module Bandwidth
|
|
63
63
|
|
64
64
|
if attributes.key?(:'type')
|
65
65
|
self.type = attributes[:'type']
|
66
|
+
else
|
67
|
+
self.type = nil
|
66
68
|
end
|
67
69
|
|
68
70
|
if attributes.key?(:'description')
|
69
71
|
self.description = attributes[:'description']
|
72
|
+
else
|
73
|
+
self.description = nil
|
70
74
|
end
|
71
75
|
end
|
72
76
|
|
73
77
|
# Show invalid properties with the reasons. Usually used together with valid?
|
74
78
|
# @return Array for valid properties with the reasons
|
75
79
|
def list_invalid_properties
|
80
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
76
81
|
invalid_properties = Array.new
|
77
82
|
if @type.nil?
|
78
83
|
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
@@ -88,6 +93,7 @@ module Bandwidth
|
|
88
93
|
# Check to see if the all the properties in the model are valid
|
89
94
|
# @return true if the model is valid
|
90
95
|
def valid?
|
96
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
91
97
|
return false if @type.nil?
|
92
98
|
return false if @description.nil?
|
93
99
|
true
|
@@ -118,37 +124,30 @@ module Bandwidth
|
|
118
124
|
# @param [Hash] attributes Model attributes in the form of hash
|
119
125
|
# @return [Object] Returns the model itself
|
120
126
|
def self.build_from_hash(attributes)
|
121
|
-
new.build_from_hash(attributes)
|
122
|
-
end
|
123
|
-
|
124
|
-
# Builds the object from hash
|
125
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
126
|
-
# @return [Object] Returns the model itself
|
127
|
-
def build_from_hash(attributes)
|
128
127
|
return nil unless attributes.is_a?(Hash)
|
129
128
|
attributes = attributes.transform_keys(&:to_sym)
|
130
|
-
|
131
|
-
|
132
|
-
|
129
|
+
transformed_hash = {}
|
130
|
+
openapi_types.each_pair do |key, type|
|
131
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
132
|
+
transformed_hash["#{key}"] = nil
|
133
133
|
elsif type =~ /\AArray<(.*)>/i
|
134
134
|
# check to ensure the input is an array given that the attribute
|
135
135
|
# is documented as an array but the input is not
|
136
|
-
if attributes[
|
137
|
-
|
136
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
137
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
138
138
|
end
|
139
|
-
elsif !attributes[
|
140
|
-
|
139
|
+
elsif !attributes[attribute_map[key]].nil?
|
140
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
141
141
|
end
|
142
142
|
end
|
143
|
-
|
144
|
-
self
|
143
|
+
new(transformed_hash)
|
145
144
|
end
|
146
145
|
|
147
146
|
# Deserializes the data based on type
|
148
147
|
# @param string type Data type
|
149
148
|
# @param string value Value to be deserialized
|
150
149
|
# @return [Object] Deserialized data
|
151
|
-
def _deserialize(type, value)
|
150
|
+
def self._deserialize(type, value)
|
152
151
|
case type.to_sym
|
153
152
|
when :Time
|
154
153
|
Time.parse(value)
|