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
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
17
|
# If the target call leaves the <Bridge>, then this callback is sent to the bridgeCompleteUrl, and the BXML returned in it is executed on the call. If this webhook is sent, the Bridge Target Complete webhook is NOT sent. This callback is also sent if any problem occurs that prevents the calls to be bridged.
|
|
18
|
-
class BridgeCompleteCallback
|
|
18
|
+
class BridgeCompleteCallback < 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
|
|
|
@@ -107,9 +107,14 @@ module Bandwidth
|
|
|
107
107
|
}
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
+
# Returns attribute mapping this model knows about
|
|
111
|
+
def self.acceptable_attribute_map
|
|
112
|
+
attribute_map
|
|
113
|
+
end
|
|
114
|
+
|
|
110
115
|
# Returns all the JSON keys this model knows about
|
|
111
116
|
def self.acceptable_attributes
|
|
112
|
-
|
|
117
|
+
acceptable_attribute_map.values
|
|
113
118
|
end
|
|
114
119
|
|
|
115
120
|
# Attribute type mapping.
|
|
@@ -153,9 +158,10 @@ module Bandwidth
|
|
|
153
158
|
end
|
|
154
159
|
|
|
155
160
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
161
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
156
162
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
157
|
-
if (!
|
|
158
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BridgeCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
163
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
164
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BridgeCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
159
165
|
end
|
|
160
166
|
h[k.to_sym] = v
|
|
161
167
|
}
|
|
@@ -298,61 +304,6 @@ module Bandwidth
|
|
|
298
304
|
new(transformed_hash)
|
|
299
305
|
end
|
|
300
306
|
|
|
301
|
-
# Deserializes the data based on type
|
|
302
|
-
# @param string type Data type
|
|
303
|
-
# @param string value Value to be deserialized
|
|
304
|
-
# @return [Object] Deserialized data
|
|
305
|
-
def self._deserialize(type, value)
|
|
306
|
-
case type.to_sym
|
|
307
|
-
when :Time
|
|
308
|
-
Time.parse(value)
|
|
309
|
-
when :Date
|
|
310
|
-
Date.parse(value)
|
|
311
|
-
when :String
|
|
312
|
-
value.to_s
|
|
313
|
-
when :Integer
|
|
314
|
-
value.to_i
|
|
315
|
-
when :Float
|
|
316
|
-
value.to_f
|
|
317
|
-
when :Boolean
|
|
318
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
319
|
-
true
|
|
320
|
-
else
|
|
321
|
-
false
|
|
322
|
-
end
|
|
323
|
-
when :Object
|
|
324
|
-
# generic object (usually a Hash), return directly
|
|
325
|
-
value
|
|
326
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
327
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
328
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
329
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
330
|
-
k_type = Regexp.last_match[:k_type]
|
|
331
|
-
v_type = Regexp.last_match[:v_type]
|
|
332
|
-
{}.tap do |hash|
|
|
333
|
-
value.each do |k, v|
|
|
334
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
335
|
-
end
|
|
336
|
-
end
|
|
337
|
-
else # model
|
|
338
|
-
# models (e.g. Pet) or oneOf
|
|
339
|
-
klass = Bandwidth.const_get(type)
|
|
340
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
341
|
-
end
|
|
342
|
-
end
|
|
343
|
-
|
|
344
|
-
# Returns the string representation of the object
|
|
345
|
-
# @return [String] String presentation of the object
|
|
346
|
-
def to_s
|
|
347
|
-
to_hash.to_s
|
|
348
|
-
end
|
|
349
|
-
|
|
350
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
351
|
-
# @return [Hash] Returns the object in the form of hash
|
|
352
|
-
def to_body
|
|
353
|
-
to_hash
|
|
354
|
-
end
|
|
355
|
-
|
|
356
307
|
# Returns the object in the form of hash
|
|
357
308
|
# @return [Hash] Returns the object in the form of hash
|
|
358
309
|
def to_hash
|
|
@@ -368,23 +319,5 @@ module Bandwidth
|
|
|
368
319
|
end
|
|
369
320
|
hash
|
|
370
321
|
end
|
|
371
|
-
|
|
372
|
-
# Outputs non-array value in the form of hash
|
|
373
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
374
|
-
# @param [Object] value Any valid value
|
|
375
|
-
# @return [Hash] Returns the value in the form of hash
|
|
376
|
-
def _to_hash(value)
|
|
377
|
-
if value.is_a?(Array)
|
|
378
|
-
value.compact.map { |v| _to_hash(v) }
|
|
379
|
-
elsif value.is_a?(Hash)
|
|
380
|
-
{}.tap do |hash|
|
|
381
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
382
|
-
end
|
|
383
|
-
elsif value.respond_to? :to_hash
|
|
384
|
-
value.to_hash
|
|
385
|
-
else
|
|
386
|
-
value
|
|
387
|
-
end
|
|
388
|
-
end
|
|
389
322
|
end
|
|
390
323
|
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
|
# If the originating call leaves the <Bridge>, then this callback is sent to the bridgeTargetCompleteUrl, and the BXML returned in it is executed on the target call. If this webhook is sent, the Bridge Complete webhook is NOT sent.
|
|
18
|
-
class BridgeTargetCompleteCallback
|
|
18
|
+
class BridgeTargetCompleteCallback < 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
|
|
|
@@ -95,9 +95,14 @@ module Bandwidth
|
|
|
95
95
|
}
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
+
# Returns attribute mapping this model knows about
|
|
99
|
+
def self.acceptable_attribute_map
|
|
100
|
+
attribute_map
|
|
101
|
+
end
|
|
102
|
+
|
|
98
103
|
# Returns all the JSON keys this model knows about
|
|
99
104
|
def self.acceptable_attributes
|
|
100
|
-
|
|
105
|
+
acceptable_attribute_map.values
|
|
101
106
|
end
|
|
102
107
|
|
|
103
108
|
# Attribute type mapping.
|
|
@@ -136,9 +141,10 @@ module Bandwidth
|
|
|
136
141
|
end
|
|
137
142
|
|
|
138
143
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
144
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
139
145
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
140
|
-
if (!
|
|
141
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BridgeTargetCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
146
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
147
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BridgeTargetCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
142
148
|
end
|
|
143
149
|
h[k.to_sym] = v
|
|
144
150
|
}
|
|
@@ -266,61 +272,6 @@ module Bandwidth
|
|
|
266
272
|
new(transformed_hash)
|
|
267
273
|
end
|
|
268
274
|
|
|
269
|
-
# Deserializes the data based on type
|
|
270
|
-
# @param string type Data type
|
|
271
|
-
# @param string value Value to be deserialized
|
|
272
|
-
# @return [Object] Deserialized data
|
|
273
|
-
def self._deserialize(type, value)
|
|
274
|
-
case type.to_sym
|
|
275
|
-
when :Time
|
|
276
|
-
Time.parse(value)
|
|
277
|
-
when :Date
|
|
278
|
-
Date.parse(value)
|
|
279
|
-
when :String
|
|
280
|
-
value.to_s
|
|
281
|
-
when :Integer
|
|
282
|
-
value.to_i
|
|
283
|
-
when :Float
|
|
284
|
-
value.to_f
|
|
285
|
-
when :Boolean
|
|
286
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
287
|
-
true
|
|
288
|
-
else
|
|
289
|
-
false
|
|
290
|
-
end
|
|
291
|
-
when :Object
|
|
292
|
-
# generic object (usually a Hash), return directly
|
|
293
|
-
value
|
|
294
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
295
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
296
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
297
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
298
|
-
k_type = Regexp.last_match[:k_type]
|
|
299
|
-
v_type = Regexp.last_match[:v_type]
|
|
300
|
-
{}.tap do |hash|
|
|
301
|
-
value.each do |k, v|
|
|
302
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
303
|
-
end
|
|
304
|
-
end
|
|
305
|
-
else # model
|
|
306
|
-
# models (e.g. Pet) or oneOf
|
|
307
|
-
klass = Bandwidth.const_get(type)
|
|
308
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
309
|
-
end
|
|
310
|
-
end
|
|
311
|
-
|
|
312
|
-
# Returns the string representation of the object
|
|
313
|
-
# @return [String] String presentation of the object
|
|
314
|
-
def to_s
|
|
315
|
-
to_hash.to_s
|
|
316
|
-
end
|
|
317
|
-
|
|
318
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
319
|
-
# @return [Hash] Returns the object in the form of hash
|
|
320
|
-
def to_body
|
|
321
|
-
to_hash
|
|
322
|
-
end
|
|
323
|
-
|
|
324
275
|
# Returns the object in the form of hash
|
|
325
276
|
# @return [Hash] Returns the object in the form of hash
|
|
326
277
|
def to_hash
|
|
@@ -336,23 +287,5 @@ module Bandwidth
|
|
|
336
287
|
end
|
|
337
288
|
hash
|
|
338
289
|
end
|
|
339
|
-
|
|
340
|
-
# Outputs non-array value in the form of hash
|
|
341
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
342
|
-
# @param [Object] value Any valid value
|
|
343
|
-
# @return [Hash] Returns the value in the form of hash
|
|
344
|
-
def _to_hash(value)
|
|
345
|
-
if value.is_a?(Array)
|
|
346
|
-
value.compact.map { |v| _to_hash(v) }
|
|
347
|
-
elsif value.is_a?(Hash)
|
|
348
|
-
{}.tap do |hash|
|
|
349
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
350
|
-
end
|
|
351
|
-
elsif value.respond_to? :to_hash
|
|
352
|
-
value.to_hash
|
|
353
|
-
else
|
|
354
|
-
value
|
|
355
|
-
end
|
|
356
|
-
end
|
|
357
290
|
end
|
|
358
291
|
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 CallRecordingMetadata
|
|
17
|
+
class CallRecordingMetadata < ApiModelBase
|
|
18
18
|
# The id of the application associated with the call.
|
|
19
19
|
attr_accessor :application_id
|
|
20
20
|
|
|
@@ -116,9 +116,14 @@ module Bandwidth
|
|
|
116
116
|
}
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
+
# Returns attribute mapping this model knows about
|
|
120
|
+
def self.acceptable_attribute_map
|
|
121
|
+
attribute_map
|
|
122
|
+
end
|
|
123
|
+
|
|
119
124
|
# Returns all the JSON keys this model knows about
|
|
120
125
|
def self.acceptable_attributes
|
|
121
|
-
|
|
126
|
+
acceptable_attribute_map.values
|
|
122
127
|
end
|
|
123
128
|
|
|
124
129
|
# Attribute type mapping.
|
|
@@ -162,9 +167,10 @@ module Bandwidth
|
|
|
162
167
|
end
|
|
163
168
|
|
|
164
169
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
170
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
165
171
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
166
|
-
if (!
|
|
167
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallRecordingMetadata`. Please check the name to make sure it's valid. List of attributes: " +
|
|
172
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
173
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallRecordingMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
168
174
|
end
|
|
169
175
|
h[k.to_sym] = v
|
|
170
176
|
}
|
|
@@ -322,61 +328,6 @@ module Bandwidth
|
|
|
322
328
|
new(transformed_hash)
|
|
323
329
|
end
|
|
324
330
|
|
|
325
|
-
# Deserializes the data based on type
|
|
326
|
-
# @param string type Data type
|
|
327
|
-
# @param string value Value to be deserialized
|
|
328
|
-
# @return [Object] Deserialized data
|
|
329
|
-
def self._deserialize(type, value)
|
|
330
|
-
case type.to_sym
|
|
331
|
-
when :Time
|
|
332
|
-
Time.parse(value)
|
|
333
|
-
when :Date
|
|
334
|
-
Date.parse(value)
|
|
335
|
-
when :String
|
|
336
|
-
value.to_s
|
|
337
|
-
when :Integer
|
|
338
|
-
value.to_i
|
|
339
|
-
when :Float
|
|
340
|
-
value.to_f
|
|
341
|
-
when :Boolean
|
|
342
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
343
|
-
true
|
|
344
|
-
else
|
|
345
|
-
false
|
|
346
|
-
end
|
|
347
|
-
when :Object
|
|
348
|
-
# generic object (usually a Hash), return directly
|
|
349
|
-
value
|
|
350
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
351
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
352
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
353
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
354
|
-
k_type = Regexp.last_match[:k_type]
|
|
355
|
-
v_type = Regexp.last_match[:v_type]
|
|
356
|
-
{}.tap do |hash|
|
|
357
|
-
value.each do |k, v|
|
|
358
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
359
|
-
end
|
|
360
|
-
end
|
|
361
|
-
else # model
|
|
362
|
-
# models (e.g. Pet) or oneOf
|
|
363
|
-
klass = Bandwidth.const_get(type)
|
|
364
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
365
|
-
end
|
|
366
|
-
end
|
|
367
|
-
|
|
368
|
-
# Returns the string representation of the object
|
|
369
|
-
# @return [String] String presentation of the object
|
|
370
|
-
def to_s
|
|
371
|
-
to_hash.to_s
|
|
372
|
-
end
|
|
373
|
-
|
|
374
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
375
|
-
# @return [Hash] Returns the object in the form of hash
|
|
376
|
-
def to_body
|
|
377
|
-
to_hash
|
|
378
|
-
end
|
|
379
|
-
|
|
380
331
|
# Returns the object in the form of hash
|
|
381
332
|
# @return [Hash] Returns the object in the form of hash
|
|
382
333
|
def to_hash
|
|
@@ -392,23 +343,5 @@ module Bandwidth
|
|
|
392
343
|
end
|
|
393
344
|
hash
|
|
394
345
|
end
|
|
395
|
-
|
|
396
|
-
# Outputs non-array value in the form of hash
|
|
397
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
398
|
-
# @param [Object] value Any valid value
|
|
399
|
-
# @return [Hash] Returns the value in the form of hash
|
|
400
|
-
def _to_hash(value)
|
|
401
|
-
if value.is_a?(Array)
|
|
402
|
-
value.compact.map { |v| _to_hash(v) }
|
|
403
|
-
elsif value.is_a?(Hash)
|
|
404
|
-
{}.tap do |hash|
|
|
405
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
406
|
-
end
|
|
407
|
-
elsif value.respond_to? :to_hash
|
|
408
|
-
value.to_hash
|
|
409
|
-
else
|
|
410
|
-
value
|
|
411
|
-
end
|
|
412
|
-
end
|
|
413
346
|
end
|
|
414
347
|
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 CallState
|
|
17
|
+
class CallState < ApiModelBase
|
|
18
18
|
# The application id associated with the call.
|
|
19
19
|
attr_accessor :application_id
|
|
20
20
|
|
|
@@ -114,9 +114,14 @@ module Bandwidth
|
|
|
114
114
|
}
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
+
# Returns attribute mapping this model knows about
|
|
118
|
+
def self.acceptable_attribute_map
|
|
119
|
+
attribute_map
|
|
120
|
+
end
|
|
121
|
+
|
|
117
122
|
# Returns all the JSON keys this model knows about
|
|
118
123
|
def self.acceptable_attributes
|
|
119
|
-
|
|
124
|
+
acceptable_attribute_map.values
|
|
120
125
|
end
|
|
121
126
|
|
|
122
127
|
# Attribute type mapping.
|
|
@@ -167,9 +172,10 @@ module Bandwidth
|
|
|
167
172
|
end
|
|
168
173
|
|
|
169
174
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
175
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
170
176
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
171
|
-
if (!
|
|
172
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallState`. Please check the name to make sure it's valid. List of attributes: " +
|
|
177
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
178
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallState`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
173
179
|
end
|
|
174
180
|
h[k.to_sym] = v
|
|
175
181
|
}
|
|
@@ -324,61 +330,6 @@ module Bandwidth
|
|
|
324
330
|
new(transformed_hash)
|
|
325
331
|
end
|
|
326
332
|
|
|
327
|
-
# Deserializes the data based on type
|
|
328
|
-
# @param string type Data type
|
|
329
|
-
# @param string value Value to be deserialized
|
|
330
|
-
# @return [Object] Deserialized data
|
|
331
|
-
def self._deserialize(type, value)
|
|
332
|
-
case type.to_sym
|
|
333
|
-
when :Time
|
|
334
|
-
Time.parse(value)
|
|
335
|
-
when :Date
|
|
336
|
-
Date.parse(value)
|
|
337
|
-
when :String
|
|
338
|
-
value.to_s
|
|
339
|
-
when :Integer
|
|
340
|
-
value.to_i
|
|
341
|
-
when :Float
|
|
342
|
-
value.to_f
|
|
343
|
-
when :Boolean
|
|
344
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
345
|
-
true
|
|
346
|
-
else
|
|
347
|
-
false
|
|
348
|
-
end
|
|
349
|
-
when :Object
|
|
350
|
-
# generic object (usually a Hash), return directly
|
|
351
|
-
value
|
|
352
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
353
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
354
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
355
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
356
|
-
k_type = Regexp.last_match[:k_type]
|
|
357
|
-
v_type = Regexp.last_match[:v_type]
|
|
358
|
-
{}.tap do |hash|
|
|
359
|
-
value.each do |k, v|
|
|
360
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
361
|
-
end
|
|
362
|
-
end
|
|
363
|
-
else # model
|
|
364
|
-
# models (e.g. Pet) or oneOf
|
|
365
|
-
klass = Bandwidth.const_get(type)
|
|
366
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
367
|
-
end
|
|
368
|
-
end
|
|
369
|
-
|
|
370
|
-
# Returns the string representation of the object
|
|
371
|
-
# @return [String] String presentation of the object
|
|
372
|
-
def to_s
|
|
373
|
-
to_hash.to_s
|
|
374
|
-
end
|
|
375
|
-
|
|
376
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
377
|
-
# @return [Hash] Returns the object in the form of hash
|
|
378
|
-
def to_body
|
|
379
|
-
to_hash
|
|
380
|
-
end
|
|
381
|
-
|
|
382
333
|
# Returns the object in the form of hash
|
|
383
334
|
# @return [Hash] Returns the object in the form of hash
|
|
384
335
|
def to_hash
|
|
@@ -394,23 +345,5 @@ module Bandwidth
|
|
|
394
345
|
end
|
|
395
346
|
hash
|
|
396
347
|
end
|
|
397
|
-
|
|
398
|
-
# Outputs non-array value in the form of hash
|
|
399
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
400
|
-
# @param [Object] value Any valid value
|
|
401
|
-
# @return [Hash] Returns the value in the form of hash
|
|
402
|
-
def _to_hash(value)
|
|
403
|
-
if value.is_a?(Array)
|
|
404
|
-
value.compact.map { |v| _to_hash(v) }
|
|
405
|
-
elsif value.is_a?(Hash)
|
|
406
|
-
{}.tap do |hash|
|
|
407
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
408
|
-
end
|
|
409
|
-
elsif value.respond_to? :to_hash
|
|
410
|
-
value.to_hash
|
|
411
|
-
else
|
|
412
|
-
value
|
|
413
|
-
end
|
|
414
|
-
end
|
|
415
348
|
end
|
|
416
349
|
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 CallTranscription
|
|
17
|
+
class CallTranscription < ApiModelBase
|
|
18
18
|
attr_accessor :detected_language
|
|
19
19
|
|
|
20
20
|
attr_accessor :track
|
|
@@ -57,9 +57,14 @@ module Bandwidth
|
|
|
57
57
|
}
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
+
# Returns attribute mapping this model knows about
|
|
61
|
+
def self.acceptable_attribute_map
|
|
62
|
+
attribute_map
|
|
63
|
+
end
|
|
64
|
+
|
|
60
65
|
# Returns all the JSON keys this model knows about
|
|
61
66
|
def self.acceptable_attributes
|
|
62
|
-
|
|
67
|
+
acceptable_attribute_map.values
|
|
63
68
|
end
|
|
64
69
|
|
|
65
70
|
# Attribute type mapping.
|
|
@@ -86,9 +91,10 @@ module Bandwidth
|
|
|
86
91
|
end
|
|
87
92
|
|
|
88
93
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
94
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
89
95
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
90
|
-
if (!
|
|
91
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallTranscription`. Please check the name to make sure it's valid. List of attributes: " +
|
|
96
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
97
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallTranscription`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
92
98
|
end
|
|
93
99
|
h[k.to_sym] = v
|
|
94
100
|
}
|
|
@@ -199,61 +205,6 @@ module Bandwidth
|
|
|
199
205
|
new(transformed_hash)
|
|
200
206
|
end
|
|
201
207
|
|
|
202
|
-
# Deserializes the data based on type
|
|
203
|
-
# @param string type Data type
|
|
204
|
-
# @param string value Value to be deserialized
|
|
205
|
-
# @return [Object] Deserialized data
|
|
206
|
-
def self._deserialize(type, value)
|
|
207
|
-
case type.to_sym
|
|
208
|
-
when :Time
|
|
209
|
-
Time.parse(value)
|
|
210
|
-
when :Date
|
|
211
|
-
Date.parse(value)
|
|
212
|
-
when :String
|
|
213
|
-
value.to_s
|
|
214
|
-
when :Integer
|
|
215
|
-
value.to_i
|
|
216
|
-
when :Float
|
|
217
|
-
value.to_f
|
|
218
|
-
when :Boolean
|
|
219
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
220
|
-
true
|
|
221
|
-
else
|
|
222
|
-
false
|
|
223
|
-
end
|
|
224
|
-
when :Object
|
|
225
|
-
# generic object (usually a Hash), return directly
|
|
226
|
-
value
|
|
227
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
228
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
229
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
230
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
231
|
-
k_type = Regexp.last_match[:k_type]
|
|
232
|
-
v_type = Regexp.last_match[:v_type]
|
|
233
|
-
{}.tap do |hash|
|
|
234
|
-
value.each do |k, v|
|
|
235
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
236
|
-
end
|
|
237
|
-
end
|
|
238
|
-
else # model
|
|
239
|
-
# models (e.g. Pet) or oneOf
|
|
240
|
-
klass = Bandwidth.const_get(type)
|
|
241
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
242
|
-
end
|
|
243
|
-
end
|
|
244
|
-
|
|
245
|
-
# Returns the string representation of the object
|
|
246
|
-
# @return [String] String presentation of the object
|
|
247
|
-
def to_s
|
|
248
|
-
to_hash.to_s
|
|
249
|
-
end
|
|
250
|
-
|
|
251
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
252
|
-
# @return [Hash] Returns the object in the form of hash
|
|
253
|
-
def to_body
|
|
254
|
-
to_hash
|
|
255
|
-
end
|
|
256
|
-
|
|
257
208
|
# Returns the object in the form of hash
|
|
258
209
|
# @return [Hash] Returns the object in the form of hash
|
|
259
210
|
def to_hash
|
|
@@ -269,23 +220,5 @@ module Bandwidth
|
|
|
269
220
|
end
|
|
270
221
|
hash
|
|
271
222
|
end
|
|
272
|
-
|
|
273
|
-
# Outputs non-array value in the form of hash
|
|
274
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
275
|
-
# @param [Object] value Any valid value
|
|
276
|
-
# @return [Hash] Returns the value in the form of hash
|
|
277
|
-
def _to_hash(value)
|
|
278
|
-
if value.is_a?(Array)
|
|
279
|
-
value.compact.map { |v| _to_hash(v) }
|
|
280
|
-
elsif value.is_a?(Hash)
|
|
281
|
-
{}.tap do |hash|
|
|
282
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
283
|
-
end
|
|
284
|
-
elsif value.respond_to? :to_hash
|
|
285
|
-
value.to_hash
|
|
286
|
-
else
|
|
287
|
-
value
|
|
288
|
-
end
|
|
289
|
-
end
|
|
290
223
|
end
|
|
291
224
|
end
|