bandwidth-sdk 17.0.1 → 17.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +18 -0
- data/bandwidth-sdk.gemspec +1 -2
- data/bandwidth.yml +7 -0
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +198 -387
- data/coverage/index.html +5842 -7703
- data/custom_templates/README.mustache +4 -1
- data/custom_templates/api_client.mustache +254 -0
- data/custom_templates/configuration.mustache +545 -0
- data/custom_templates/gem.mustache +2 -0
- data/docs/CallsApi.md +20 -5
- data/docs/ConferencesApi.md +36 -9
- data/docs/MFAApi.md +12 -3
- data/docs/MediaApi.md +16 -4
- data/docs/MessagesApi.md +8 -2
- data/docs/MultiChannelApi.md +4 -1
- data/docs/PhoneNumberLookupApi.md +12 -3
- data/docs/RecordingsApi.md +40 -10
- data/docs/StatisticsApi.md +4 -1
- data/docs/TollFreeVerificationApi.md +36 -9
- data/docs/TranscriptionsApi.md +12 -3
- data/lib/bandwidth-sdk/api/calls_api.rb +6 -6
- data/lib/bandwidth-sdk/api/conferences_api.rb +10 -10
- data/lib/bandwidth-sdk/api/media_api.rb +5 -5
- data/lib/bandwidth-sdk/api/messages_api.rb +3 -3
- data/lib/bandwidth-sdk/api/mfa_api.rb +4 -4
- data/lib/bandwidth-sdk/api/multi_channel_api.rb +2 -2
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +4 -4
- data/lib/bandwidth-sdk/api/recordings_api.rb +11 -11
- data/lib/bandwidth-sdk/api/statistics_api.rb +2 -2
- data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +13 -13
- data/lib/bandwidth-sdk/api/transcriptions_api.rb +4 -4
- data/lib/bandwidth-sdk/api_client.rb +9 -5
- data/lib/bandwidth-sdk/api_error.rb +1 -1
- data/lib/bandwidth-sdk/api_model_base.rb +88 -0
- data/lib/bandwidth-sdk/configuration.rb +50 -1
- data/lib/bandwidth-sdk/models/account_statistics.rb +11 -78
- data/lib/bandwidth-sdk/models/additional_denial_reason.rb +41 -78
- data/lib/bandwidth-sdk/models/address.rb +23 -90
- data/lib/bandwidth-sdk/models/answer_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/async_lookup_request.rb +11 -78
- data/lib/bandwidth-sdk/models/blocked_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/business_entity_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/business_registration_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/call_state.rb +11 -78
- data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_transcription.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_response.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_track_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/callback.rb +1 -1
- data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/card_width_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/code_request.rb +11 -78
- data/lib/bandwidth-sdk/models/completed_lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/conference.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/contact.rb +19 -86
- data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/create_call.rb +41 -78
- data/lib/bandwidth-sdk/models/create_call_response.rb +81 -78
- data/lib/bandwidth-sdk/models/create_message_request_error.rb +31 -78
- data/lib/bandwidth-sdk/models/create_multi_channel_message_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_sync_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_sync_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/deactivation_event_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/diversion.rb +11 -78
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/error.rb +11 -78
- data/lib/bandwidth-sdk/models/error_object.rb +41 -78
- data/lib/bandwidth-sdk/models/error_source.rb +11 -78
- data/lib/bandwidth-sdk/models/failure_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/field_error.rb +11 -78
- data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/gather_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/in_progress_lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/inbound_callback.rb +61 -78
- data/lib/bandwidth-sdk/models/inbound_callback_message.rb +81 -78
- data/lib/bandwidth-sdk/models/inbound_callback_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/initiate_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/latest_message_delivery_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/line_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/link.rb +11 -78
- data/lib/bandwidth-sdk/models/link_schema.rb +11 -78
- data/lib/bandwidth-sdk/models/links_object.rb +11 -78
- data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/list_message_item.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_response.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_schema.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_schema_meta.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_result.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_result.rb +11 -78
- data/lib/bandwidth-sdk/models/media.rb +11 -78
- data/lib/bandwidth-sdk/models/message.rb +11 -78
- data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_request.rb +31 -78
- 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 +11 -78
- data/lib/bandwidth-sdk/models/messaging_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/messaging_request_error.rb +31 -78
- data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mfa_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mms_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/mms_message_content_file.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_action.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +41 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_mms_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_mms_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_base.rb +41 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_owner_object.rb +21 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object_all_of_content.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_request_object.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_response_object.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_error.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_channel_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/multi_channel_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_request.rb +21 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +41 -78
- data/lib/bandwidth-sdk/models/opt_in_workflow.rb +25 -82
- data/lib/bandwidth-sdk/models/page_info.rb +11 -78
- data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/product_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_base.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_action_dial.rb +31 -78
- data/lib/bandwidth-sdk/models/rbm_action_open_url.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_action_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_view_location.rb +41 -78
- data/lib/bandwidth-sdk/models/rbm_card_content.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_card_content_media.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_location_response.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_media_height_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_message_carousel_card.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_message_content_file.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_message_content_rich_card.rb +3 -4
- data/lib/bandwidth-sdk/models/rbm_message_content_text.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_message_media.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_standalone_card.rb +41 -78
- data/lib/bandwidth-sdk/models/rbm_suggestion_response.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_transcriptions.rb +11 -78
- data/lib/bandwidth-sdk/models/redirect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/sms_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/standalone_card_orientation_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/status_callback.rb +61 -78
- data/lib/bandwidth-sdk/models/status_callback_message.rb +81 -78
- data/lib/bandwidth-sdk/models/status_callback_type_enum.rb +6 -6
- data/lib/bandwidth-sdk/models/stir_shaken.rb +11 -78
- data/lib/bandwidth-sdk/models/sync_lookup_request.rb +11 -78
- data/lib/bandwidth-sdk/models/telephone_number.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_basic_authentication.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_callback_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/tfv_error.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_status.rb +13 -80
- data/lib/bandwidth-sdk/models/tfv_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/tfv_submission_info.rb +21 -88
- data/lib/bandwidth-sdk/models/tfv_submission_wrapper.rb +11 -78
- data/lib/bandwidth-sdk/models/thumbnail_alignment_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/transcribe_recording.rb +11 -78
- data/lib/bandwidth-sdk/models/transcription.rb +11 -78
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/update_call.rb +11 -78
- data/lib/bandwidth-sdk/models/update_call_recording.rb +21 -78
- data/lib/bandwidth-sdk/models/update_conference.rb +11 -78
- data/lib/bandwidth-sdk/models/update_conference_member.rb +11 -78
- data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/verification_request.rb +51 -88
- data/lib/bandwidth-sdk/models/verification_update_request.rb +51 -88
- data/lib/bandwidth-sdk/models/verification_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/verify_code_request.rb +13 -80
- data/lib/bandwidth-sdk/models/verify_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/voice_api_error.rb +11 -78
- data/lib/bandwidth-sdk/models/voice_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/webhook_subscription.rb +13 -80
- data/lib/bandwidth-sdk/models/webhook_subscription_basic_authentication.rb +11 -78
- data/lib/bandwidth-sdk/models/webhook_subscription_request_schema.rb +15 -82
- data/lib/bandwidth-sdk/models/webhook_subscription_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +21 -78
- data/lib/bandwidth-sdk/version.rb +2 -2
- data/lib/bandwidth-sdk.rb +2 -1
- data/openapitools.json +1 -1
- data/spec/smoke/calls_api_spec.rb +50 -76
- data/spec/smoke/conferences_api_spec.rb +7 -5
- data/spec/smoke/media_api_spec.rb +4 -2
- data/spec/smoke/messages_api_spec.rb +9 -4
- data/spec/smoke/mfa_api_spec.rb +9 -4
- data/spec/smoke/multi_channel_api_spec.rb +4 -2
- data/spec/smoke/phone_number_lookup_api_spec.rb +6 -4
- data/spec/smoke/recordings_api_spec.rb +7 -33
- data/spec/smoke/statistics_api_spec.rb +16 -8
- data/spec/smoke/toll_free_verification_api_spec.rb +6 -4
- data/spec/smoke/transcriptions_api_spec.rb +7 -5
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/models/verify_code_request_spec.rb +1 -1
- metadata +5 -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
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.17.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
|
-
class Address
|
|
17
|
+
class Address < ApiModelBase
|
|
18
18
|
# The name of the business using the toll-free number.
|
|
19
19
|
attr_accessor :name
|
|
20
20
|
|
|
@@ -49,9 +49,14 @@ module Bandwidth
|
|
|
49
49
|
}
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
52
57
|
# Returns all the JSON keys this model knows about
|
|
53
58
|
def self.acceptable_attributes
|
|
54
|
-
|
|
59
|
+
acceptable_attribute_map.values
|
|
55
60
|
end
|
|
56
61
|
|
|
57
62
|
# Attribute type mapping.
|
|
@@ -82,9 +87,10 @@ module Bandwidth
|
|
|
82
87
|
end
|
|
83
88
|
|
|
84
89
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
90
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
91
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
-
if (!
|
|
87
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Address`. Please check the name to make sure it's valid. List of attributes: " +
|
|
92
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
93
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Address`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
94
|
end
|
|
89
95
|
h[k.to_sym] = v
|
|
90
96
|
}
|
|
@@ -144,7 +150,7 @@ module Bandwidth
|
|
|
144
150
|
end
|
|
145
151
|
|
|
146
152
|
if @name.to_s.length < 1
|
|
147
|
-
invalid_properties.push('invalid value for "name", the character length must be
|
|
153
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
148
154
|
end
|
|
149
155
|
|
|
150
156
|
if @addr1.nil?
|
|
@@ -156,7 +162,7 @@ module Bandwidth
|
|
|
156
162
|
end
|
|
157
163
|
|
|
158
164
|
if @addr1.to_s.length < 1
|
|
159
|
-
invalid_properties.push('invalid value for "addr1", the character length must be
|
|
165
|
+
invalid_properties.push('invalid value for "addr1", the character length must be greater than or equal to 1.')
|
|
160
166
|
end
|
|
161
167
|
|
|
162
168
|
if !@addr2.nil? && @addr2.to_s.length > 500
|
|
@@ -164,7 +170,7 @@ module Bandwidth
|
|
|
164
170
|
end
|
|
165
171
|
|
|
166
172
|
if !@addr2.nil? && @addr2.to_s.length < 0
|
|
167
|
-
invalid_properties.push('invalid value for "addr2", the character length must be
|
|
173
|
+
invalid_properties.push('invalid value for "addr2", the character length must be greater than or equal to 0.')
|
|
168
174
|
end
|
|
169
175
|
|
|
170
176
|
if @city.nil?
|
|
@@ -176,7 +182,7 @@ module Bandwidth
|
|
|
176
182
|
end
|
|
177
183
|
|
|
178
184
|
if @city.to_s.length < 1
|
|
179
|
-
invalid_properties.push('invalid value for "city", the character length must be
|
|
185
|
+
invalid_properties.push('invalid value for "city", the character length must be greater than or equal to 1.')
|
|
180
186
|
end
|
|
181
187
|
|
|
182
188
|
if @state.nil?
|
|
@@ -188,7 +194,7 @@ module Bandwidth
|
|
|
188
194
|
end
|
|
189
195
|
|
|
190
196
|
if @state.to_s.length < 1
|
|
191
|
-
invalid_properties.push('invalid value for "state", the character length must be
|
|
197
|
+
invalid_properties.push('invalid value for "state", the character length must be greater than or equal to 1.')
|
|
192
198
|
end
|
|
193
199
|
|
|
194
200
|
if @zip.nil?
|
|
@@ -209,7 +215,7 @@ module Bandwidth
|
|
|
209
215
|
end
|
|
210
216
|
|
|
211
217
|
if @url.to_s.length < 1
|
|
212
|
-
invalid_properties.push('invalid value for "url", the character length must be
|
|
218
|
+
invalid_properties.push('invalid value for "url", the character length must be greater than or equal to 1.')
|
|
213
219
|
end
|
|
214
220
|
|
|
215
221
|
invalid_properties
|
|
@@ -253,7 +259,7 @@ module Bandwidth
|
|
|
253
259
|
end
|
|
254
260
|
|
|
255
261
|
if name.to_s.length < 1
|
|
256
|
-
fail ArgumentError, 'invalid value for "name", the character length must be
|
|
262
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
257
263
|
end
|
|
258
264
|
|
|
259
265
|
@name = name
|
|
@@ -271,7 +277,7 @@ module Bandwidth
|
|
|
271
277
|
end
|
|
272
278
|
|
|
273
279
|
if addr1.to_s.length < 1
|
|
274
|
-
fail ArgumentError, 'invalid value for "addr1", the character length must be
|
|
280
|
+
fail ArgumentError, 'invalid value for "addr1", the character length must be greater than or equal to 1.'
|
|
275
281
|
end
|
|
276
282
|
|
|
277
283
|
@addr1 = addr1
|
|
@@ -285,7 +291,7 @@ module Bandwidth
|
|
|
285
291
|
end
|
|
286
292
|
|
|
287
293
|
if !addr2.nil? && addr2.to_s.length < 0
|
|
288
|
-
fail ArgumentError, 'invalid value for "addr2", the character length must be
|
|
294
|
+
fail ArgumentError, 'invalid value for "addr2", the character length must be greater than or equal to 0.'
|
|
289
295
|
end
|
|
290
296
|
|
|
291
297
|
@addr2 = addr2
|
|
@@ -303,7 +309,7 @@ module Bandwidth
|
|
|
303
309
|
end
|
|
304
310
|
|
|
305
311
|
if city.to_s.length < 1
|
|
306
|
-
fail ArgumentError, 'invalid value for "city", the character length must be
|
|
312
|
+
fail ArgumentError, 'invalid value for "city", the character length must be greater than or equal to 1.'
|
|
307
313
|
end
|
|
308
314
|
|
|
309
315
|
@city = city
|
|
@@ -321,7 +327,7 @@ module Bandwidth
|
|
|
321
327
|
end
|
|
322
328
|
|
|
323
329
|
if state.to_s.length < 1
|
|
324
|
-
fail ArgumentError, 'invalid value for "state", the character length must be
|
|
330
|
+
fail ArgumentError, 'invalid value for "state", the character length must be greater than or equal to 1.'
|
|
325
331
|
end
|
|
326
332
|
|
|
327
333
|
@state = state
|
|
@@ -354,7 +360,7 @@ module Bandwidth
|
|
|
354
360
|
end
|
|
355
361
|
|
|
356
362
|
if url.to_s.length < 1
|
|
357
|
-
fail ArgumentError, 'invalid value for "url", the character length must be
|
|
363
|
+
fail ArgumentError, 'invalid value for "url", the character length must be greater than or equal to 1.'
|
|
358
364
|
end
|
|
359
365
|
|
|
360
366
|
@url = url
|
|
@@ -409,61 +415,6 @@ module Bandwidth
|
|
|
409
415
|
new(transformed_hash)
|
|
410
416
|
end
|
|
411
417
|
|
|
412
|
-
# Deserializes the data based on type
|
|
413
|
-
# @param string type Data type
|
|
414
|
-
# @param string value Value to be deserialized
|
|
415
|
-
# @return [Object] Deserialized data
|
|
416
|
-
def self._deserialize(type, value)
|
|
417
|
-
case type.to_sym
|
|
418
|
-
when :Time
|
|
419
|
-
Time.parse(value)
|
|
420
|
-
when :Date
|
|
421
|
-
Date.parse(value)
|
|
422
|
-
when :String
|
|
423
|
-
value.to_s
|
|
424
|
-
when :Integer
|
|
425
|
-
value.to_i
|
|
426
|
-
when :Float
|
|
427
|
-
value.to_f
|
|
428
|
-
when :Boolean
|
|
429
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
430
|
-
true
|
|
431
|
-
else
|
|
432
|
-
false
|
|
433
|
-
end
|
|
434
|
-
when :Object
|
|
435
|
-
# generic object (usually a Hash), return directly
|
|
436
|
-
value
|
|
437
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
438
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
439
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
440
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
441
|
-
k_type = Regexp.last_match[:k_type]
|
|
442
|
-
v_type = Regexp.last_match[:v_type]
|
|
443
|
-
{}.tap do |hash|
|
|
444
|
-
value.each do |k, v|
|
|
445
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
446
|
-
end
|
|
447
|
-
end
|
|
448
|
-
else # model
|
|
449
|
-
# models (e.g. Pet) or oneOf
|
|
450
|
-
klass = Bandwidth.const_get(type)
|
|
451
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
452
|
-
end
|
|
453
|
-
end
|
|
454
|
-
|
|
455
|
-
# Returns the string representation of the object
|
|
456
|
-
# @return [String] String presentation of the object
|
|
457
|
-
def to_s
|
|
458
|
-
to_hash.to_s
|
|
459
|
-
end
|
|
460
|
-
|
|
461
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
462
|
-
# @return [Hash] Returns the object in the form of hash
|
|
463
|
-
def to_body
|
|
464
|
-
to_hash
|
|
465
|
-
end
|
|
466
|
-
|
|
467
418
|
# Returns the object in the form of hash
|
|
468
419
|
# @return [Hash] Returns the object in the form of hash
|
|
469
420
|
def to_hash
|
|
@@ -479,23 +430,5 @@ module Bandwidth
|
|
|
479
430
|
end
|
|
480
431
|
hash
|
|
481
432
|
end
|
|
482
|
-
|
|
483
|
-
# Outputs non-array value in the form of hash
|
|
484
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
485
|
-
# @param [Object] value Any valid value
|
|
486
|
-
# @return [Hash] Returns the value in the form of hash
|
|
487
|
-
def _to_hash(value)
|
|
488
|
-
if value.is_a?(Array)
|
|
489
|
-
value.compact.map { |v| _to_hash(v) }
|
|
490
|
-
elsif value.is_a?(Hash)
|
|
491
|
-
{}.tap do |hash|
|
|
492
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
493
|
-
end
|
|
494
|
-
elsif value.respond_to? :to_hash
|
|
495
|
-
value.to_hash
|
|
496
|
-
else
|
|
497
|
-
value
|
|
498
|
-
end
|
|
499
|
-
end
|
|
500
433
|
end
|
|
501
434
|
end
|
|
@@ -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
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.17.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
17
|
# The Answer event is sent to the answerUrl specified in the createCall request when an outbound call is answered.
|
|
18
|
-
class AnswerCallback
|
|
18
|
+
class AnswerCallback < ApiModelBase
|
|
19
19
|
# The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
|
|
20
20
|
attr_accessor :event_type
|
|
21
21
|
|
|
@@ -98,9 +98,14 @@ module Bandwidth
|
|
|
98
98
|
}
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
+
# Returns attribute mapping this model knows about
|
|
102
|
+
def self.acceptable_attribute_map
|
|
103
|
+
attribute_map
|
|
104
|
+
end
|
|
105
|
+
|
|
101
106
|
# Returns all the JSON keys this model knows about
|
|
102
107
|
def self.acceptable_attributes
|
|
103
|
-
|
|
108
|
+
acceptable_attribute_map.values
|
|
104
109
|
end
|
|
105
110
|
|
|
106
111
|
# Attribute type mapping.
|
|
@@ -141,9 +146,10 @@ module Bandwidth
|
|
|
141
146
|
end
|
|
142
147
|
|
|
143
148
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
149
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
144
150
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
145
|
-
if (!
|
|
146
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::AnswerCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
151
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
152
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::AnswerCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
147
153
|
end
|
|
148
154
|
h[k.to_sym] = v
|
|
149
155
|
}
|
|
@@ -276,61 +282,6 @@ module Bandwidth
|
|
|
276
282
|
new(transformed_hash)
|
|
277
283
|
end
|
|
278
284
|
|
|
279
|
-
# Deserializes the data based on type
|
|
280
|
-
# @param string type Data type
|
|
281
|
-
# @param string value Value to be deserialized
|
|
282
|
-
# @return [Object] Deserialized data
|
|
283
|
-
def self._deserialize(type, value)
|
|
284
|
-
case type.to_sym
|
|
285
|
-
when :Time
|
|
286
|
-
Time.parse(value)
|
|
287
|
-
when :Date
|
|
288
|
-
Date.parse(value)
|
|
289
|
-
when :String
|
|
290
|
-
value.to_s
|
|
291
|
-
when :Integer
|
|
292
|
-
value.to_i
|
|
293
|
-
when :Float
|
|
294
|
-
value.to_f
|
|
295
|
-
when :Boolean
|
|
296
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
297
|
-
true
|
|
298
|
-
else
|
|
299
|
-
false
|
|
300
|
-
end
|
|
301
|
-
when :Object
|
|
302
|
-
# generic object (usually a Hash), return directly
|
|
303
|
-
value
|
|
304
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
305
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
306
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
307
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
308
|
-
k_type = Regexp.last_match[:k_type]
|
|
309
|
-
v_type = Regexp.last_match[:v_type]
|
|
310
|
-
{}.tap do |hash|
|
|
311
|
-
value.each do |k, v|
|
|
312
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
313
|
-
end
|
|
314
|
-
end
|
|
315
|
-
else # model
|
|
316
|
-
# models (e.g. Pet) or oneOf
|
|
317
|
-
klass = Bandwidth.const_get(type)
|
|
318
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
319
|
-
end
|
|
320
|
-
end
|
|
321
|
-
|
|
322
|
-
# Returns the string representation of the object
|
|
323
|
-
# @return [String] String presentation of the object
|
|
324
|
-
def to_s
|
|
325
|
-
to_hash.to_s
|
|
326
|
-
end
|
|
327
|
-
|
|
328
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
329
|
-
# @return [Hash] Returns the object in the form of hash
|
|
330
|
-
def to_body
|
|
331
|
-
to_hash
|
|
332
|
-
end
|
|
333
|
-
|
|
334
285
|
# Returns the object in the form of hash
|
|
335
286
|
# @return [Hash] Returns the object in the form of hash
|
|
336
287
|
def to_hash
|
|
@@ -346,23 +297,5 @@ module Bandwidth
|
|
|
346
297
|
end
|
|
347
298
|
hash
|
|
348
299
|
end
|
|
349
|
-
|
|
350
|
-
# Outputs non-array value in the form of hash
|
|
351
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
352
|
-
# @param [Object] value Any valid value
|
|
353
|
-
# @return [Hash] Returns the value in the form of hash
|
|
354
|
-
def _to_hash(value)
|
|
355
|
-
if value.is_a?(Array)
|
|
356
|
-
value.compact.map { |v| _to_hash(v) }
|
|
357
|
-
elsif value.is_a?(Hash)
|
|
358
|
-
{}.tap do |hash|
|
|
359
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
360
|
-
end
|
|
361
|
-
elsif value.respond_to? :to_hash
|
|
362
|
-
value.to_hash
|
|
363
|
-
else
|
|
364
|
-
value
|
|
365
|
-
end
|
|
366
|
-
end
|
|
367
300
|
end
|
|
368
301
|
end
|
|
@@ -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
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.17.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
|
-
class AsyncLookupRequest
|
|
17
|
+
class AsyncLookupRequest < ApiModelBase
|
|
18
18
|
# Telephone numbers in E.164 format.
|
|
19
19
|
attr_accessor :phone_numbers
|
|
20
20
|
|
|
@@ -25,9 +25,14 @@ module Bandwidth
|
|
|
25
25
|
}
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
28
33
|
# Returns all the JSON keys this model knows about
|
|
29
34
|
def self.acceptable_attributes
|
|
30
|
-
|
|
35
|
+
acceptable_attribute_map.values
|
|
31
36
|
end
|
|
32
37
|
|
|
33
38
|
# Attribute type mapping.
|
|
@@ -51,9 +56,10 @@ module Bandwidth
|
|
|
51
56
|
end
|
|
52
57
|
|
|
53
58
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
54
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
-
if (!
|
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::AsyncLookupRequest`. Please check the name to make sure it's valid. List of attributes: " +
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::AsyncLookupRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
57
63
|
end
|
|
58
64
|
h[k.to_sym] = v
|
|
59
65
|
}
|
|
@@ -140,61 +146,6 @@ module Bandwidth
|
|
|
140
146
|
new(transformed_hash)
|
|
141
147
|
end
|
|
142
148
|
|
|
143
|
-
# Deserializes the data based on type
|
|
144
|
-
# @param string type Data type
|
|
145
|
-
# @param string value Value to be deserialized
|
|
146
|
-
# @return [Object] Deserialized data
|
|
147
|
-
def self._deserialize(type, value)
|
|
148
|
-
case type.to_sym
|
|
149
|
-
when :Time
|
|
150
|
-
Time.parse(value)
|
|
151
|
-
when :Date
|
|
152
|
-
Date.parse(value)
|
|
153
|
-
when :String
|
|
154
|
-
value.to_s
|
|
155
|
-
when :Integer
|
|
156
|
-
value.to_i
|
|
157
|
-
when :Float
|
|
158
|
-
value.to_f
|
|
159
|
-
when :Boolean
|
|
160
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
161
|
-
true
|
|
162
|
-
else
|
|
163
|
-
false
|
|
164
|
-
end
|
|
165
|
-
when :Object
|
|
166
|
-
# generic object (usually a Hash), return directly
|
|
167
|
-
value
|
|
168
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
169
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
170
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
171
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
172
|
-
k_type = Regexp.last_match[:k_type]
|
|
173
|
-
v_type = Regexp.last_match[:v_type]
|
|
174
|
-
{}.tap do |hash|
|
|
175
|
-
value.each do |k, v|
|
|
176
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
177
|
-
end
|
|
178
|
-
end
|
|
179
|
-
else # model
|
|
180
|
-
# models (e.g. Pet) or oneOf
|
|
181
|
-
klass = Bandwidth.const_get(type)
|
|
182
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
183
|
-
end
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
# Returns the string representation of the object
|
|
187
|
-
# @return [String] String presentation of the object
|
|
188
|
-
def to_s
|
|
189
|
-
to_hash.to_s
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
193
|
-
# @return [Hash] Returns the object in the form of hash
|
|
194
|
-
def to_body
|
|
195
|
-
to_hash
|
|
196
|
-
end
|
|
197
|
-
|
|
198
149
|
# Returns the object in the form of hash
|
|
199
150
|
# @return [Hash] Returns the object in the form of hash
|
|
200
151
|
def to_hash
|
|
@@ -210,23 +161,5 @@ module Bandwidth
|
|
|
210
161
|
end
|
|
211
162
|
hash
|
|
212
163
|
end
|
|
213
|
-
|
|
214
|
-
# Outputs non-array value in the form of hash
|
|
215
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
216
|
-
# @param [Object] value Any valid value
|
|
217
|
-
# @return [Hash] Returns the value in the form of hash
|
|
218
|
-
def _to_hash(value)
|
|
219
|
-
if value.is_a?(Array)
|
|
220
|
-
value.compact.map { |v| _to_hash(v) }
|
|
221
|
-
elsif value.is_a?(Hash)
|
|
222
|
-
{}.tap do |hash|
|
|
223
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
224
|
-
end
|
|
225
|
-
elsif value.respond_to? :to_hash
|
|
226
|
-
value.to_hash
|
|
227
|
-
else
|
|
228
|
-
value
|
|
229
|
-
end
|
|
230
|
-
end
|
|
231
164
|
end
|
|
232
165
|
end
|
|
@@ -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
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.17.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
|
-
class BlockedWebhook
|
|
17
|
+
class BlockedWebhook < ApiModelBase
|
|
18
18
|
# User's account ID.
|
|
19
19
|
attr_accessor :account_id
|
|
20
20
|
|
|
@@ -66,9 +66,14 @@ module Bandwidth
|
|
|
66
66
|
}
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
+
# Returns attribute mapping this model knows about
|
|
70
|
+
def self.acceptable_attribute_map
|
|
71
|
+
attribute_map
|
|
72
|
+
end
|
|
73
|
+
|
|
69
74
|
# Returns all the JSON keys this model knows about
|
|
70
75
|
def self.acceptable_attributes
|
|
71
|
-
|
|
76
|
+
acceptable_attribute_map.values
|
|
72
77
|
end
|
|
73
78
|
|
|
74
79
|
# Attribute type mapping.
|
|
@@ -97,9 +102,10 @@ module Bandwidth
|
|
|
97
102
|
end
|
|
98
103
|
|
|
99
104
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
105
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
100
106
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
101
|
-
if (!
|
|
102
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BlockedWebhook`. Please check the name to make sure it's valid. List of attributes: " +
|
|
107
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
108
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BlockedWebhook`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
103
109
|
end
|
|
104
110
|
h[k.to_sym] = v
|
|
105
111
|
}
|
|
@@ -139,7 +145,7 @@ module Bandwidth
|
|
|
139
145
|
end
|
|
140
146
|
|
|
141
147
|
if !@phone_number.nil? && @phone_number.to_s.length < 12
|
|
142
|
-
invalid_properties.push('invalid value for "phone_number", the character length must be
|
|
148
|
+
invalid_properties.push('invalid value for "phone_number", the character length must be greater than or equal to 12.')
|
|
143
149
|
end
|
|
144
150
|
|
|
145
151
|
pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
|
|
@@ -172,7 +178,7 @@ module Bandwidth
|
|
|
172
178
|
end
|
|
173
179
|
|
|
174
180
|
if phone_number.to_s.length < 12
|
|
175
|
-
fail ArgumentError, 'invalid value for "phone_number", the character length must be
|
|
181
|
+
fail ArgumentError, 'invalid value for "phone_number", the character length must be greater than or equal to 12.'
|
|
176
182
|
end
|
|
177
183
|
|
|
178
184
|
pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
|
|
@@ -231,61 +237,6 @@ module Bandwidth
|
|
|
231
237
|
new(transformed_hash)
|
|
232
238
|
end
|
|
233
239
|
|
|
234
|
-
# Deserializes the data based on type
|
|
235
|
-
# @param string type Data type
|
|
236
|
-
# @param string value Value to be deserialized
|
|
237
|
-
# @return [Object] Deserialized data
|
|
238
|
-
def self._deserialize(type, value)
|
|
239
|
-
case type.to_sym
|
|
240
|
-
when :Time
|
|
241
|
-
Time.parse(value)
|
|
242
|
-
when :Date
|
|
243
|
-
Date.parse(value)
|
|
244
|
-
when :String
|
|
245
|
-
value.to_s
|
|
246
|
-
when :Integer
|
|
247
|
-
value.to_i
|
|
248
|
-
when :Float
|
|
249
|
-
value.to_f
|
|
250
|
-
when :Boolean
|
|
251
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
252
|
-
true
|
|
253
|
-
else
|
|
254
|
-
false
|
|
255
|
-
end
|
|
256
|
-
when :Object
|
|
257
|
-
# generic object (usually a Hash), return directly
|
|
258
|
-
value
|
|
259
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
260
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
261
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
262
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
263
|
-
k_type = Regexp.last_match[:k_type]
|
|
264
|
-
v_type = Regexp.last_match[:v_type]
|
|
265
|
-
{}.tap do |hash|
|
|
266
|
-
value.each do |k, v|
|
|
267
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
268
|
-
end
|
|
269
|
-
end
|
|
270
|
-
else # model
|
|
271
|
-
# models (e.g. Pet) or oneOf
|
|
272
|
-
klass = Bandwidth.const_get(type)
|
|
273
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
274
|
-
end
|
|
275
|
-
end
|
|
276
|
-
|
|
277
|
-
# Returns the string representation of the object
|
|
278
|
-
# @return [String] String presentation of the object
|
|
279
|
-
def to_s
|
|
280
|
-
to_hash.to_s
|
|
281
|
-
end
|
|
282
|
-
|
|
283
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
284
|
-
# @return [Hash] Returns the object in the form of hash
|
|
285
|
-
def to_body
|
|
286
|
-
to_hash
|
|
287
|
-
end
|
|
288
|
-
|
|
289
240
|
# Returns the object in the form of hash
|
|
290
241
|
# @return [Hash] Returns the object in the form of hash
|
|
291
242
|
def to_hash
|
|
@@ -301,23 +252,5 @@ module Bandwidth
|
|
|
301
252
|
end
|
|
302
253
|
hash
|
|
303
254
|
end
|
|
304
|
-
|
|
305
|
-
# Outputs non-array value in the form of hash
|
|
306
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
307
|
-
# @param [Object] value Any valid value
|
|
308
|
-
# @return [Hash] Returns the value in the form of hash
|
|
309
|
-
def _to_hash(value)
|
|
310
|
-
if value.is_a?(Array)
|
|
311
|
-
value.compact.map { |v| _to_hash(v) }
|
|
312
|
-
elsif value.is_a?(Hash)
|
|
313
|
-
{}.tap do |hash|
|
|
314
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
315
|
-
end
|
|
316
|
-
elsif value.respond_to? :to_hash
|
|
317
|
-
value.to_hash
|
|
318
|
-
else
|
|
319
|
-
value
|
|
320
|
-
end
|
|
321
|
-
end
|
|
322
255
|
end
|
|
323
256
|
end
|