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 FailureWebhook
|
|
17
|
+
class FailureWebhook < ApiModelBase
|
|
18
18
|
# User's account ID.
|
|
19
19
|
attr_accessor :account_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.
|
|
@@ -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::FailureWebhook`. 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::FailureWebhook`. 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
|
}
|
|
@@ -120,7 +126,7 @@ module Bandwidth
|
|
|
120
126
|
end
|
|
121
127
|
|
|
122
128
|
if !@phone_number.nil? && @phone_number.to_s.length < 12
|
|
123
|
-
invalid_properties.push('invalid value for "phone_number", the character length must be
|
|
129
|
+
invalid_properties.push('invalid value for "phone_number", the character length must be greater than or equal to 12.')
|
|
124
130
|
end
|
|
125
131
|
|
|
126
132
|
pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
|
|
@@ -153,7 +159,7 @@ module Bandwidth
|
|
|
153
159
|
end
|
|
154
160
|
|
|
155
161
|
if phone_number.to_s.length < 12
|
|
156
|
-
fail ArgumentError, 'invalid value for "phone_number", the character length must be
|
|
162
|
+
fail ArgumentError, 'invalid value for "phone_number", the character length must be greater than or equal to 12.'
|
|
157
163
|
end
|
|
158
164
|
|
|
159
165
|
pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
|
|
@@ -212,61 +218,6 @@ module Bandwidth
|
|
|
212
218
|
new(transformed_hash)
|
|
213
219
|
end
|
|
214
220
|
|
|
215
|
-
# Deserializes the data based on type
|
|
216
|
-
# @param string type Data type
|
|
217
|
-
# @param string value Value to be deserialized
|
|
218
|
-
# @return [Object] Deserialized data
|
|
219
|
-
def self._deserialize(type, value)
|
|
220
|
-
case type.to_sym
|
|
221
|
-
when :Time
|
|
222
|
-
Time.parse(value)
|
|
223
|
-
when :Date
|
|
224
|
-
Date.parse(value)
|
|
225
|
-
when :String
|
|
226
|
-
value.to_s
|
|
227
|
-
when :Integer
|
|
228
|
-
value.to_i
|
|
229
|
-
when :Float
|
|
230
|
-
value.to_f
|
|
231
|
-
when :Boolean
|
|
232
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
233
|
-
true
|
|
234
|
-
else
|
|
235
|
-
false
|
|
236
|
-
end
|
|
237
|
-
when :Object
|
|
238
|
-
# generic object (usually a Hash), return directly
|
|
239
|
-
value
|
|
240
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
241
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
242
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
243
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
244
|
-
k_type = Regexp.last_match[:k_type]
|
|
245
|
-
v_type = Regexp.last_match[:v_type]
|
|
246
|
-
{}.tap do |hash|
|
|
247
|
-
value.each do |k, v|
|
|
248
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
249
|
-
end
|
|
250
|
-
end
|
|
251
|
-
else # model
|
|
252
|
-
# models (e.g. Pet) or oneOf
|
|
253
|
-
klass = Bandwidth.const_get(type)
|
|
254
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
255
|
-
end
|
|
256
|
-
end
|
|
257
|
-
|
|
258
|
-
# Returns the string representation of the object
|
|
259
|
-
# @return [String] String presentation of the object
|
|
260
|
-
def to_s
|
|
261
|
-
to_hash.to_s
|
|
262
|
-
end
|
|
263
|
-
|
|
264
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
265
|
-
# @return [Hash] Returns the object in the form of hash
|
|
266
|
-
def to_body
|
|
267
|
-
to_hash
|
|
268
|
-
end
|
|
269
|
-
|
|
270
221
|
# Returns the object in the form of hash
|
|
271
222
|
# @return [Hash] Returns the object in the form of hash
|
|
272
223
|
def to_hash
|
|
@@ -282,23 +233,5 @@ module Bandwidth
|
|
|
282
233
|
end
|
|
283
234
|
hash
|
|
284
235
|
end
|
|
285
|
-
|
|
286
|
-
# Outputs non-array value in the form of hash
|
|
287
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
288
|
-
# @param [Object] value Any valid value
|
|
289
|
-
# @return [Hash] Returns the value in the form of hash
|
|
290
|
-
def _to_hash(value)
|
|
291
|
-
if value.is_a?(Array)
|
|
292
|
-
value.compact.map { |v| _to_hash(v) }
|
|
293
|
-
elsif value.is_a?(Hash)
|
|
294
|
-
{}.tap do |hash|
|
|
295
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
296
|
-
end
|
|
297
|
-
elsif value.respond_to? :to_hash
|
|
298
|
-
value.to_hash
|
|
299
|
-
else
|
|
300
|
-
value
|
|
301
|
-
end
|
|
302
|
-
end
|
|
303
236
|
end
|
|
304
237
|
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 FieldError
|
|
17
|
+
class FieldError < ApiModelBase
|
|
18
18
|
# The name of the field that contains the error
|
|
19
19
|
attr_accessor :field_name
|
|
20
20
|
|
|
@@ -29,9 +29,14 @@ module Bandwidth
|
|
|
29
29
|
}
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
32
37
|
# Returns all the JSON keys this model knows about
|
|
33
38
|
def self.acceptable_attributes
|
|
34
|
-
|
|
39
|
+
acceptable_attribute_map.values
|
|
35
40
|
end
|
|
36
41
|
|
|
37
42
|
# Attribute type mapping.
|
|
@@ -56,9 +61,10 @@ module Bandwidth
|
|
|
56
61
|
end
|
|
57
62
|
|
|
58
63
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
65
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
-
if (!
|
|
61
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::FieldError`. Please check the name to make sure it's valid. List of attributes: " +
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::FieldError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
68
|
end
|
|
63
69
|
h[k.to_sym] = v
|
|
64
70
|
}
|
|
@@ -131,61 +137,6 @@ module Bandwidth
|
|
|
131
137
|
new(transformed_hash)
|
|
132
138
|
end
|
|
133
139
|
|
|
134
|
-
# Deserializes the data based on type
|
|
135
|
-
# @param string type Data type
|
|
136
|
-
# @param string value Value to be deserialized
|
|
137
|
-
# @return [Object] Deserialized data
|
|
138
|
-
def self._deserialize(type, value)
|
|
139
|
-
case type.to_sym
|
|
140
|
-
when :Time
|
|
141
|
-
Time.parse(value)
|
|
142
|
-
when :Date
|
|
143
|
-
Date.parse(value)
|
|
144
|
-
when :String
|
|
145
|
-
value.to_s
|
|
146
|
-
when :Integer
|
|
147
|
-
value.to_i
|
|
148
|
-
when :Float
|
|
149
|
-
value.to_f
|
|
150
|
-
when :Boolean
|
|
151
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
152
|
-
true
|
|
153
|
-
else
|
|
154
|
-
false
|
|
155
|
-
end
|
|
156
|
-
when :Object
|
|
157
|
-
# generic object (usually a Hash), return directly
|
|
158
|
-
value
|
|
159
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
160
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
161
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
162
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
163
|
-
k_type = Regexp.last_match[:k_type]
|
|
164
|
-
v_type = Regexp.last_match[:v_type]
|
|
165
|
-
{}.tap do |hash|
|
|
166
|
-
value.each do |k, v|
|
|
167
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
168
|
-
end
|
|
169
|
-
end
|
|
170
|
-
else # model
|
|
171
|
-
# models (e.g. Pet) or oneOf
|
|
172
|
-
klass = Bandwidth.const_get(type)
|
|
173
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
174
|
-
end
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
# Returns the string representation of the object
|
|
178
|
-
# @return [String] String presentation of the object
|
|
179
|
-
def to_s
|
|
180
|
-
to_hash.to_s
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
184
|
-
# @return [Hash] Returns the object in the form of hash
|
|
185
|
-
def to_body
|
|
186
|
-
to_hash
|
|
187
|
-
end
|
|
188
|
-
|
|
189
140
|
# Returns the object in the form of hash
|
|
190
141
|
# @return [Hash] Returns the object in the form of hash
|
|
191
142
|
def to_hash
|
|
@@ -201,23 +152,5 @@ module Bandwidth
|
|
|
201
152
|
end
|
|
202
153
|
hash
|
|
203
154
|
end
|
|
204
|
-
|
|
205
|
-
# Outputs non-array value in the form of hash
|
|
206
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
207
|
-
# @param [Object] value Any valid value
|
|
208
|
-
# @return [Hash] Returns the value in the form of hash
|
|
209
|
-
def _to_hash(value)
|
|
210
|
-
if value.is_a?(Array)
|
|
211
|
-
value.compact.map { |v| _to_hash(v) }
|
|
212
|
-
elsif value.is_a?(Hash)
|
|
213
|
-
{}.tap do |hash|
|
|
214
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
215
|
-
end
|
|
216
|
-
elsif value.respond_to? :to_hash
|
|
217
|
-
value.to_hash
|
|
218
|
-
else
|
|
219
|
-
value
|
|
220
|
-
end
|
|
221
|
-
end
|
|
222
155
|
end
|
|
223
156
|
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 gather event is sent after a <Gather> verb is executed. Its purpose is to report the gathered digits to the calling application.
|
|
18
|
-
class GatherCallback
|
|
18
|
+
class GatherCallback < 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
|
|
|
@@ -115,9 +115,14 @@ module Bandwidth
|
|
|
115
115
|
}
|
|
116
116
|
end
|
|
117
117
|
|
|
118
|
+
# Returns attribute mapping this model knows about
|
|
119
|
+
def self.acceptable_attribute_map
|
|
120
|
+
attribute_map
|
|
121
|
+
end
|
|
122
|
+
|
|
118
123
|
# Returns all the JSON keys this model knows about
|
|
119
124
|
def self.acceptable_attributes
|
|
120
|
-
|
|
125
|
+
acceptable_attribute_map.values
|
|
121
126
|
end
|
|
122
127
|
|
|
123
128
|
# Attribute type mapping.
|
|
@@ -161,9 +166,10 @@ module Bandwidth
|
|
|
161
166
|
end
|
|
162
167
|
|
|
163
168
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
169
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
164
170
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
165
|
-
if (!
|
|
166
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::GatherCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
171
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
172
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::GatherCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
167
173
|
end
|
|
168
174
|
h[k.to_sym] = v
|
|
169
175
|
}
|
|
@@ -316,61 +322,6 @@ module Bandwidth
|
|
|
316
322
|
new(transformed_hash)
|
|
317
323
|
end
|
|
318
324
|
|
|
319
|
-
# Deserializes the data based on type
|
|
320
|
-
# @param string type Data type
|
|
321
|
-
# @param string value Value to be deserialized
|
|
322
|
-
# @return [Object] Deserialized data
|
|
323
|
-
def self._deserialize(type, value)
|
|
324
|
-
case type.to_sym
|
|
325
|
-
when :Time
|
|
326
|
-
Time.parse(value)
|
|
327
|
-
when :Date
|
|
328
|
-
Date.parse(value)
|
|
329
|
-
when :String
|
|
330
|
-
value.to_s
|
|
331
|
-
when :Integer
|
|
332
|
-
value.to_i
|
|
333
|
-
when :Float
|
|
334
|
-
value.to_f
|
|
335
|
-
when :Boolean
|
|
336
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
337
|
-
true
|
|
338
|
-
else
|
|
339
|
-
false
|
|
340
|
-
end
|
|
341
|
-
when :Object
|
|
342
|
-
# generic object (usually a Hash), return directly
|
|
343
|
-
value
|
|
344
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
345
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
346
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
347
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
348
|
-
k_type = Regexp.last_match[:k_type]
|
|
349
|
-
v_type = Regexp.last_match[:v_type]
|
|
350
|
-
{}.tap do |hash|
|
|
351
|
-
value.each do |k, v|
|
|
352
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
353
|
-
end
|
|
354
|
-
end
|
|
355
|
-
else # model
|
|
356
|
-
# models (e.g. Pet) or oneOf
|
|
357
|
-
klass = Bandwidth.const_get(type)
|
|
358
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
359
|
-
end
|
|
360
|
-
end
|
|
361
|
-
|
|
362
|
-
# Returns the string representation of the object
|
|
363
|
-
# @return [String] String presentation of the object
|
|
364
|
-
def to_s
|
|
365
|
-
to_hash.to_s
|
|
366
|
-
end
|
|
367
|
-
|
|
368
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
369
|
-
# @return [Hash] Returns the object in the form of hash
|
|
370
|
-
def to_body
|
|
371
|
-
to_hash
|
|
372
|
-
end
|
|
373
|
-
|
|
374
325
|
# Returns the object in the form of hash
|
|
375
326
|
# @return [Hash] Returns the object in the form of hash
|
|
376
327
|
def to_hash
|
|
@@ -386,23 +337,5 @@ module Bandwidth
|
|
|
386
337
|
end
|
|
387
338
|
hash
|
|
388
339
|
end
|
|
389
|
-
|
|
390
|
-
# Outputs non-array value in the form of hash
|
|
391
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
392
|
-
# @param [Object] value Any valid value
|
|
393
|
-
# @return [Hash] Returns the value in the form of hash
|
|
394
|
-
def _to_hash(value)
|
|
395
|
-
if value.is_a?(Array)
|
|
396
|
-
value.compact.map { |v| _to_hash(v) }
|
|
397
|
-
elsif value.is_a?(Hash)
|
|
398
|
-
{}.tap do |hash|
|
|
399
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
400
|
-
end
|
|
401
|
-
elsif value.respond_to? :to_hash
|
|
402
|
-
value.to_hash
|
|
403
|
-
else
|
|
404
|
-
value
|
|
405
|
-
end
|
|
406
|
-
end
|
|
407
340
|
end
|
|
408
341
|
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 GetAsyncBulkLookupResponse
|
|
17
|
+
class GetAsyncBulkLookupResponse < ApiModelBase
|
|
18
18
|
attr_accessor :links
|
|
19
19
|
|
|
20
20
|
attr_accessor :data
|
|
@@ -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::GetAsyncBulkLookupResponse`. 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::GetAsyncBulkLookupResponse`. 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
|
}
|
|
@@ -142,61 +148,6 @@ module Bandwidth
|
|
|
142
148
|
new(transformed_hash)
|
|
143
149
|
end
|
|
144
150
|
|
|
145
|
-
# Deserializes the data based on type
|
|
146
|
-
# @param string type Data type
|
|
147
|
-
# @param string value Value to be deserialized
|
|
148
|
-
# @return [Object] Deserialized data
|
|
149
|
-
def self._deserialize(type, value)
|
|
150
|
-
case type.to_sym
|
|
151
|
-
when :Time
|
|
152
|
-
Time.parse(value)
|
|
153
|
-
when :Date
|
|
154
|
-
Date.parse(value)
|
|
155
|
-
when :String
|
|
156
|
-
value.to_s
|
|
157
|
-
when :Integer
|
|
158
|
-
value.to_i
|
|
159
|
-
when :Float
|
|
160
|
-
value.to_f
|
|
161
|
-
when :Boolean
|
|
162
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
163
|
-
true
|
|
164
|
-
else
|
|
165
|
-
false
|
|
166
|
-
end
|
|
167
|
-
when :Object
|
|
168
|
-
# generic object (usually a Hash), return directly
|
|
169
|
-
value
|
|
170
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
171
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
172
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
173
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
174
|
-
k_type = Regexp.last_match[:k_type]
|
|
175
|
-
v_type = Regexp.last_match[:v_type]
|
|
176
|
-
{}.tap do |hash|
|
|
177
|
-
value.each do |k, v|
|
|
178
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
179
|
-
end
|
|
180
|
-
end
|
|
181
|
-
else # model
|
|
182
|
-
# models (e.g. Pet) or oneOf
|
|
183
|
-
klass = Bandwidth.const_get(type)
|
|
184
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
# Returns the string representation of the object
|
|
189
|
-
# @return [String] String presentation of the object
|
|
190
|
-
def to_s
|
|
191
|
-
to_hash.to_s
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
195
|
-
# @return [Hash] Returns the object in the form of hash
|
|
196
|
-
def to_body
|
|
197
|
-
to_hash
|
|
198
|
-
end
|
|
199
|
-
|
|
200
151
|
# Returns the object in the form of hash
|
|
201
152
|
# @return [Hash] Returns the object in the form of hash
|
|
202
153
|
def to_hash
|
|
@@ -212,23 +163,5 @@ module Bandwidth
|
|
|
212
163
|
end
|
|
213
164
|
hash
|
|
214
165
|
end
|
|
215
|
-
|
|
216
|
-
# Outputs non-array value in the form of hash
|
|
217
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
218
|
-
# @param [Object] value Any valid value
|
|
219
|
-
# @return [Hash] Returns the value in the form of hash
|
|
220
|
-
def _to_hash(value)
|
|
221
|
-
if value.is_a?(Array)
|
|
222
|
-
value.compact.map { |v| _to_hash(v) }
|
|
223
|
-
elsif value.is_a?(Hash)
|
|
224
|
-
{}.tap do |hash|
|
|
225
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
226
|
-
end
|
|
227
|
-
elsif value.respond_to? :to_hash
|
|
228
|
-
value.to_hash
|
|
229
|
-
else
|
|
230
|
-
value
|
|
231
|
-
end
|
|
232
|
-
end
|
|
233
166
|
end
|
|
234
167
|
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 phone number lookup response data
|
|
18
|
-
class GetAsyncBulkLookupResponseData
|
|
18
|
+
class GetAsyncBulkLookupResponseData < ApiModelBase
|
|
19
19
|
# The phone number lookup request ID from Bandwidth.
|
|
20
20
|
attr_accessor :request_id
|
|
21
21
|
|
|
@@ -55,9 +55,14 @@ module Bandwidth
|
|
|
55
55
|
}
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
# Returns attribute mapping this model knows about
|
|
59
|
+
def self.acceptable_attribute_map
|
|
60
|
+
attribute_map
|
|
61
|
+
end
|
|
62
|
+
|
|
58
63
|
# Returns all the JSON keys this model knows about
|
|
59
64
|
def self.acceptable_attributes
|
|
60
|
-
|
|
65
|
+
acceptable_attribute_map.values
|
|
61
66
|
end
|
|
62
67
|
|
|
63
68
|
# Attribute type mapping.
|
|
@@ -83,9 +88,10 @@ module Bandwidth
|
|
|
83
88
|
end
|
|
84
89
|
|
|
85
90
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
91
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
86
92
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
87
|
-
if (!
|
|
88
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::GetAsyncBulkLookupResponseData`. Please check the name to make sure it's valid. List of attributes: " +
|
|
93
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
94
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::GetAsyncBulkLookupResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
89
95
|
end
|
|
90
96
|
h[k.to_sym] = v
|
|
91
97
|
}
|
|
@@ -165,61 +171,6 @@ module Bandwidth
|
|
|
165
171
|
new(transformed_hash)
|
|
166
172
|
end
|
|
167
173
|
|
|
168
|
-
# Deserializes the data based on type
|
|
169
|
-
# @param string type Data type
|
|
170
|
-
# @param string value Value to be deserialized
|
|
171
|
-
# @return [Object] Deserialized data
|
|
172
|
-
def self._deserialize(type, value)
|
|
173
|
-
case type.to_sym
|
|
174
|
-
when :Time
|
|
175
|
-
Time.parse(value)
|
|
176
|
-
when :Date
|
|
177
|
-
Date.parse(value)
|
|
178
|
-
when :String
|
|
179
|
-
value.to_s
|
|
180
|
-
when :Integer
|
|
181
|
-
value.to_i
|
|
182
|
-
when :Float
|
|
183
|
-
value.to_f
|
|
184
|
-
when :Boolean
|
|
185
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
186
|
-
true
|
|
187
|
-
else
|
|
188
|
-
false
|
|
189
|
-
end
|
|
190
|
-
when :Object
|
|
191
|
-
# generic object (usually a Hash), return directly
|
|
192
|
-
value
|
|
193
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
194
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
195
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
196
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
197
|
-
k_type = Regexp.last_match[:k_type]
|
|
198
|
-
v_type = Regexp.last_match[:v_type]
|
|
199
|
-
{}.tap do |hash|
|
|
200
|
-
value.each do |k, v|
|
|
201
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
202
|
-
end
|
|
203
|
-
end
|
|
204
|
-
else # model
|
|
205
|
-
# models (e.g. Pet) or oneOf
|
|
206
|
-
klass = Bandwidth.const_get(type)
|
|
207
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
208
|
-
end
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
# Returns the string representation of the object
|
|
212
|
-
# @return [String] String presentation of the object
|
|
213
|
-
def to_s
|
|
214
|
-
to_hash.to_s
|
|
215
|
-
end
|
|
216
|
-
|
|
217
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
218
|
-
# @return [Hash] Returns the object in the form of hash
|
|
219
|
-
def to_body
|
|
220
|
-
to_hash
|
|
221
|
-
end
|
|
222
|
-
|
|
223
174
|
# Returns the object in the form of hash
|
|
224
175
|
# @return [Hash] Returns the object in the form of hash
|
|
225
176
|
def to_hash
|
|
@@ -235,23 +186,5 @@ module Bandwidth
|
|
|
235
186
|
end
|
|
236
187
|
hash
|
|
237
188
|
end
|
|
238
|
-
|
|
239
|
-
# Outputs non-array value in the form of hash
|
|
240
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
241
|
-
# @param [Object] value Any valid value
|
|
242
|
-
# @return [Hash] Returns the value in the form of hash
|
|
243
|
-
def _to_hash(value)
|
|
244
|
-
if value.is_a?(Array)
|
|
245
|
-
value.compact.map { |v| _to_hash(v) }
|
|
246
|
-
elsif value.is_a?(Hash)
|
|
247
|
-
{}.tap do |hash|
|
|
248
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
249
|
-
end
|
|
250
|
-
elsif value.respond_to? :to_hash
|
|
251
|
-
value.to_hash
|
|
252
|
-
else
|
|
253
|
-
value
|
|
254
|
-
end
|
|
255
|
-
end
|
|
256
189
|
end
|
|
257
190
|
end
|