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
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
|
-
class CodeRequest
|
|
17
|
+
class CodeRequest < ApiModelBase
|
|
18
18
|
# The phone number to send the mfa code to.
|
|
19
19
|
attr_accessor :to
|
|
20
20
|
|
|
@@ -45,9 +45,14 @@ module Bandwidth
|
|
|
45
45
|
}
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
# Returns attribute mapping this model knows about
|
|
49
|
+
def self.acceptable_attribute_map
|
|
50
|
+
attribute_map
|
|
51
|
+
end
|
|
52
|
+
|
|
48
53
|
# Returns all the JSON keys this model knows about
|
|
49
54
|
def self.acceptable_attributes
|
|
50
|
-
|
|
55
|
+
acceptable_attribute_map.values
|
|
51
56
|
end
|
|
52
57
|
|
|
53
58
|
# Attribute type mapping.
|
|
@@ -76,9 +81,10 @@ module Bandwidth
|
|
|
76
81
|
end
|
|
77
82
|
|
|
78
83
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
79
85
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
80
|
-
if (!
|
|
81
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CodeRequest`. Please check the name to make sure it's valid. List of attributes: " +
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
82
88
|
end
|
|
83
89
|
h[k.to_sym] = v
|
|
84
90
|
}
|
|
@@ -342,61 +348,6 @@ module Bandwidth
|
|
|
342
348
|
new(transformed_hash)
|
|
343
349
|
end
|
|
344
350
|
|
|
345
|
-
# Deserializes the data based on type
|
|
346
|
-
# @param string type Data type
|
|
347
|
-
# @param string value Value to be deserialized
|
|
348
|
-
# @return [Object] Deserialized data
|
|
349
|
-
def self._deserialize(type, value)
|
|
350
|
-
case type.to_sym
|
|
351
|
-
when :Time
|
|
352
|
-
Time.parse(value)
|
|
353
|
-
when :Date
|
|
354
|
-
Date.parse(value)
|
|
355
|
-
when :String
|
|
356
|
-
value.to_s
|
|
357
|
-
when :Integer
|
|
358
|
-
value.to_i
|
|
359
|
-
when :Float
|
|
360
|
-
value.to_f
|
|
361
|
-
when :Boolean
|
|
362
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
363
|
-
true
|
|
364
|
-
else
|
|
365
|
-
false
|
|
366
|
-
end
|
|
367
|
-
when :Object
|
|
368
|
-
# generic object (usually a Hash), return directly
|
|
369
|
-
value
|
|
370
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
371
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
372
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
373
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
374
|
-
k_type = Regexp.last_match[:k_type]
|
|
375
|
-
v_type = Regexp.last_match[:v_type]
|
|
376
|
-
{}.tap do |hash|
|
|
377
|
-
value.each do |k, v|
|
|
378
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
379
|
-
end
|
|
380
|
-
end
|
|
381
|
-
else # model
|
|
382
|
-
# models (e.g. Pet) or oneOf
|
|
383
|
-
klass = Bandwidth.const_get(type)
|
|
384
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
385
|
-
end
|
|
386
|
-
end
|
|
387
|
-
|
|
388
|
-
# Returns the string representation of the object
|
|
389
|
-
# @return [String] String presentation of the object
|
|
390
|
-
def to_s
|
|
391
|
-
to_hash.to_s
|
|
392
|
-
end
|
|
393
|
-
|
|
394
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
395
|
-
# @return [Hash] Returns the object in the form of hash
|
|
396
|
-
def to_body
|
|
397
|
-
to_hash
|
|
398
|
-
end
|
|
399
|
-
|
|
400
351
|
# Returns the object in the form of hash
|
|
401
352
|
# @return [Hash] Returns the object in the form of hash
|
|
402
353
|
def to_hash
|
|
@@ -412,23 +363,5 @@ module Bandwidth
|
|
|
412
363
|
end
|
|
413
364
|
hash
|
|
414
365
|
end
|
|
415
|
-
|
|
416
|
-
# Outputs non-array value in the form of hash
|
|
417
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
418
|
-
# @param [Object] value Any valid value
|
|
419
|
-
# @return [Hash] Returns the value in the form of hash
|
|
420
|
-
def _to_hash(value)
|
|
421
|
-
if value.is_a?(Array)
|
|
422
|
-
value.compact.map { |v| _to_hash(v) }
|
|
423
|
-
elsif value.is_a?(Hash)
|
|
424
|
-
{}.tap do |hash|
|
|
425
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
426
|
-
end
|
|
427
|
-
elsif value.respond_to? :to_hash
|
|
428
|
-
value.to_hash
|
|
429
|
-
else
|
|
430
|
-
value
|
|
431
|
-
end
|
|
432
|
-
end
|
|
433
366
|
end
|
|
434
367
|
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 Conference
|
|
17
|
+
class Conference < ApiModelBase
|
|
18
18
|
# The Bandwidth-generated conference ID.
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
@@ -74,9 +74,14 @@ module Bandwidth
|
|
|
74
74
|
}
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
+
# Returns attribute mapping this model knows about
|
|
78
|
+
def self.acceptable_attribute_map
|
|
79
|
+
attribute_map
|
|
80
|
+
end
|
|
81
|
+
|
|
77
82
|
# Returns all the JSON keys this model knows about
|
|
78
83
|
def self.acceptable_attributes
|
|
79
|
-
|
|
84
|
+
acceptable_attribute_map.values
|
|
80
85
|
end
|
|
81
86
|
|
|
82
87
|
# Attribute type mapping.
|
|
@@ -112,9 +117,10 @@ module Bandwidth
|
|
|
112
117
|
end
|
|
113
118
|
|
|
114
119
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
120
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
115
121
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
116
|
-
if (!
|
|
117
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Conference`. Please check the name to make sure it's valid. List of attributes: " +
|
|
122
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
123
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Conference`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
118
124
|
end
|
|
119
125
|
h[k.to_sym] = v
|
|
120
126
|
}
|
|
@@ -221,61 +227,6 @@ module Bandwidth
|
|
|
221
227
|
new(transformed_hash)
|
|
222
228
|
end
|
|
223
229
|
|
|
224
|
-
# Deserializes the data based on type
|
|
225
|
-
# @param string type Data type
|
|
226
|
-
# @param string value Value to be deserialized
|
|
227
|
-
# @return [Object] Deserialized data
|
|
228
|
-
def self._deserialize(type, value)
|
|
229
|
-
case type.to_sym
|
|
230
|
-
when :Time
|
|
231
|
-
Time.parse(value)
|
|
232
|
-
when :Date
|
|
233
|
-
Date.parse(value)
|
|
234
|
-
when :String
|
|
235
|
-
value.to_s
|
|
236
|
-
when :Integer
|
|
237
|
-
value.to_i
|
|
238
|
-
when :Float
|
|
239
|
-
value.to_f
|
|
240
|
-
when :Boolean
|
|
241
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
242
|
-
true
|
|
243
|
-
else
|
|
244
|
-
false
|
|
245
|
-
end
|
|
246
|
-
when :Object
|
|
247
|
-
# generic object (usually a Hash), return directly
|
|
248
|
-
value
|
|
249
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
250
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
251
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
252
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
253
|
-
k_type = Regexp.last_match[:k_type]
|
|
254
|
-
v_type = Regexp.last_match[:v_type]
|
|
255
|
-
{}.tap do |hash|
|
|
256
|
-
value.each do |k, v|
|
|
257
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
258
|
-
end
|
|
259
|
-
end
|
|
260
|
-
else # model
|
|
261
|
-
# models (e.g. Pet) or oneOf
|
|
262
|
-
klass = Bandwidth.const_get(type)
|
|
263
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
264
|
-
end
|
|
265
|
-
end
|
|
266
|
-
|
|
267
|
-
# Returns the string representation of the object
|
|
268
|
-
# @return [String] String presentation of the object
|
|
269
|
-
def to_s
|
|
270
|
-
to_hash.to_s
|
|
271
|
-
end
|
|
272
|
-
|
|
273
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
274
|
-
# @return [Hash] Returns the object in the form of hash
|
|
275
|
-
def to_body
|
|
276
|
-
to_hash
|
|
277
|
-
end
|
|
278
|
-
|
|
279
230
|
# Returns the object in the form of hash
|
|
280
231
|
# @return [Hash] Returns the object in the form of hash
|
|
281
232
|
def to_hash
|
|
@@ -291,23 +242,5 @@ module Bandwidth
|
|
|
291
242
|
end
|
|
292
243
|
hash
|
|
293
244
|
end
|
|
294
|
-
|
|
295
|
-
# Outputs non-array value in the form of hash
|
|
296
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
297
|
-
# @param [Object] value Any valid value
|
|
298
|
-
# @return [Hash] Returns the value in the form of hash
|
|
299
|
-
def _to_hash(value)
|
|
300
|
-
if value.is_a?(Array)
|
|
301
|
-
value.compact.map { |v| _to_hash(v) }
|
|
302
|
-
elsif value.is_a?(Hash)
|
|
303
|
-
{}.tap do |hash|
|
|
304
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
305
|
-
end
|
|
306
|
-
elsif value.respond_to? :to_hash
|
|
307
|
-
value.to_hash
|
|
308
|
-
else
|
|
309
|
-
value
|
|
310
|
-
end
|
|
311
|
-
end
|
|
312
245
|
end
|
|
313
246
|
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 Conference Completed event is fired when the last member leaves the conference. The response to this event may not contain BXML.
|
|
18
|
-
class ConferenceCompletedCallback
|
|
18
|
+
class ConferenceCompletedCallback < 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
|
|
|
@@ -42,9 +42,14 @@ module Bandwidth
|
|
|
42
42
|
}
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
# Returns attribute mapping this model knows about
|
|
46
|
+
def self.acceptable_attribute_map
|
|
47
|
+
attribute_map
|
|
48
|
+
end
|
|
49
|
+
|
|
45
50
|
# Returns all the JSON keys this model knows about
|
|
46
51
|
def self.acceptable_attributes
|
|
47
|
-
|
|
52
|
+
acceptable_attribute_map.values
|
|
48
53
|
end
|
|
49
54
|
|
|
50
55
|
# Attribute type mapping.
|
|
@@ -73,9 +78,10 @@ module Bandwidth
|
|
|
73
78
|
end
|
|
74
79
|
|
|
75
80
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
81
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
82
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
-
if (!
|
|
78
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceCompletedCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
83
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
84
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceCompletedCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
85
|
end
|
|
80
86
|
h[k.to_sym] = v
|
|
81
87
|
}
|
|
@@ -163,61 +169,6 @@ module Bandwidth
|
|
|
163
169
|
new(transformed_hash)
|
|
164
170
|
end
|
|
165
171
|
|
|
166
|
-
# Deserializes the data based on type
|
|
167
|
-
# @param string type Data type
|
|
168
|
-
# @param string value Value to be deserialized
|
|
169
|
-
# @return [Object] Deserialized data
|
|
170
|
-
def self._deserialize(type, value)
|
|
171
|
-
case type.to_sym
|
|
172
|
-
when :Time
|
|
173
|
-
Time.parse(value)
|
|
174
|
-
when :Date
|
|
175
|
-
Date.parse(value)
|
|
176
|
-
when :String
|
|
177
|
-
value.to_s
|
|
178
|
-
when :Integer
|
|
179
|
-
value.to_i
|
|
180
|
-
when :Float
|
|
181
|
-
value.to_f
|
|
182
|
-
when :Boolean
|
|
183
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
184
|
-
true
|
|
185
|
-
else
|
|
186
|
-
false
|
|
187
|
-
end
|
|
188
|
-
when :Object
|
|
189
|
-
# generic object (usually a Hash), return directly
|
|
190
|
-
value
|
|
191
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
192
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
193
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
194
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
195
|
-
k_type = Regexp.last_match[:k_type]
|
|
196
|
-
v_type = Regexp.last_match[:v_type]
|
|
197
|
-
{}.tap do |hash|
|
|
198
|
-
value.each do |k, v|
|
|
199
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
200
|
-
end
|
|
201
|
-
end
|
|
202
|
-
else # model
|
|
203
|
-
# models (e.g. Pet) or oneOf
|
|
204
|
-
klass = Bandwidth.const_get(type)
|
|
205
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
206
|
-
end
|
|
207
|
-
end
|
|
208
|
-
|
|
209
|
-
# Returns the string representation of the object
|
|
210
|
-
# @return [String] String presentation of the object
|
|
211
|
-
def to_s
|
|
212
|
-
to_hash.to_s
|
|
213
|
-
end
|
|
214
|
-
|
|
215
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
216
|
-
# @return [Hash] Returns the object in the form of hash
|
|
217
|
-
def to_body
|
|
218
|
-
to_hash
|
|
219
|
-
end
|
|
220
|
-
|
|
221
172
|
# Returns the object in the form of hash
|
|
222
173
|
# @return [Hash] Returns the object in the form of hash
|
|
223
174
|
def to_hash
|
|
@@ -233,23 +184,5 @@ module Bandwidth
|
|
|
233
184
|
end
|
|
234
185
|
hash
|
|
235
186
|
end
|
|
236
|
-
|
|
237
|
-
# Outputs non-array value in the form of hash
|
|
238
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
239
|
-
# @param [Object] value Any valid value
|
|
240
|
-
# @return [Hash] Returns the value in the form of hash
|
|
241
|
-
def _to_hash(value)
|
|
242
|
-
if value.is_a?(Array)
|
|
243
|
-
value.compact.map { |v| _to_hash(v) }
|
|
244
|
-
elsif value.is_a?(Hash)
|
|
245
|
-
{}.tap do |hash|
|
|
246
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
247
|
-
end
|
|
248
|
-
elsif value.respond_to? :to_hash
|
|
249
|
-
value.to_hash
|
|
250
|
-
else
|
|
251
|
-
value
|
|
252
|
-
end
|
|
253
|
-
end
|
|
254
187
|
end
|
|
255
188
|
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 Conference Created event is fired whenever a new conference that specified a callbackUrl is created. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference.
|
|
18
|
-
class ConferenceCreatedCallback
|
|
18
|
+
class ConferenceCreatedCallback < 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
|
|
|
@@ -42,9 +42,14 @@ module Bandwidth
|
|
|
42
42
|
}
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
# Returns attribute mapping this model knows about
|
|
46
|
+
def self.acceptable_attribute_map
|
|
47
|
+
attribute_map
|
|
48
|
+
end
|
|
49
|
+
|
|
45
50
|
# Returns all the JSON keys this model knows about
|
|
46
51
|
def self.acceptable_attributes
|
|
47
|
-
|
|
52
|
+
acceptable_attribute_map.values
|
|
48
53
|
end
|
|
49
54
|
|
|
50
55
|
# Attribute type mapping.
|
|
@@ -73,9 +78,10 @@ module Bandwidth
|
|
|
73
78
|
end
|
|
74
79
|
|
|
75
80
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
81
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
82
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
-
if (!
|
|
78
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceCreatedCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
83
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
84
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceCreatedCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
85
|
end
|
|
80
86
|
h[k.to_sym] = v
|
|
81
87
|
}
|
|
@@ -163,61 +169,6 @@ module Bandwidth
|
|
|
163
169
|
new(transformed_hash)
|
|
164
170
|
end
|
|
165
171
|
|
|
166
|
-
# Deserializes the data based on type
|
|
167
|
-
# @param string type Data type
|
|
168
|
-
# @param string value Value to be deserialized
|
|
169
|
-
# @return [Object] Deserialized data
|
|
170
|
-
def self._deserialize(type, value)
|
|
171
|
-
case type.to_sym
|
|
172
|
-
when :Time
|
|
173
|
-
Time.parse(value)
|
|
174
|
-
when :Date
|
|
175
|
-
Date.parse(value)
|
|
176
|
-
when :String
|
|
177
|
-
value.to_s
|
|
178
|
-
when :Integer
|
|
179
|
-
value.to_i
|
|
180
|
-
when :Float
|
|
181
|
-
value.to_f
|
|
182
|
-
when :Boolean
|
|
183
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
184
|
-
true
|
|
185
|
-
else
|
|
186
|
-
false
|
|
187
|
-
end
|
|
188
|
-
when :Object
|
|
189
|
-
# generic object (usually a Hash), return directly
|
|
190
|
-
value
|
|
191
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
192
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
193
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
194
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
195
|
-
k_type = Regexp.last_match[:k_type]
|
|
196
|
-
v_type = Regexp.last_match[:v_type]
|
|
197
|
-
{}.tap do |hash|
|
|
198
|
-
value.each do |k, v|
|
|
199
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
200
|
-
end
|
|
201
|
-
end
|
|
202
|
-
else # model
|
|
203
|
-
# models (e.g. Pet) or oneOf
|
|
204
|
-
klass = Bandwidth.const_get(type)
|
|
205
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
206
|
-
end
|
|
207
|
-
end
|
|
208
|
-
|
|
209
|
-
# Returns the string representation of the object
|
|
210
|
-
# @return [String] String presentation of the object
|
|
211
|
-
def to_s
|
|
212
|
-
to_hash.to_s
|
|
213
|
-
end
|
|
214
|
-
|
|
215
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
216
|
-
# @return [Hash] Returns the object in the form of hash
|
|
217
|
-
def to_body
|
|
218
|
-
to_hash
|
|
219
|
-
end
|
|
220
|
-
|
|
221
172
|
# Returns the object in the form of hash
|
|
222
173
|
# @return [Hash] Returns the object in the form of hash
|
|
223
174
|
def to_hash
|
|
@@ -233,23 +184,5 @@ module Bandwidth
|
|
|
233
184
|
end
|
|
234
185
|
hash
|
|
235
186
|
end
|
|
236
|
-
|
|
237
|
-
# Outputs non-array value in the form of hash
|
|
238
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
239
|
-
# @param [Object] value Any valid value
|
|
240
|
-
# @return [Hash] Returns the value in the form of hash
|
|
241
|
-
def _to_hash(value)
|
|
242
|
-
if value.is_a?(Array)
|
|
243
|
-
value.compact.map { |v| _to_hash(v) }
|
|
244
|
-
elsif value.is_a?(Hash)
|
|
245
|
-
{}.tap do |hash|
|
|
246
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
247
|
-
end
|
|
248
|
-
elsif value.respond_to? :to_hash
|
|
249
|
-
value.to_hash
|
|
250
|
-
else
|
|
251
|
-
value
|
|
252
|
-
end
|
|
253
|
-
end
|
|
254
187
|
end
|
|
255
188
|
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 ConferenceMember
|
|
17
|
+
class ConferenceMember < ApiModelBase
|
|
18
18
|
# The call id associated with the event.
|
|
19
19
|
attr_accessor :call_id
|
|
20
20
|
|
|
@@ -45,9 +45,14 @@ module Bandwidth
|
|
|
45
45
|
}
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
# Returns attribute mapping this model knows about
|
|
49
|
+
def self.acceptable_attribute_map
|
|
50
|
+
attribute_map
|
|
51
|
+
end
|
|
52
|
+
|
|
48
53
|
# Returns all the JSON keys this model knows about
|
|
49
54
|
def self.acceptable_attributes
|
|
50
|
-
|
|
55
|
+
acceptable_attribute_map.values
|
|
51
56
|
end
|
|
52
57
|
|
|
53
58
|
# Attribute type mapping.
|
|
@@ -77,9 +82,10 @@ module Bandwidth
|
|
|
77
82
|
end
|
|
78
83
|
|
|
79
84
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
85
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
80
86
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
81
|
-
if (!
|
|
82
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceMember`. Please check the name to make sure it's valid. List of attributes: " +
|
|
87
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
88
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceMember`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
83
89
|
end
|
|
84
90
|
h[k.to_sym] = v
|
|
85
91
|
}
|
|
@@ -174,61 +180,6 @@ module Bandwidth
|
|
|
174
180
|
new(transformed_hash)
|
|
175
181
|
end
|
|
176
182
|
|
|
177
|
-
# Deserializes the data based on type
|
|
178
|
-
# @param string type Data type
|
|
179
|
-
# @param string value Value to be deserialized
|
|
180
|
-
# @return [Object] Deserialized data
|
|
181
|
-
def self._deserialize(type, value)
|
|
182
|
-
case type.to_sym
|
|
183
|
-
when :Time
|
|
184
|
-
Time.parse(value)
|
|
185
|
-
when :Date
|
|
186
|
-
Date.parse(value)
|
|
187
|
-
when :String
|
|
188
|
-
value.to_s
|
|
189
|
-
when :Integer
|
|
190
|
-
value.to_i
|
|
191
|
-
when :Float
|
|
192
|
-
value.to_f
|
|
193
|
-
when :Boolean
|
|
194
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
195
|
-
true
|
|
196
|
-
else
|
|
197
|
-
false
|
|
198
|
-
end
|
|
199
|
-
when :Object
|
|
200
|
-
# generic object (usually a Hash), return directly
|
|
201
|
-
value
|
|
202
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
203
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
204
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
205
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
206
|
-
k_type = Regexp.last_match[:k_type]
|
|
207
|
-
v_type = Regexp.last_match[:v_type]
|
|
208
|
-
{}.tap do |hash|
|
|
209
|
-
value.each do |k, v|
|
|
210
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
211
|
-
end
|
|
212
|
-
end
|
|
213
|
-
else # model
|
|
214
|
-
# models (e.g. Pet) or oneOf
|
|
215
|
-
klass = Bandwidth.const_get(type)
|
|
216
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
217
|
-
end
|
|
218
|
-
end
|
|
219
|
-
|
|
220
|
-
# Returns the string representation of the object
|
|
221
|
-
# @return [String] String presentation of the object
|
|
222
|
-
def to_s
|
|
223
|
-
to_hash.to_s
|
|
224
|
-
end
|
|
225
|
-
|
|
226
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
227
|
-
# @return [Hash] Returns the object in the form of hash
|
|
228
|
-
def to_body
|
|
229
|
-
to_hash
|
|
230
|
-
end
|
|
231
|
-
|
|
232
183
|
# Returns the object in the form of hash
|
|
233
184
|
# @return [Hash] Returns the object in the form of hash
|
|
234
185
|
def to_hash
|
|
@@ -244,23 +195,5 @@ module Bandwidth
|
|
|
244
195
|
end
|
|
245
196
|
hash
|
|
246
197
|
end
|
|
247
|
-
|
|
248
|
-
# Outputs non-array value in the form of hash
|
|
249
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
250
|
-
# @param [Object] value Any valid value
|
|
251
|
-
# @return [Hash] Returns the value in the form of hash
|
|
252
|
-
def _to_hash(value)
|
|
253
|
-
if value.is_a?(Array)
|
|
254
|
-
value.compact.map { |v| _to_hash(v) }
|
|
255
|
-
elsif value.is_a?(Hash)
|
|
256
|
-
{}.tap do |hash|
|
|
257
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
258
|
-
end
|
|
259
|
-
elsif value.respond_to? :to_hash
|
|
260
|
-
value.to_hash
|
|
261
|
-
else
|
|
262
|
-
value
|
|
263
|
-
end
|
|
264
|
-
end
|
|
265
198
|
end
|
|
266
199
|
end
|