bandwidth-sdk 17.0.1 → 17.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +18 -0
- data/bandwidth-sdk.gemspec +1 -2
- data/bandwidth.yml +7 -0
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +198 -387
- data/coverage/index.html +5842 -7703
- data/custom_templates/README.mustache +4 -1
- data/custom_templates/api_client.mustache +254 -0
- data/custom_templates/configuration.mustache +545 -0
- data/custom_templates/gem.mustache +2 -0
- data/docs/CallsApi.md +20 -5
- data/docs/ConferencesApi.md +36 -9
- data/docs/MFAApi.md +12 -3
- data/docs/MediaApi.md +16 -4
- data/docs/MessagesApi.md +8 -2
- data/docs/MultiChannelApi.md +4 -1
- data/docs/PhoneNumberLookupApi.md +12 -3
- data/docs/RecordingsApi.md +40 -10
- data/docs/StatisticsApi.md +4 -1
- data/docs/TollFreeVerificationApi.md +36 -9
- data/docs/TranscriptionsApi.md +12 -3
- data/lib/bandwidth-sdk/api/calls_api.rb +6 -6
- data/lib/bandwidth-sdk/api/conferences_api.rb +10 -10
- data/lib/bandwidth-sdk/api/media_api.rb +5 -5
- data/lib/bandwidth-sdk/api/messages_api.rb +3 -3
- data/lib/bandwidth-sdk/api/mfa_api.rb +4 -4
- data/lib/bandwidth-sdk/api/multi_channel_api.rb +2 -2
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +4 -4
- data/lib/bandwidth-sdk/api/recordings_api.rb +11 -11
- data/lib/bandwidth-sdk/api/statistics_api.rb +2 -2
- data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +13 -13
- data/lib/bandwidth-sdk/api/transcriptions_api.rb +4 -4
- data/lib/bandwidth-sdk/api_client.rb +9 -5
- data/lib/bandwidth-sdk/api_error.rb +1 -1
- data/lib/bandwidth-sdk/api_model_base.rb +88 -0
- data/lib/bandwidth-sdk/configuration.rb +50 -1
- data/lib/bandwidth-sdk/models/account_statistics.rb +11 -78
- data/lib/bandwidth-sdk/models/additional_denial_reason.rb +41 -78
- data/lib/bandwidth-sdk/models/address.rb +23 -90
- data/lib/bandwidth-sdk/models/answer_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/async_lookup_request.rb +11 -78
- data/lib/bandwidth-sdk/models/blocked_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/business_entity_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/business_registration_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/call_state.rb +11 -78
- data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_transcription.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_response.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_track_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/callback.rb +1 -1
- data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/card_width_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/code_request.rb +11 -78
- data/lib/bandwidth-sdk/models/completed_lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/conference.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/contact.rb +19 -86
- data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/create_call.rb +41 -78
- data/lib/bandwidth-sdk/models/create_call_response.rb +81 -78
- data/lib/bandwidth-sdk/models/create_message_request_error.rb +31 -78
- data/lib/bandwidth-sdk/models/create_multi_channel_message_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_sync_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_sync_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/deactivation_event_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/diversion.rb +11 -78
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/error.rb +11 -78
- data/lib/bandwidth-sdk/models/error_object.rb +41 -78
- data/lib/bandwidth-sdk/models/error_source.rb +11 -78
- data/lib/bandwidth-sdk/models/failure_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/field_error.rb +11 -78
- data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/gather_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/in_progress_lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/inbound_callback.rb +61 -78
- data/lib/bandwidth-sdk/models/inbound_callback_message.rb +81 -78
- data/lib/bandwidth-sdk/models/inbound_callback_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/initiate_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/latest_message_delivery_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/line_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/link.rb +11 -78
- data/lib/bandwidth-sdk/models/link_schema.rb +11 -78
- data/lib/bandwidth-sdk/models/links_object.rb +11 -78
- data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/list_message_item.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_response.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_schema.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_schema_meta.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_result.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_result.rb +11 -78
- data/lib/bandwidth-sdk/models/media.rb +11 -78
- data/lib/bandwidth-sdk/models/message.rb +11 -78
- data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_request.rb +31 -78
- data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/messages_list.rb +11 -78
- data/lib/bandwidth-sdk/models/messaging_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/messaging_request_error.rb +31 -78
- data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mfa_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mms_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/mms_message_content_file.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_action.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +41 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_mms_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_mms_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_base.rb +41 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_owner_object.rb +21 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object_all_of_content.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_request_object.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_response_object.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_error.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_channel_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/multi_channel_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_request.rb +21 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +41 -78
- data/lib/bandwidth-sdk/models/opt_in_workflow.rb +25 -82
- data/lib/bandwidth-sdk/models/page_info.rb +11 -78
- data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/product_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_base.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_action_dial.rb +31 -78
- data/lib/bandwidth-sdk/models/rbm_action_open_url.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_action_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_view_location.rb +41 -78
- data/lib/bandwidth-sdk/models/rbm_card_content.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_card_content_media.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_location_response.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_media_height_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_message_carousel_card.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_message_content_file.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_message_content_rich_card.rb +3 -4
- data/lib/bandwidth-sdk/models/rbm_message_content_text.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_message_media.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_standalone_card.rb +41 -78
- data/lib/bandwidth-sdk/models/rbm_suggestion_response.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_transcriptions.rb +11 -78
- data/lib/bandwidth-sdk/models/redirect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/sms_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/standalone_card_orientation_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/status_callback.rb +61 -78
- data/lib/bandwidth-sdk/models/status_callback_message.rb +81 -78
- data/lib/bandwidth-sdk/models/status_callback_type_enum.rb +6 -6
- data/lib/bandwidth-sdk/models/stir_shaken.rb +11 -78
- data/lib/bandwidth-sdk/models/sync_lookup_request.rb +11 -78
- data/lib/bandwidth-sdk/models/telephone_number.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_basic_authentication.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_callback_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/tfv_error.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_status.rb +13 -80
- data/lib/bandwidth-sdk/models/tfv_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/tfv_submission_info.rb +21 -88
- data/lib/bandwidth-sdk/models/tfv_submission_wrapper.rb +11 -78
- data/lib/bandwidth-sdk/models/thumbnail_alignment_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/transcribe_recording.rb +11 -78
- data/lib/bandwidth-sdk/models/transcription.rb +11 -78
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/update_call.rb +11 -78
- data/lib/bandwidth-sdk/models/update_call_recording.rb +21 -78
- data/lib/bandwidth-sdk/models/update_conference.rb +11 -78
- data/lib/bandwidth-sdk/models/update_conference_member.rb +11 -78
- data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/verification_request.rb +51 -88
- data/lib/bandwidth-sdk/models/verification_update_request.rb +51 -88
- data/lib/bandwidth-sdk/models/verification_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/verify_code_request.rb +13 -80
- data/lib/bandwidth-sdk/models/verify_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/voice_api_error.rb +11 -78
- data/lib/bandwidth-sdk/models/voice_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/webhook_subscription.rb +13 -80
- data/lib/bandwidth-sdk/models/webhook_subscription_basic_authentication.rb +11 -78
- data/lib/bandwidth-sdk/models/webhook_subscription_request_schema.rb +15 -82
- data/lib/bandwidth-sdk/models/webhook_subscription_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +21 -78
- data/lib/bandwidth-sdk/version.rb +2 -2
- data/lib/bandwidth-sdk.rb +2 -1
- data/openapitools.json +1 -1
- data/spec/smoke/calls_api_spec.rb +50 -76
- data/spec/smoke/conferences_api_spec.rb +7 -5
- data/spec/smoke/media_api_spec.rb +4 -2
- data/spec/smoke/messages_api_spec.rb +9 -4
- data/spec/smoke/mfa_api_spec.rb +9 -4
- data/spec/smoke/multi_channel_api_spec.rb +4 -2
- data/spec/smoke/phone_number_lookup_api_spec.rb +6 -4
- data/spec/smoke/recordings_api_spec.rb +7 -33
- data/spec/smoke/statistics_api_spec.rb +16 -8
- data/spec/smoke/toll_free_verification_api_spec.rb +6 -4
- data/spec/smoke/transcriptions_api_spec.rb +7 -5
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/models/verify_code_request_spec.rb +1 -1
- metadata +5 -2
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
|
7
7
|
Contact: letstalk@bandwidth.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.17.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
|
-
class Diversion
|
|
17
|
+
class Diversion < ApiModelBase
|
|
18
18
|
# The reason for the diversion. Common values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away.
|
|
19
19
|
attr_accessor :reason
|
|
20
20
|
|
|
@@ -49,9 +49,14 @@ module Bandwidth
|
|
|
49
49
|
}
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
52
57
|
# Returns all the JSON keys this model knows about
|
|
53
58
|
def self.acceptable_attributes
|
|
54
|
-
|
|
59
|
+
acceptable_attribute_map.values
|
|
55
60
|
end
|
|
56
61
|
|
|
57
62
|
# Attribute type mapping.
|
|
@@ -81,9 +86,10 @@ module Bandwidth
|
|
|
81
86
|
end
|
|
82
87
|
|
|
83
88
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
89
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
84
90
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
85
|
-
if (!
|
|
86
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Diversion`. Please check the name to make sure it's valid. List of attributes: " +
|
|
91
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Diversion`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
87
93
|
end
|
|
88
94
|
h[k.to_sym] = v
|
|
89
95
|
}
|
|
@@ -181,61 +187,6 @@ module Bandwidth
|
|
|
181
187
|
new(transformed_hash)
|
|
182
188
|
end
|
|
183
189
|
|
|
184
|
-
# Deserializes the data based on type
|
|
185
|
-
# @param string type Data type
|
|
186
|
-
# @param string value Value to be deserialized
|
|
187
|
-
# @return [Object] Deserialized data
|
|
188
|
-
def self._deserialize(type, value)
|
|
189
|
-
case type.to_sym
|
|
190
|
-
when :Time
|
|
191
|
-
Time.parse(value)
|
|
192
|
-
when :Date
|
|
193
|
-
Date.parse(value)
|
|
194
|
-
when :String
|
|
195
|
-
value.to_s
|
|
196
|
-
when :Integer
|
|
197
|
-
value.to_i
|
|
198
|
-
when :Float
|
|
199
|
-
value.to_f
|
|
200
|
-
when :Boolean
|
|
201
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
202
|
-
true
|
|
203
|
-
else
|
|
204
|
-
false
|
|
205
|
-
end
|
|
206
|
-
when :Object
|
|
207
|
-
# generic object (usually a Hash), return directly
|
|
208
|
-
value
|
|
209
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
210
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
211
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
212
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
213
|
-
k_type = Regexp.last_match[:k_type]
|
|
214
|
-
v_type = Regexp.last_match[:v_type]
|
|
215
|
-
{}.tap do |hash|
|
|
216
|
-
value.each do |k, v|
|
|
217
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
218
|
-
end
|
|
219
|
-
end
|
|
220
|
-
else # model
|
|
221
|
-
# models (e.g. Pet) or oneOf
|
|
222
|
-
klass = Bandwidth.const_get(type)
|
|
223
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
224
|
-
end
|
|
225
|
-
end
|
|
226
|
-
|
|
227
|
-
# Returns the string representation of the object
|
|
228
|
-
# @return [String] String presentation of the object
|
|
229
|
-
def to_s
|
|
230
|
-
to_hash.to_s
|
|
231
|
-
end
|
|
232
|
-
|
|
233
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
234
|
-
# @return [Hash] Returns the object in the form of hash
|
|
235
|
-
def to_body
|
|
236
|
-
to_hash
|
|
237
|
-
end
|
|
238
|
-
|
|
239
190
|
# Returns the object in the form of hash
|
|
240
191
|
# @return [Hash] Returns the object in the form of hash
|
|
241
192
|
def to_hash
|
|
@@ -251,23 +202,5 @@ module Bandwidth
|
|
|
251
202
|
end
|
|
252
203
|
hash
|
|
253
204
|
end
|
|
254
|
-
|
|
255
|
-
# Outputs non-array value in the form of hash
|
|
256
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
257
|
-
# @param [Object] value Any valid value
|
|
258
|
-
# @return [Hash] Returns the value in the form of hash
|
|
259
|
-
def _to_hash(value)
|
|
260
|
-
if value.is_a?(Array)
|
|
261
|
-
value.compact.map { |v| _to_hash(v) }
|
|
262
|
-
elsif value.is_a?(Hash)
|
|
263
|
-
{}.tap do |hash|
|
|
264
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
265
|
-
end
|
|
266
|
-
elsif value.respond_to? :to_hash
|
|
267
|
-
value.to_hash
|
|
268
|
-
else
|
|
269
|
-
value
|
|
270
|
-
end
|
|
271
|
-
end
|
|
272
205
|
end
|
|
273
206
|
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 DTMF event is sent for every digit detected after a <StartGather> verb is executed. You may not respond to this event with BXML.
|
|
18
|
-
class DtmfCallback
|
|
18
|
+
class DtmfCallback < 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
|
|
|
@@ -111,9 +111,14 @@ module Bandwidth
|
|
|
111
111
|
}
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
+
# Returns attribute mapping this model knows about
|
|
115
|
+
def self.acceptable_attribute_map
|
|
116
|
+
attribute_map
|
|
117
|
+
end
|
|
118
|
+
|
|
114
119
|
# Returns all the JSON keys this model knows about
|
|
115
120
|
def self.acceptable_attributes
|
|
116
|
-
|
|
121
|
+
acceptable_attribute_map.values
|
|
117
122
|
end
|
|
118
123
|
|
|
119
124
|
# Attribute type mapping.
|
|
@@ -156,9 +161,10 @@ module Bandwidth
|
|
|
156
161
|
end
|
|
157
162
|
|
|
158
163
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
164
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
159
165
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
160
|
-
if (!
|
|
161
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DtmfCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
166
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
167
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DtmfCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
162
168
|
end
|
|
163
169
|
h[k.to_sym] = v
|
|
164
170
|
}
|
|
@@ -306,61 +312,6 @@ module Bandwidth
|
|
|
306
312
|
new(transformed_hash)
|
|
307
313
|
end
|
|
308
314
|
|
|
309
|
-
# Deserializes the data based on type
|
|
310
|
-
# @param string type Data type
|
|
311
|
-
# @param string value Value to be deserialized
|
|
312
|
-
# @return [Object] Deserialized data
|
|
313
|
-
def self._deserialize(type, value)
|
|
314
|
-
case type.to_sym
|
|
315
|
-
when :Time
|
|
316
|
-
Time.parse(value)
|
|
317
|
-
when :Date
|
|
318
|
-
Date.parse(value)
|
|
319
|
-
when :String
|
|
320
|
-
value.to_s
|
|
321
|
-
when :Integer
|
|
322
|
-
value.to_i
|
|
323
|
-
when :Float
|
|
324
|
-
value.to_f
|
|
325
|
-
when :Boolean
|
|
326
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
327
|
-
true
|
|
328
|
-
else
|
|
329
|
-
false
|
|
330
|
-
end
|
|
331
|
-
when :Object
|
|
332
|
-
# generic object (usually a Hash), return directly
|
|
333
|
-
value
|
|
334
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
335
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
336
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
337
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
338
|
-
k_type = Regexp.last_match[:k_type]
|
|
339
|
-
v_type = Regexp.last_match[:v_type]
|
|
340
|
-
{}.tap do |hash|
|
|
341
|
-
value.each do |k, v|
|
|
342
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
343
|
-
end
|
|
344
|
-
end
|
|
345
|
-
else # model
|
|
346
|
-
# models (e.g. Pet) or oneOf
|
|
347
|
-
klass = Bandwidth.const_get(type)
|
|
348
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
349
|
-
end
|
|
350
|
-
end
|
|
351
|
-
|
|
352
|
-
# Returns the string representation of the object
|
|
353
|
-
# @return [String] String presentation of the object
|
|
354
|
-
def to_s
|
|
355
|
-
to_hash.to_s
|
|
356
|
-
end
|
|
357
|
-
|
|
358
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
359
|
-
# @return [Hash] Returns the object in the form of hash
|
|
360
|
-
def to_body
|
|
361
|
-
to_hash
|
|
362
|
-
end
|
|
363
|
-
|
|
364
315
|
# Returns the object in the form of hash
|
|
365
316
|
# @return [Hash] Returns the object in the form of hash
|
|
366
317
|
def to_hash
|
|
@@ -376,23 +327,5 @@ module Bandwidth
|
|
|
376
327
|
end
|
|
377
328
|
hash
|
|
378
329
|
end
|
|
379
|
-
|
|
380
|
-
# Outputs non-array value in the form of hash
|
|
381
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
382
|
-
# @param [Object] value Any valid value
|
|
383
|
-
# @return [Hash] Returns the value in the form of hash
|
|
384
|
-
def _to_hash(value)
|
|
385
|
-
if value.is_a?(Array)
|
|
386
|
-
value.compact.map { |v| _to_hash(v) }
|
|
387
|
-
elsif value.is_a?(Hash)
|
|
388
|
-
{}.tap do |hash|
|
|
389
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
390
|
-
end
|
|
391
|
-
elsif value.respond_to? :to_hash
|
|
392
|
-
value.to_hash
|
|
393
|
-
else
|
|
394
|
-
value
|
|
395
|
-
end
|
|
396
|
-
end
|
|
397
330
|
end
|
|
398
331
|
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 Error
|
|
17
|
+
class Error < ApiModelBase
|
|
18
18
|
attr_accessor :code
|
|
19
19
|
|
|
20
20
|
attr_accessor :description
|
|
@@ -30,9 +30,14 @@ module Bandwidth
|
|
|
30
30
|
}
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
33
38
|
# Returns all the JSON keys this model knows about
|
|
34
39
|
def self.acceptable_attributes
|
|
35
|
-
|
|
40
|
+
acceptable_attribute_map.values
|
|
36
41
|
end
|
|
37
42
|
|
|
38
43
|
# Attribute type mapping.
|
|
@@ -58,9 +63,10 @@ module Bandwidth
|
|
|
58
63
|
end
|
|
59
64
|
|
|
60
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
61
67
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
62
|
-
if (!
|
|
63
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Error`. Please check the name to make sure it's valid. List of attributes: " +
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
64
70
|
end
|
|
65
71
|
h[k.to_sym] = v
|
|
66
72
|
}
|
|
@@ -140,61 +146,6 @@ module Bandwidth
|
|
|
140
146
|
new(transformed_hash)
|
|
141
147
|
end
|
|
142
148
|
|
|
143
|
-
# Deserializes the data based on type
|
|
144
|
-
# @param string type Data type
|
|
145
|
-
# @param string value Value to be deserialized
|
|
146
|
-
# @return [Object] Deserialized data
|
|
147
|
-
def self._deserialize(type, value)
|
|
148
|
-
case type.to_sym
|
|
149
|
-
when :Time
|
|
150
|
-
Time.parse(value)
|
|
151
|
-
when :Date
|
|
152
|
-
Date.parse(value)
|
|
153
|
-
when :String
|
|
154
|
-
value.to_s
|
|
155
|
-
when :Integer
|
|
156
|
-
value.to_i
|
|
157
|
-
when :Float
|
|
158
|
-
value.to_f
|
|
159
|
-
when :Boolean
|
|
160
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
161
|
-
true
|
|
162
|
-
else
|
|
163
|
-
false
|
|
164
|
-
end
|
|
165
|
-
when :Object
|
|
166
|
-
# generic object (usually a Hash), return directly
|
|
167
|
-
value
|
|
168
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
169
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
170
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
171
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
172
|
-
k_type = Regexp.last_match[:k_type]
|
|
173
|
-
v_type = Regexp.last_match[:v_type]
|
|
174
|
-
{}.tap do |hash|
|
|
175
|
-
value.each do |k, v|
|
|
176
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
177
|
-
end
|
|
178
|
-
end
|
|
179
|
-
else # model
|
|
180
|
-
# models (e.g. Pet) or oneOf
|
|
181
|
-
klass = Bandwidth.const_get(type)
|
|
182
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
183
|
-
end
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
# Returns the string representation of the object
|
|
187
|
-
# @return [String] String presentation of the object
|
|
188
|
-
def to_s
|
|
189
|
-
to_hash.to_s
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
193
|
-
# @return [Hash] Returns the object in the form of hash
|
|
194
|
-
def to_body
|
|
195
|
-
to_hash
|
|
196
|
-
end
|
|
197
|
-
|
|
198
149
|
# Returns the object in the form of hash
|
|
199
150
|
# @return [Hash] Returns the object in the form of hash
|
|
200
151
|
def to_hash
|
|
@@ -210,23 +161,5 @@ module Bandwidth
|
|
|
210
161
|
end
|
|
211
162
|
hash
|
|
212
163
|
end
|
|
213
|
-
|
|
214
|
-
# Outputs non-array value in the form of hash
|
|
215
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
216
|
-
# @param [Object] value Any valid value
|
|
217
|
-
# @return [Hash] Returns the value in the form of hash
|
|
218
|
-
def _to_hash(value)
|
|
219
|
-
if value.is_a?(Array)
|
|
220
|
-
value.compact.map { |v| _to_hash(v) }
|
|
221
|
-
elsif value.is_a?(Hash)
|
|
222
|
-
{}.tap do |hash|
|
|
223
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
224
|
-
end
|
|
225
|
-
elsif value.respond_to? :to_hash
|
|
226
|
-
value.to_hash
|
|
227
|
-
else
|
|
228
|
-
value
|
|
229
|
-
end
|
|
230
|
-
end
|
|
231
164
|
end
|
|
232
165
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
|
7
7
|
Contact: letstalk@bandwidth.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.17.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
|
-
class ErrorObject
|
|
17
|
+
class ErrorObject < ApiModelBase
|
|
18
18
|
# A concise summary of the error used for categorization.
|
|
19
19
|
attr_accessor :type
|
|
20
20
|
|
|
@@ -32,9 +32,14 @@ module Bandwidth
|
|
|
32
32
|
}
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
# Returns attribute mapping this model knows about
|
|
36
|
+
def self.acceptable_attribute_map
|
|
37
|
+
attribute_map
|
|
38
|
+
end
|
|
39
|
+
|
|
35
40
|
# Returns all the JSON keys this model knows about
|
|
36
41
|
def self.acceptable_attributes
|
|
37
|
-
|
|
42
|
+
acceptable_attribute_map.values
|
|
38
43
|
end
|
|
39
44
|
|
|
40
45
|
# Attribute type mapping.
|
|
@@ -60,9 +65,10 @@ module Bandwidth
|
|
|
60
65
|
end
|
|
61
66
|
|
|
62
67
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
68
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
69
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
-
if (!
|
|
65
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ErrorObject`. Please check the name to make sure it's valid. List of attributes: " +
|
|
70
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ErrorObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
72
|
end
|
|
67
73
|
h[k.to_sym] = v
|
|
68
74
|
}
|
|
@@ -116,6 +122,36 @@ module Bandwidth
|
|
|
116
122
|
true
|
|
117
123
|
end
|
|
118
124
|
|
|
125
|
+
# Custom attribute writer method with validation
|
|
126
|
+
# @param [Object] type Value to be assigned
|
|
127
|
+
def type=(type)
|
|
128
|
+
if type.nil?
|
|
129
|
+
fail ArgumentError, 'type cannot be nil'
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
@type = type
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Custom attribute writer method with validation
|
|
136
|
+
# @param [Object] description Value to be assigned
|
|
137
|
+
def description=(description)
|
|
138
|
+
if description.nil?
|
|
139
|
+
fail ArgumentError, 'description cannot be nil'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
@description = description
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Custom attribute writer method with validation
|
|
146
|
+
# @param [Object] source Value to be assigned
|
|
147
|
+
def source=(source)
|
|
148
|
+
if source.nil?
|
|
149
|
+
fail ArgumentError, 'source cannot be nil'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
@source = source
|
|
153
|
+
end
|
|
154
|
+
|
|
119
155
|
# Checks equality by comparing each attribute.
|
|
120
156
|
# @param [Object] Object to be compared
|
|
121
157
|
def ==(o)
|
|
@@ -161,61 +197,6 @@ module Bandwidth
|
|
|
161
197
|
new(transformed_hash)
|
|
162
198
|
end
|
|
163
199
|
|
|
164
|
-
# Deserializes the data based on type
|
|
165
|
-
# @param string type Data type
|
|
166
|
-
# @param string value Value to be deserialized
|
|
167
|
-
# @return [Object] Deserialized data
|
|
168
|
-
def self._deserialize(type, value)
|
|
169
|
-
case type.to_sym
|
|
170
|
-
when :Time
|
|
171
|
-
Time.parse(value)
|
|
172
|
-
when :Date
|
|
173
|
-
Date.parse(value)
|
|
174
|
-
when :String
|
|
175
|
-
value.to_s
|
|
176
|
-
when :Integer
|
|
177
|
-
value.to_i
|
|
178
|
-
when :Float
|
|
179
|
-
value.to_f
|
|
180
|
-
when :Boolean
|
|
181
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
182
|
-
true
|
|
183
|
-
else
|
|
184
|
-
false
|
|
185
|
-
end
|
|
186
|
-
when :Object
|
|
187
|
-
# generic object (usually a Hash), return directly
|
|
188
|
-
value
|
|
189
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
190
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
191
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
192
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
193
|
-
k_type = Regexp.last_match[:k_type]
|
|
194
|
-
v_type = Regexp.last_match[:v_type]
|
|
195
|
-
{}.tap do |hash|
|
|
196
|
-
value.each do |k, v|
|
|
197
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
198
|
-
end
|
|
199
|
-
end
|
|
200
|
-
else # model
|
|
201
|
-
# models (e.g. Pet) or oneOf
|
|
202
|
-
klass = Bandwidth.const_get(type)
|
|
203
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
204
|
-
end
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
# Returns the string representation of the object
|
|
208
|
-
# @return [String] String presentation of the object
|
|
209
|
-
def to_s
|
|
210
|
-
to_hash.to_s
|
|
211
|
-
end
|
|
212
|
-
|
|
213
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
214
|
-
# @return [Hash] Returns the object in the form of hash
|
|
215
|
-
def to_body
|
|
216
|
-
to_hash
|
|
217
|
-
end
|
|
218
|
-
|
|
219
200
|
# Returns the object in the form of hash
|
|
220
201
|
# @return [Hash] Returns the object in the form of hash
|
|
221
202
|
def to_hash
|
|
@@ -231,23 +212,5 @@ module Bandwidth
|
|
|
231
212
|
end
|
|
232
213
|
hash
|
|
233
214
|
end
|
|
234
|
-
|
|
235
|
-
# Outputs non-array value in the form of hash
|
|
236
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
237
|
-
# @param [Object] value Any valid value
|
|
238
|
-
# @return [Hash] Returns the value in the form of hash
|
|
239
|
-
def _to_hash(value)
|
|
240
|
-
if value.is_a?(Array)
|
|
241
|
-
value.compact.map { |v| _to_hash(v) }
|
|
242
|
-
elsif value.is_a?(Hash)
|
|
243
|
-
{}.tap do |hash|
|
|
244
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
245
|
-
end
|
|
246
|
-
elsif value.respond_to? :to_hash
|
|
247
|
-
value.to_hash
|
|
248
|
-
else
|
|
249
|
-
value
|
|
250
|
-
end
|
|
251
|
-
end
|
|
252
215
|
end
|
|
253
216
|
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
|
# Specifies relevant sources of the error, if any.
|
|
18
|
-
class ErrorSource
|
|
18
|
+
class ErrorSource < ApiModelBase
|
|
19
19
|
# The relevant URI query parameter causing the error
|
|
20
20
|
attr_accessor :parameter
|
|
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::ErrorSource`. 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::ErrorSource`. 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
|