bandwidth-sdk 17.0.0 → 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 +4 -4
- data/README.md +29 -3
- data/bandwidth-sdk.gemspec +1 -2
- data/bandwidth.yml +85 -22
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +317 -487
- data/coverage/index.html +6317 -7908
- 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/MultiChannelAction.md +32 -81
- data/docs/MultiChannelApi.md +5 -2
- data/docs/{MultiChannelChannelListObject.md → MultiChannelChannelListMMSObject.md} +3 -3
- data/docs/{MultiChannelMessageResponseDataChannelListInner.md → MultiChannelChannelListMMSResponseObject.md} +3 -3
- data/docs/MultiChannelChannelListObjectBase.md +22 -0
- data/docs/MultiChannelChannelListOwnerObject.md +18 -0
- data/docs/MultiChannelChannelListRBMObject.md +24 -0
- data/docs/{MultiChannelChannelListObjectContent.md → MultiChannelChannelListRBMObjectAllOfContent.md} +6 -10
- data/docs/MultiChannelChannelListRBMResponseObject.md +26 -0
- data/docs/MultiChannelChannelListRequestObject.md +24 -0
- data/docs/MultiChannelChannelListResponseObject.md +26 -0
- data/docs/MultiChannelChannelListSMSObject.md +24 -0
- data/docs/MultiChannelChannelListSMSResponseObject.md +26 -0
- data/docs/MultiChannelMessageRequest.md +1 -1
- data/docs/MultiChannelMessageResponseData.md +1 -1
- data/docs/PhoneNumberLookupApi.md +12 -3
- data/docs/RbmActionBase.md +1 -1
- data/docs/RbmSuggestionResponse.md +1 -1
- 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 +71 -27
- data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +41 -78
- data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object.rb → multi_channel_channel_list_mms_object.rb} +60 -80
- data/lib/bandwidth-sdk/models/{multi_channel_message_response_data_channel_list_inner.rb → multi_channel_channel_list_mms_response_object.rb} +65 -81
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_base.rb +238 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_owner_object.rb +163 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object.rb +271 -0
- data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object_content.rb → multi_channel_channel_list_rbm_object_all_of_content.rb} +5 -8
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_response_object.rb +299 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_request_object.rb +103 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_response_object.rb +103 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_object.rb +271 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_response_object.rb +299 -0
- 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 +22 -79
- data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +42 -79
- 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 +13 -4
- 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 +128 -25
- data/spec/smoke/phone_number_lookup_api_spec.rb +7 -5
- 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/api/multi_channel_api_spec.rb +13 -2
- data/spec/unit/models/verify_code_request_spec.rb +1 -1
- metadata +27 -8
|
@@ -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 Recording Available event is sent after a recording has been processed. It indicates that the recording is available for download.
|
|
18
|
-
class RecordingAvailableCallback
|
|
18
|
+
class RecordingAvailableCallback < 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
|
|
|
@@ -130,9 +130,14 @@ module Bandwidth
|
|
|
130
130
|
}
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
+
# Returns attribute mapping this model knows about
|
|
134
|
+
def self.acceptable_attribute_map
|
|
135
|
+
attribute_map
|
|
136
|
+
end
|
|
137
|
+
|
|
133
138
|
# Returns all the JSON keys this model knows about
|
|
134
139
|
def self.acceptable_attributes
|
|
135
|
-
|
|
140
|
+
acceptable_attribute_map.values
|
|
136
141
|
end
|
|
137
142
|
|
|
138
143
|
# Attribute type mapping.
|
|
@@ -180,9 +185,10 @@ module Bandwidth
|
|
|
180
185
|
end
|
|
181
186
|
|
|
182
187
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
188
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
183
189
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
184
|
-
if (!
|
|
185
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingAvailableCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
190
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
191
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingAvailableCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
186
192
|
end
|
|
187
193
|
h[k.to_sym] = v
|
|
188
194
|
}
|
|
@@ -355,61 +361,6 @@ module Bandwidth
|
|
|
355
361
|
new(transformed_hash)
|
|
356
362
|
end
|
|
357
363
|
|
|
358
|
-
# Deserializes the data based on type
|
|
359
|
-
# @param string type Data type
|
|
360
|
-
# @param string value Value to be deserialized
|
|
361
|
-
# @return [Object] Deserialized data
|
|
362
|
-
def self._deserialize(type, value)
|
|
363
|
-
case type.to_sym
|
|
364
|
-
when :Time
|
|
365
|
-
Time.parse(value)
|
|
366
|
-
when :Date
|
|
367
|
-
Date.parse(value)
|
|
368
|
-
when :String
|
|
369
|
-
value.to_s
|
|
370
|
-
when :Integer
|
|
371
|
-
value.to_i
|
|
372
|
-
when :Float
|
|
373
|
-
value.to_f
|
|
374
|
-
when :Boolean
|
|
375
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
376
|
-
true
|
|
377
|
-
else
|
|
378
|
-
false
|
|
379
|
-
end
|
|
380
|
-
when :Object
|
|
381
|
-
# generic object (usually a Hash), return directly
|
|
382
|
-
value
|
|
383
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
384
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
385
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
386
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
387
|
-
k_type = Regexp.last_match[:k_type]
|
|
388
|
-
v_type = Regexp.last_match[:v_type]
|
|
389
|
-
{}.tap do |hash|
|
|
390
|
-
value.each do |k, v|
|
|
391
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
392
|
-
end
|
|
393
|
-
end
|
|
394
|
-
else # model
|
|
395
|
-
# models (e.g. Pet) or oneOf
|
|
396
|
-
klass = Bandwidth.const_get(type)
|
|
397
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
398
|
-
end
|
|
399
|
-
end
|
|
400
|
-
|
|
401
|
-
# Returns the string representation of the object
|
|
402
|
-
# @return [String] String presentation of the object
|
|
403
|
-
def to_s
|
|
404
|
-
to_hash.to_s
|
|
405
|
-
end
|
|
406
|
-
|
|
407
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
408
|
-
# @return [Hash] Returns the object in the form of hash
|
|
409
|
-
def to_body
|
|
410
|
-
to_hash
|
|
411
|
-
end
|
|
412
|
-
|
|
413
364
|
# Returns the object in the form of hash
|
|
414
365
|
# @return [Hash] Returns the object in the form of hash
|
|
415
366
|
def to_hash
|
|
@@ -425,23 +376,5 @@ module Bandwidth
|
|
|
425
376
|
end
|
|
426
377
|
hash
|
|
427
378
|
end
|
|
428
|
-
|
|
429
|
-
# Outputs non-array value in the form of hash
|
|
430
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
431
|
-
# @param [Object] value Any valid value
|
|
432
|
-
# @return [Hash] Returns the value in the form of hash
|
|
433
|
-
def _to_hash(value)
|
|
434
|
-
if value.is_a?(Array)
|
|
435
|
-
value.compact.map { |v| _to_hash(v) }
|
|
436
|
-
elsif value.is_a?(Hash)
|
|
437
|
-
{}.tap do |hash|
|
|
438
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
439
|
-
end
|
|
440
|
-
elsif value.respond_to? :to_hash
|
|
441
|
-
value.to_hash
|
|
442
|
-
else
|
|
443
|
-
value
|
|
444
|
-
end
|
|
445
|
-
end
|
|
446
379
|
end
|
|
447
380
|
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 Record Complete event is sent after a <Record> verb has executed if the call is still active. The BXML returned by this callback is executed next. When the recording is available for download, a Recording Available event will be sent.
|
|
18
|
-
class RecordingCompleteCallback
|
|
18
|
+
class RecordingCompleteCallback < 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
|
|
|
@@ -130,9 +130,14 @@ module Bandwidth
|
|
|
130
130
|
}
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
+
# Returns attribute mapping this model knows about
|
|
134
|
+
def self.acceptable_attribute_map
|
|
135
|
+
attribute_map
|
|
136
|
+
end
|
|
137
|
+
|
|
133
138
|
# Returns all the JSON keys this model knows about
|
|
134
139
|
def self.acceptable_attributes
|
|
135
|
-
|
|
140
|
+
acceptable_attribute_map.values
|
|
136
141
|
end
|
|
137
142
|
|
|
138
143
|
# Attribute type mapping.
|
|
@@ -181,9 +186,10 @@ module Bandwidth
|
|
|
181
186
|
end
|
|
182
187
|
|
|
183
188
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
189
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
184
190
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
185
|
-
if (!
|
|
186
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
191
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
192
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
187
193
|
end
|
|
188
194
|
h[k.to_sym] = v
|
|
189
195
|
}
|
|
@@ -356,61 +362,6 @@ module Bandwidth
|
|
|
356
362
|
new(transformed_hash)
|
|
357
363
|
end
|
|
358
364
|
|
|
359
|
-
# Deserializes the data based on type
|
|
360
|
-
# @param string type Data type
|
|
361
|
-
# @param string value Value to be deserialized
|
|
362
|
-
# @return [Object] Deserialized data
|
|
363
|
-
def self._deserialize(type, value)
|
|
364
|
-
case type.to_sym
|
|
365
|
-
when :Time
|
|
366
|
-
Time.parse(value)
|
|
367
|
-
when :Date
|
|
368
|
-
Date.parse(value)
|
|
369
|
-
when :String
|
|
370
|
-
value.to_s
|
|
371
|
-
when :Integer
|
|
372
|
-
value.to_i
|
|
373
|
-
when :Float
|
|
374
|
-
value.to_f
|
|
375
|
-
when :Boolean
|
|
376
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
377
|
-
true
|
|
378
|
-
else
|
|
379
|
-
false
|
|
380
|
-
end
|
|
381
|
-
when :Object
|
|
382
|
-
# generic object (usually a Hash), return directly
|
|
383
|
-
value
|
|
384
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
385
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
386
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
387
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
388
|
-
k_type = Regexp.last_match[:k_type]
|
|
389
|
-
v_type = Regexp.last_match[:v_type]
|
|
390
|
-
{}.tap do |hash|
|
|
391
|
-
value.each do |k, v|
|
|
392
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
393
|
-
end
|
|
394
|
-
end
|
|
395
|
-
else # model
|
|
396
|
-
# models (e.g. Pet) or oneOf
|
|
397
|
-
klass = Bandwidth.const_get(type)
|
|
398
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
399
|
-
end
|
|
400
|
-
end
|
|
401
|
-
|
|
402
|
-
# Returns the string representation of the object
|
|
403
|
-
# @return [String] String presentation of the object
|
|
404
|
-
def to_s
|
|
405
|
-
to_hash.to_s
|
|
406
|
-
end
|
|
407
|
-
|
|
408
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
409
|
-
# @return [Hash] Returns the object in the form of hash
|
|
410
|
-
def to_body
|
|
411
|
-
to_hash
|
|
412
|
-
end
|
|
413
|
-
|
|
414
365
|
# Returns the object in the form of hash
|
|
415
366
|
# @return [Hash] Returns the object in the form of hash
|
|
416
367
|
def to_hash
|
|
@@ -426,23 +377,5 @@ module Bandwidth
|
|
|
426
377
|
end
|
|
427
378
|
hash
|
|
428
379
|
end
|
|
429
|
-
|
|
430
|
-
# Outputs non-array value in the form of hash
|
|
431
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
432
|
-
# @param [Object] value Any valid value
|
|
433
|
-
# @return [Hash] Returns the value in the form of hash
|
|
434
|
-
def _to_hash(value)
|
|
435
|
-
if value.is_a?(Array)
|
|
436
|
-
value.compact.map { |v| _to_hash(v) }
|
|
437
|
-
elsif value.is_a?(Hash)
|
|
438
|
-
{}.tap do |hash|
|
|
439
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
440
|
-
end
|
|
441
|
-
elsif value.respond_to? :to_hash
|
|
442
|
-
value.to_hash
|
|
443
|
-
else
|
|
444
|
-
value
|
|
445
|
-
end
|
|
446
|
-
end
|
|
447
380
|
end
|
|
448
381
|
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 recording was transcribed, metadata about the transcription
|
|
18
|
-
class RecordingTranscriptionMetadata
|
|
18
|
+
class RecordingTranscriptionMetadata < ApiModelBase
|
|
19
19
|
# The unique transcription ID
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -38,9 +38,14 @@ module Bandwidth
|
|
|
38
38
|
}
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
# Returns attribute mapping this model knows about
|
|
42
|
+
def self.acceptable_attribute_map
|
|
43
|
+
attribute_map
|
|
44
|
+
end
|
|
45
|
+
|
|
41
46
|
# Returns all the JSON keys this model knows about
|
|
42
47
|
def self.acceptable_attributes
|
|
43
|
-
|
|
48
|
+
acceptable_attribute_map.values
|
|
44
49
|
end
|
|
45
50
|
|
|
46
51
|
# Attribute type mapping.
|
|
@@ -67,9 +72,10 @@ module Bandwidth
|
|
|
67
72
|
end
|
|
68
73
|
|
|
69
74
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
70
76
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
-
if (!
|
|
72
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingTranscriptionMetadata`. Please check the name to make sure it's valid. List of attributes: " +
|
|
77
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingTranscriptionMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
73
79
|
end
|
|
74
80
|
h[k.to_sym] = v
|
|
75
81
|
}
|
|
@@ -152,61 +158,6 @@ module Bandwidth
|
|
|
152
158
|
new(transformed_hash)
|
|
153
159
|
end
|
|
154
160
|
|
|
155
|
-
# Deserializes the data based on type
|
|
156
|
-
# @param string type Data type
|
|
157
|
-
# @param string value Value to be deserialized
|
|
158
|
-
# @return [Object] Deserialized data
|
|
159
|
-
def self._deserialize(type, value)
|
|
160
|
-
case type.to_sym
|
|
161
|
-
when :Time
|
|
162
|
-
Time.parse(value)
|
|
163
|
-
when :Date
|
|
164
|
-
Date.parse(value)
|
|
165
|
-
when :String
|
|
166
|
-
value.to_s
|
|
167
|
-
when :Integer
|
|
168
|
-
value.to_i
|
|
169
|
-
when :Float
|
|
170
|
-
value.to_f
|
|
171
|
-
when :Boolean
|
|
172
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
173
|
-
true
|
|
174
|
-
else
|
|
175
|
-
false
|
|
176
|
-
end
|
|
177
|
-
when :Object
|
|
178
|
-
# generic object (usually a Hash), return directly
|
|
179
|
-
value
|
|
180
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
181
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
182
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
183
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
184
|
-
k_type = Regexp.last_match[:k_type]
|
|
185
|
-
v_type = Regexp.last_match[:v_type]
|
|
186
|
-
{}.tap do |hash|
|
|
187
|
-
value.each do |k, v|
|
|
188
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
|
-
else # model
|
|
192
|
-
# models (e.g. Pet) or oneOf
|
|
193
|
-
klass = Bandwidth.const_get(type)
|
|
194
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
195
|
-
end
|
|
196
|
-
end
|
|
197
|
-
|
|
198
|
-
# Returns the string representation of the object
|
|
199
|
-
# @return [String] String presentation of the object
|
|
200
|
-
def to_s
|
|
201
|
-
to_hash.to_s
|
|
202
|
-
end
|
|
203
|
-
|
|
204
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
205
|
-
# @return [Hash] Returns the object in the form of hash
|
|
206
|
-
def to_body
|
|
207
|
-
to_hash
|
|
208
|
-
end
|
|
209
|
-
|
|
210
161
|
# Returns the object in the form of hash
|
|
211
162
|
# @return [Hash] Returns the object in the form of hash
|
|
212
163
|
def to_hash
|
|
@@ -222,23 +173,5 @@ module Bandwidth
|
|
|
222
173
|
end
|
|
223
174
|
hash
|
|
224
175
|
end
|
|
225
|
-
|
|
226
|
-
# Outputs non-array value in the form of hash
|
|
227
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
228
|
-
# @param [Object] value Any valid value
|
|
229
|
-
# @return [Hash] Returns the value in the form of hash
|
|
230
|
-
def _to_hash(value)
|
|
231
|
-
if value.is_a?(Array)
|
|
232
|
-
value.compact.map { |v| _to_hash(v) }
|
|
233
|
-
elsif value.is_a?(Hash)
|
|
234
|
-
{}.tap do |hash|
|
|
235
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
236
|
-
end
|
|
237
|
-
elsif value.respond_to? :to_hash
|
|
238
|
-
value.to_hash
|
|
239
|
-
else
|
|
240
|
-
value
|
|
241
|
-
end
|
|
242
|
-
end
|
|
243
176
|
end
|
|
244
177
|
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 RecordingTranscriptions
|
|
17
|
+
class RecordingTranscriptions < ApiModelBase
|
|
18
18
|
attr_accessor :transcripts
|
|
19
19
|
|
|
20
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -24,9 +24,14 @@ module Bandwidth
|
|
|
24
24
|
}
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
27
32
|
# Returns all the JSON keys this model knows about
|
|
28
33
|
def self.acceptable_attributes
|
|
29
|
-
|
|
34
|
+
acceptable_attribute_map.values
|
|
30
35
|
end
|
|
31
36
|
|
|
32
37
|
# Attribute type mapping.
|
|
@@ -50,9 +55,10 @@ module Bandwidth
|
|
|
50
55
|
end
|
|
51
56
|
|
|
52
57
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
53
59
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
54
|
-
if (!
|
|
55
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingTranscriptions`. Please check the name to make sure it's valid. List of attributes: " +
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingTranscriptions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
56
62
|
end
|
|
57
63
|
h[k.to_sym] = v
|
|
58
64
|
}
|
|
@@ -122,61 +128,6 @@ module Bandwidth
|
|
|
122
128
|
new(transformed_hash)
|
|
123
129
|
end
|
|
124
130
|
|
|
125
|
-
# Deserializes the data based on type
|
|
126
|
-
# @param string type Data type
|
|
127
|
-
# @param string value Value to be deserialized
|
|
128
|
-
# @return [Object] Deserialized data
|
|
129
|
-
def self._deserialize(type, value)
|
|
130
|
-
case type.to_sym
|
|
131
|
-
when :Time
|
|
132
|
-
Time.parse(value)
|
|
133
|
-
when :Date
|
|
134
|
-
Date.parse(value)
|
|
135
|
-
when :String
|
|
136
|
-
value.to_s
|
|
137
|
-
when :Integer
|
|
138
|
-
value.to_i
|
|
139
|
-
when :Float
|
|
140
|
-
value.to_f
|
|
141
|
-
when :Boolean
|
|
142
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
143
|
-
true
|
|
144
|
-
else
|
|
145
|
-
false
|
|
146
|
-
end
|
|
147
|
-
when :Object
|
|
148
|
-
# generic object (usually a Hash), return directly
|
|
149
|
-
value
|
|
150
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
151
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
152
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
153
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
154
|
-
k_type = Regexp.last_match[:k_type]
|
|
155
|
-
v_type = Regexp.last_match[:v_type]
|
|
156
|
-
{}.tap do |hash|
|
|
157
|
-
value.each do |k, v|
|
|
158
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
else # model
|
|
162
|
-
# models (e.g. Pet) or oneOf
|
|
163
|
-
klass = Bandwidth.const_get(type)
|
|
164
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
165
|
-
end
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
# Returns the string representation of the object
|
|
169
|
-
# @return [String] String presentation of the object
|
|
170
|
-
def to_s
|
|
171
|
-
to_hash.to_s
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
175
|
-
# @return [Hash] Returns the object in the form of hash
|
|
176
|
-
def to_body
|
|
177
|
-
to_hash
|
|
178
|
-
end
|
|
179
|
-
|
|
180
131
|
# Returns the object in the form of hash
|
|
181
132
|
# @return [Hash] Returns the object in the form of hash
|
|
182
133
|
def to_hash
|
|
@@ -192,23 +143,5 @@ module Bandwidth
|
|
|
192
143
|
end
|
|
193
144
|
hash
|
|
194
145
|
end
|
|
195
|
-
|
|
196
|
-
# Outputs non-array value in the form of hash
|
|
197
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
198
|
-
# @param [Object] value Any valid value
|
|
199
|
-
# @return [Hash] Returns the value in the form of hash
|
|
200
|
-
def _to_hash(value)
|
|
201
|
-
if value.is_a?(Array)
|
|
202
|
-
value.compact.map { |v| _to_hash(v) }
|
|
203
|
-
elsif value.is_a?(Hash)
|
|
204
|
-
{}.tap do |hash|
|
|
205
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
206
|
-
end
|
|
207
|
-
elsif value.respond_to? :to_hash
|
|
208
|
-
value.to_hash
|
|
209
|
-
else
|
|
210
|
-
value
|
|
211
|
-
end
|
|
212
|
-
end
|
|
213
146
|
end
|
|
214
147
|
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 Redirect event is fired when a <Redirect> verb is executed. Its purpose is to get the next set of verbs from the calling application.
|
|
18
|
-
class RedirectCallback
|
|
18
|
+
class RedirectCallback < 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.
|
|
@@ -151,9 +156,10 @@ module Bandwidth
|
|
|
151
156
|
end
|
|
152
157
|
|
|
153
158
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
159
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
154
160
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
155
|
-
if (!
|
|
156
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RedirectCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
161
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
162
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RedirectCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
157
163
|
end
|
|
158
164
|
h[k.to_sym] = v
|
|
159
165
|
}
|
|
@@ -296,61 +302,6 @@ module Bandwidth
|
|
|
296
302
|
new(transformed_hash)
|
|
297
303
|
end
|
|
298
304
|
|
|
299
|
-
# Deserializes the data based on type
|
|
300
|
-
# @param string type Data type
|
|
301
|
-
# @param string value Value to be deserialized
|
|
302
|
-
# @return [Object] Deserialized data
|
|
303
|
-
def self._deserialize(type, value)
|
|
304
|
-
case type.to_sym
|
|
305
|
-
when :Time
|
|
306
|
-
Time.parse(value)
|
|
307
|
-
when :Date
|
|
308
|
-
Date.parse(value)
|
|
309
|
-
when :String
|
|
310
|
-
value.to_s
|
|
311
|
-
when :Integer
|
|
312
|
-
value.to_i
|
|
313
|
-
when :Float
|
|
314
|
-
value.to_f
|
|
315
|
-
when :Boolean
|
|
316
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
317
|
-
true
|
|
318
|
-
else
|
|
319
|
-
false
|
|
320
|
-
end
|
|
321
|
-
when :Object
|
|
322
|
-
# generic object (usually a Hash), return directly
|
|
323
|
-
value
|
|
324
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
325
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
326
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
327
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
328
|
-
k_type = Regexp.last_match[:k_type]
|
|
329
|
-
v_type = Regexp.last_match[:v_type]
|
|
330
|
-
{}.tap do |hash|
|
|
331
|
-
value.each do |k, v|
|
|
332
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
333
|
-
end
|
|
334
|
-
end
|
|
335
|
-
else # model
|
|
336
|
-
# models (e.g. Pet) or oneOf
|
|
337
|
-
klass = Bandwidth.const_get(type)
|
|
338
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
339
|
-
end
|
|
340
|
-
end
|
|
341
|
-
|
|
342
|
-
# Returns the string representation of the object
|
|
343
|
-
# @return [String] String presentation of the object
|
|
344
|
-
def to_s
|
|
345
|
-
to_hash.to_s
|
|
346
|
-
end
|
|
347
|
-
|
|
348
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
349
|
-
# @return [Hash] Returns the object in the form of hash
|
|
350
|
-
def to_body
|
|
351
|
-
to_hash
|
|
352
|
-
end
|
|
353
|
-
|
|
354
305
|
# Returns the object in the form of hash
|
|
355
306
|
# @return [Hash] Returns the object in the form of hash
|
|
356
307
|
def to_hash
|
|
@@ -366,23 +317,5 @@ module Bandwidth
|
|
|
366
317
|
end
|
|
367
318
|
hash
|
|
368
319
|
end
|
|
369
|
-
|
|
370
|
-
# Outputs non-array value in the form of hash
|
|
371
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
372
|
-
# @param [Object] value Any valid value
|
|
373
|
-
# @return [Hash] Returns the value in the form of hash
|
|
374
|
-
def _to_hash(value)
|
|
375
|
-
if value.is_a?(Array)
|
|
376
|
-
value.compact.map { |v| _to_hash(v) }
|
|
377
|
-
elsif value.is_a?(Hash)
|
|
378
|
-
{}.tap do |hash|
|
|
379
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
380
|
-
end
|
|
381
|
-
elsif value.respond_to? :to_hash
|
|
382
|
-
value.to_hash
|
|
383
|
-
else
|
|
384
|
-
value
|
|
385
|
-
end
|
|
386
|
-
end
|
|
387
320
|
end
|
|
388
321
|
end
|