bandwidth-sdk 17.0.1 → 17.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +18 -0
- data/bandwidth-sdk.gemspec +1 -2
- data/bandwidth.yml +7 -0
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +198 -387
- data/coverage/index.html +5842 -7703
- data/custom_templates/README.mustache +4 -1
- data/custom_templates/api_client.mustache +254 -0
- data/custom_templates/configuration.mustache +545 -0
- data/custom_templates/gem.mustache +2 -0
- data/docs/CallsApi.md +20 -5
- data/docs/ConferencesApi.md +36 -9
- data/docs/MFAApi.md +12 -3
- data/docs/MediaApi.md +16 -4
- data/docs/MessagesApi.md +8 -2
- data/docs/MultiChannelApi.md +4 -1
- data/docs/PhoneNumberLookupApi.md +12 -3
- data/docs/RecordingsApi.md +40 -10
- data/docs/StatisticsApi.md +4 -1
- data/docs/TollFreeVerificationApi.md +36 -9
- data/docs/TranscriptionsApi.md +12 -3
- data/lib/bandwidth-sdk/api/calls_api.rb +6 -6
- data/lib/bandwidth-sdk/api/conferences_api.rb +10 -10
- data/lib/bandwidth-sdk/api/media_api.rb +5 -5
- data/lib/bandwidth-sdk/api/messages_api.rb +3 -3
- data/lib/bandwidth-sdk/api/mfa_api.rb +4 -4
- data/lib/bandwidth-sdk/api/multi_channel_api.rb +2 -2
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +4 -4
- data/lib/bandwidth-sdk/api/recordings_api.rb +11 -11
- data/lib/bandwidth-sdk/api/statistics_api.rb +2 -2
- data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +13 -13
- data/lib/bandwidth-sdk/api/transcriptions_api.rb +4 -4
- data/lib/bandwidth-sdk/api_client.rb +9 -5
- data/lib/bandwidth-sdk/api_error.rb +1 -1
- data/lib/bandwidth-sdk/api_model_base.rb +88 -0
- data/lib/bandwidth-sdk/configuration.rb +50 -1
- data/lib/bandwidth-sdk/models/account_statistics.rb +11 -78
- data/lib/bandwidth-sdk/models/additional_denial_reason.rb +41 -78
- data/lib/bandwidth-sdk/models/address.rb +23 -90
- data/lib/bandwidth-sdk/models/answer_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/async_lookup_request.rb +11 -78
- data/lib/bandwidth-sdk/models/blocked_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/business_entity_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/business_registration_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/call_state.rb +11 -78
- data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_transcription.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_response.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_track_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/callback.rb +1 -1
- data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/card_width_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/code_request.rb +11 -78
- data/lib/bandwidth-sdk/models/completed_lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/conference.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/contact.rb +19 -86
- data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/create_call.rb +41 -78
- data/lib/bandwidth-sdk/models/create_call_response.rb +81 -78
- data/lib/bandwidth-sdk/models/create_message_request_error.rb +31 -78
- data/lib/bandwidth-sdk/models/create_multi_channel_message_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_sync_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_sync_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/deactivation_event_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/diversion.rb +11 -78
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/error.rb +11 -78
- data/lib/bandwidth-sdk/models/error_object.rb +41 -78
- data/lib/bandwidth-sdk/models/error_source.rb +11 -78
- data/lib/bandwidth-sdk/models/failure_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/field_error.rb +11 -78
- data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/gather_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/in_progress_lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/inbound_callback.rb +61 -78
- data/lib/bandwidth-sdk/models/inbound_callback_message.rb +81 -78
- data/lib/bandwidth-sdk/models/inbound_callback_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/initiate_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/latest_message_delivery_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/line_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/link.rb +11 -78
- data/lib/bandwidth-sdk/models/link_schema.rb +11 -78
- data/lib/bandwidth-sdk/models/links_object.rb +11 -78
- data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/list_message_item.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_response.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_schema.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_schema_meta.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_result.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_result.rb +11 -78
- data/lib/bandwidth-sdk/models/media.rb +11 -78
- data/lib/bandwidth-sdk/models/message.rb +11 -78
- data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_request.rb +31 -78
- data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/messages_list.rb +11 -78
- data/lib/bandwidth-sdk/models/messaging_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/messaging_request_error.rb +31 -78
- data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mfa_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mms_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/mms_message_content_file.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_action.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +41 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_mms_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_mms_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_base.rb +41 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_owner_object.rb +21 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object_all_of_content.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_request_object.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_response_object.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_error.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_channel_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/multi_channel_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_request.rb +21 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +41 -78
- data/lib/bandwidth-sdk/models/opt_in_workflow.rb +25 -82
- data/lib/bandwidth-sdk/models/page_info.rb +11 -78
- data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/product_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_base.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_action_dial.rb +31 -78
- data/lib/bandwidth-sdk/models/rbm_action_open_url.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_action_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_view_location.rb +41 -78
- data/lib/bandwidth-sdk/models/rbm_card_content.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_card_content_media.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_location_response.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_media_height_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_message_carousel_card.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_message_content_file.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_message_content_rich_card.rb +3 -4
- data/lib/bandwidth-sdk/models/rbm_message_content_text.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_message_media.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_standalone_card.rb +41 -78
- data/lib/bandwidth-sdk/models/rbm_suggestion_response.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_transcriptions.rb +11 -78
- data/lib/bandwidth-sdk/models/redirect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/sms_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/standalone_card_orientation_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/status_callback.rb +61 -78
- data/lib/bandwidth-sdk/models/status_callback_message.rb +81 -78
- data/lib/bandwidth-sdk/models/status_callback_type_enum.rb +6 -6
- data/lib/bandwidth-sdk/models/stir_shaken.rb +11 -78
- data/lib/bandwidth-sdk/models/sync_lookup_request.rb +11 -78
- data/lib/bandwidth-sdk/models/telephone_number.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_basic_authentication.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_callback_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/tfv_error.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_status.rb +13 -80
- data/lib/bandwidth-sdk/models/tfv_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/tfv_submission_info.rb +21 -88
- data/lib/bandwidth-sdk/models/tfv_submission_wrapper.rb +11 -78
- data/lib/bandwidth-sdk/models/thumbnail_alignment_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/transcribe_recording.rb +11 -78
- data/lib/bandwidth-sdk/models/transcription.rb +11 -78
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/update_call.rb +11 -78
- data/lib/bandwidth-sdk/models/update_call_recording.rb +21 -78
- data/lib/bandwidth-sdk/models/update_conference.rb +11 -78
- data/lib/bandwidth-sdk/models/update_conference_member.rb +11 -78
- data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/verification_request.rb +51 -88
- data/lib/bandwidth-sdk/models/verification_update_request.rb +51 -88
- data/lib/bandwidth-sdk/models/verification_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/verify_code_request.rb +13 -80
- data/lib/bandwidth-sdk/models/verify_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/voice_api_error.rb +11 -78
- data/lib/bandwidth-sdk/models/voice_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/webhook_subscription.rb +13 -80
- data/lib/bandwidth-sdk/models/webhook_subscription_basic_authentication.rb +11 -78
- data/lib/bandwidth-sdk/models/webhook_subscription_request_schema.rb +15 -82
- data/lib/bandwidth-sdk/models/webhook_subscription_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +21 -78
- data/lib/bandwidth-sdk/version.rb +2 -2
- data/lib/bandwidth-sdk.rb +2 -1
- data/openapitools.json +1 -1
- data/spec/smoke/calls_api_spec.rb +50 -76
- data/spec/smoke/conferences_api_spec.rb +7 -5
- data/spec/smoke/media_api_spec.rb +4 -2
- data/spec/smoke/messages_api_spec.rb +9 -4
- data/spec/smoke/mfa_api_spec.rb +9 -4
- data/spec/smoke/multi_channel_api_spec.rb +4 -2
- data/spec/smoke/phone_number_lookup_api_spec.rb +6 -4
- data/spec/smoke/recordings_api_spec.rb +7 -33
- data/spec/smoke/statistics_api_spec.rb +16 -8
- data/spec/smoke/toll_free_verification_api_spec.rb +6 -4
- data/spec/smoke/transcriptions_api_spec.rb +7 -5
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/models/verify_code_request_spec.rb +1 -1
- metadata +5 -2
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
|
7
7
|
Contact: letstalk@bandwidth.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.17.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
17
|
# Represents an inbound callback.
|
|
18
|
-
class InboundCallback
|
|
18
|
+
class InboundCallback < ApiModelBase
|
|
19
19
|
attr_accessor :time
|
|
20
20
|
|
|
21
21
|
attr_accessor :type
|
|
@@ -65,9 +65,14 @@ module Bandwidth
|
|
|
65
65
|
}
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
+
# Returns attribute mapping this model knows about
|
|
69
|
+
def self.acceptable_attribute_map
|
|
70
|
+
attribute_map
|
|
71
|
+
end
|
|
72
|
+
|
|
68
73
|
# Returns all the JSON keys this model knows about
|
|
69
74
|
def self.acceptable_attributes
|
|
70
|
-
|
|
75
|
+
acceptable_attribute_map.values
|
|
71
76
|
end
|
|
72
77
|
|
|
73
78
|
# Attribute type mapping.
|
|
@@ -96,9 +101,10 @@ module Bandwidth
|
|
|
96
101
|
end
|
|
97
102
|
|
|
98
103
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
104
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
99
105
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
100
|
-
if (!
|
|
101
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::InboundCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
106
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
107
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::InboundCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
102
108
|
end
|
|
103
109
|
h[k.to_sym] = v
|
|
104
110
|
}
|
|
@@ -178,6 +184,56 @@ module Bandwidth
|
|
|
178
184
|
true
|
|
179
185
|
end
|
|
180
186
|
|
|
187
|
+
# Custom attribute writer method with validation
|
|
188
|
+
# @param [Object] time Value to be assigned
|
|
189
|
+
def time=(time)
|
|
190
|
+
if time.nil?
|
|
191
|
+
fail ArgumentError, 'time cannot be nil'
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
@time = time
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Custom attribute writer method with validation
|
|
198
|
+
# @param [Object] type Value to be assigned
|
|
199
|
+
def type=(type)
|
|
200
|
+
if type.nil?
|
|
201
|
+
fail ArgumentError, 'type cannot be nil'
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
@type = type
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Custom attribute writer method with validation
|
|
208
|
+
# @param [Object] to Value to be assigned
|
|
209
|
+
def to=(to)
|
|
210
|
+
if to.nil?
|
|
211
|
+
fail ArgumentError, 'to cannot be nil'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
@to = to
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Custom attribute writer method with validation
|
|
218
|
+
# @param [Object] description Value to be assigned
|
|
219
|
+
def description=(description)
|
|
220
|
+
if description.nil?
|
|
221
|
+
fail ArgumentError, 'description cannot be nil'
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
@description = description
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Custom attribute writer method with validation
|
|
228
|
+
# @param [Object] message Value to be assigned
|
|
229
|
+
def message=(message)
|
|
230
|
+
if message.nil?
|
|
231
|
+
fail ArgumentError, 'message cannot be nil'
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
@message = message
|
|
235
|
+
end
|
|
236
|
+
|
|
181
237
|
# Checks equality by comparing each attribute.
|
|
182
238
|
# @param [Object] Object to be compared
|
|
183
239
|
def ==(o)
|
|
@@ -226,61 +282,6 @@ module Bandwidth
|
|
|
226
282
|
new(transformed_hash)
|
|
227
283
|
end
|
|
228
284
|
|
|
229
|
-
# Deserializes the data based on type
|
|
230
|
-
# @param string type Data type
|
|
231
|
-
# @param string value Value to be deserialized
|
|
232
|
-
# @return [Object] Deserialized data
|
|
233
|
-
def self._deserialize(type, value)
|
|
234
|
-
case type.to_sym
|
|
235
|
-
when :Time
|
|
236
|
-
Time.parse(value)
|
|
237
|
-
when :Date
|
|
238
|
-
Date.parse(value)
|
|
239
|
-
when :String
|
|
240
|
-
value.to_s
|
|
241
|
-
when :Integer
|
|
242
|
-
value.to_i
|
|
243
|
-
when :Float
|
|
244
|
-
value.to_f
|
|
245
|
-
when :Boolean
|
|
246
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
247
|
-
true
|
|
248
|
-
else
|
|
249
|
-
false
|
|
250
|
-
end
|
|
251
|
-
when :Object
|
|
252
|
-
# generic object (usually a Hash), return directly
|
|
253
|
-
value
|
|
254
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
255
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
256
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
257
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
258
|
-
k_type = Regexp.last_match[:k_type]
|
|
259
|
-
v_type = Regexp.last_match[:v_type]
|
|
260
|
-
{}.tap do |hash|
|
|
261
|
-
value.each do |k, v|
|
|
262
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
263
|
-
end
|
|
264
|
-
end
|
|
265
|
-
else # model
|
|
266
|
-
# models (e.g. Pet) or oneOf
|
|
267
|
-
klass = Bandwidth.const_get(type)
|
|
268
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
269
|
-
end
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
# Returns the string representation of the object
|
|
273
|
-
# @return [String] String presentation of the object
|
|
274
|
-
def to_s
|
|
275
|
-
to_hash.to_s
|
|
276
|
-
end
|
|
277
|
-
|
|
278
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
279
|
-
# @return [Hash] Returns the object in the form of hash
|
|
280
|
-
def to_body
|
|
281
|
-
to_hash
|
|
282
|
-
end
|
|
283
|
-
|
|
284
285
|
# Returns the object in the form of hash
|
|
285
286
|
# @return [Hash] Returns the object in the form of hash
|
|
286
287
|
def to_hash
|
|
@@ -296,23 +297,5 @@ module Bandwidth
|
|
|
296
297
|
end
|
|
297
298
|
hash
|
|
298
299
|
end
|
|
299
|
-
|
|
300
|
-
# Outputs non-array value in the form of hash
|
|
301
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
302
|
-
# @param [Object] value Any valid value
|
|
303
|
-
# @return [Hash] Returns the value in the form of hash
|
|
304
|
-
def _to_hash(value)
|
|
305
|
-
if value.is_a?(Array)
|
|
306
|
-
value.compact.map { |v| _to_hash(v) }
|
|
307
|
-
elsif value.is_a?(Hash)
|
|
308
|
-
{}.tap do |hash|
|
|
309
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
310
|
-
end
|
|
311
|
-
elsif value.respond_to? :to_hash
|
|
312
|
-
value.to_hash
|
|
313
|
-
else
|
|
314
|
-
value
|
|
315
|
-
end
|
|
316
|
-
end
|
|
317
300
|
end
|
|
318
301
|
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 InboundCallbackMessage
|
|
17
|
+
class InboundCallbackMessage < ApiModelBase
|
|
18
18
|
# A unique identifier of the message.
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
@@ -99,9 +99,14 @@ module Bandwidth
|
|
|
99
99
|
}
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
+
# Returns attribute mapping this model knows about
|
|
103
|
+
def self.acceptable_attribute_map
|
|
104
|
+
attribute_map
|
|
105
|
+
end
|
|
106
|
+
|
|
102
107
|
# Returns all the JSON keys this model knows about
|
|
103
108
|
def self.acceptable_attributes
|
|
104
|
-
|
|
109
|
+
acceptable_attribute_map.values
|
|
105
110
|
end
|
|
106
111
|
|
|
107
112
|
# Attribute type mapping.
|
|
@@ -147,9 +152,10 @@ module Bandwidth
|
|
|
147
152
|
end
|
|
148
153
|
|
|
149
154
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
155
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
150
156
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
151
|
-
if (!
|
|
152
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::InboundCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " +
|
|
157
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
158
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::InboundCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
153
159
|
end
|
|
154
160
|
h[k.to_sym] = v
|
|
155
161
|
}
|
|
@@ -294,6 +300,66 @@ module Bandwidth
|
|
|
294
300
|
true
|
|
295
301
|
end
|
|
296
302
|
|
|
303
|
+
# Custom attribute writer method with validation
|
|
304
|
+
# @param [Object] id Value to be assigned
|
|
305
|
+
def id=(id)
|
|
306
|
+
if id.nil?
|
|
307
|
+
fail ArgumentError, 'id cannot be nil'
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
@id = id
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# Custom attribute writer method with validation
|
|
314
|
+
# @param [Object] owner Value to be assigned
|
|
315
|
+
def owner=(owner)
|
|
316
|
+
if owner.nil?
|
|
317
|
+
fail ArgumentError, 'owner cannot be nil'
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
@owner = owner
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# Custom attribute writer method with validation
|
|
324
|
+
# @param [Object] application_id Value to be assigned
|
|
325
|
+
def application_id=(application_id)
|
|
326
|
+
if application_id.nil?
|
|
327
|
+
fail ArgumentError, 'application_id cannot be nil'
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
@application_id = application_id
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# Custom attribute writer method with validation
|
|
334
|
+
# @param [Object] time Value to be assigned
|
|
335
|
+
def time=(time)
|
|
336
|
+
if time.nil?
|
|
337
|
+
fail ArgumentError, 'time cannot be nil'
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
@time = time
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Custom attribute writer method with validation
|
|
344
|
+
# @param [Object] segment_count Value to be assigned
|
|
345
|
+
def segment_count=(segment_count)
|
|
346
|
+
if segment_count.nil?
|
|
347
|
+
fail ArgumentError, 'segment_count cannot be nil'
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
@segment_count = segment_count
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
# Custom attribute writer method with validation
|
|
354
|
+
# @param [Object] direction Value to be assigned
|
|
355
|
+
def direction=(direction)
|
|
356
|
+
if direction.nil?
|
|
357
|
+
fail ArgumentError, 'direction cannot be nil'
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
@direction = direction
|
|
361
|
+
end
|
|
362
|
+
|
|
297
363
|
# Custom attribute writer method with validation
|
|
298
364
|
# @param [Object] to Value to be assigned
|
|
299
365
|
def to=(to)
|
|
@@ -304,6 +370,16 @@ module Bandwidth
|
|
|
304
370
|
@to = to
|
|
305
371
|
end
|
|
306
372
|
|
|
373
|
+
# Custom attribute writer method with validation
|
|
374
|
+
# @param [Object] from Value to be assigned
|
|
375
|
+
def from=(from)
|
|
376
|
+
if from.nil?
|
|
377
|
+
fail ArgumentError, 'from cannot be nil'
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
@from = from
|
|
381
|
+
end
|
|
382
|
+
|
|
307
383
|
# Checks equality by comparing each attribute.
|
|
308
384
|
# @param [Object] Object to be compared
|
|
309
385
|
def ==(o)
|
|
@@ -362,61 +438,6 @@ module Bandwidth
|
|
|
362
438
|
new(transformed_hash)
|
|
363
439
|
end
|
|
364
440
|
|
|
365
|
-
# Deserializes the data based on type
|
|
366
|
-
# @param string type Data type
|
|
367
|
-
# @param string value Value to be deserialized
|
|
368
|
-
# @return [Object] Deserialized data
|
|
369
|
-
def self._deserialize(type, value)
|
|
370
|
-
case type.to_sym
|
|
371
|
-
when :Time
|
|
372
|
-
Time.parse(value)
|
|
373
|
-
when :Date
|
|
374
|
-
Date.parse(value)
|
|
375
|
-
when :String
|
|
376
|
-
value.to_s
|
|
377
|
-
when :Integer
|
|
378
|
-
value.to_i
|
|
379
|
-
when :Float
|
|
380
|
-
value.to_f
|
|
381
|
-
when :Boolean
|
|
382
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
383
|
-
true
|
|
384
|
-
else
|
|
385
|
-
false
|
|
386
|
-
end
|
|
387
|
-
when :Object
|
|
388
|
-
# generic object (usually a Hash), return directly
|
|
389
|
-
value
|
|
390
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
391
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
392
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
393
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
394
|
-
k_type = Regexp.last_match[:k_type]
|
|
395
|
-
v_type = Regexp.last_match[:v_type]
|
|
396
|
-
{}.tap do |hash|
|
|
397
|
-
value.each do |k, v|
|
|
398
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
399
|
-
end
|
|
400
|
-
end
|
|
401
|
-
else # model
|
|
402
|
-
# models (e.g. Pet) or oneOf
|
|
403
|
-
klass = Bandwidth.const_get(type)
|
|
404
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
405
|
-
end
|
|
406
|
-
end
|
|
407
|
-
|
|
408
|
-
# Returns the string representation of the object
|
|
409
|
-
# @return [String] String presentation of the object
|
|
410
|
-
def to_s
|
|
411
|
-
to_hash.to_s
|
|
412
|
-
end
|
|
413
|
-
|
|
414
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
415
|
-
# @return [Hash] Returns the object in the form of hash
|
|
416
|
-
def to_body
|
|
417
|
-
to_hash
|
|
418
|
-
end
|
|
419
|
-
|
|
420
441
|
# Returns the object in the form of hash
|
|
421
442
|
# @return [Hash] Returns the object in the form of hash
|
|
422
443
|
def to_hash
|
|
@@ -432,23 +453,5 @@ module Bandwidth
|
|
|
432
453
|
end
|
|
433
454
|
hash
|
|
434
455
|
end
|
|
435
|
-
|
|
436
|
-
# Outputs non-array value in the form of hash
|
|
437
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
438
|
-
# @param [Object] value Any valid value
|
|
439
|
-
# @return [Hash] Returns the value in the form of hash
|
|
440
|
-
def _to_hash(value)
|
|
441
|
-
if value.is_a?(Array)
|
|
442
|
-
value.compact.map { |v| _to_hash(v) }
|
|
443
|
-
elsif value.is_a?(Hash)
|
|
444
|
-
{}.tap do |hash|
|
|
445
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
446
|
-
end
|
|
447
|
-
elsif value.respond_to? :to_hash
|
|
448
|
-
value.to_hash
|
|
449
|
-
else
|
|
450
|
-
value
|
|
451
|
-
end
|
|
452
|
-
end
|
|
453
456
|
end
|
|
454
457
|
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 Initiate event is fired when an inbound call is received for a Telephone Number on your Account. It is sent to the URL specified in the application associated with the location (sip-peer) that the called telephone number belongs to.
|
|
18
|
-
class InitiateCallback
|
|
18
|
+
class InitiateCallback < 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
|
|
|
@@ -93,9 +93,14 @@ module Bandwidth
|
|
|
93
93
|
}
|
|
94
94
|
end
|
|
95
95
|
|
|
96
|
+
# Returns attribute mapping this model knows about
|
|
97
|
+
def self.acceptable_attribute_map
|
|
98
|
+
attribute_map
|
|
99
|
+
end
|
|
100
|
+
|
|
96
101
|
# Returns all the JSON keys this model knows about
|
|
97
102
|
def self.acceptable_attributes
|
|
98
|
-
|
|
103
|
+
acceptable_attribute_map.values
|
|
99
104
|
end
|
|
100
105
|
|
|
101
106
|
# Attribute type mapping.
|
|
@@ -131,9 +136,10 @@ module Bandwidth
|
|
|
131
136
|
end
|
|
132
137
|
|
|
133
138
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
139
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
134
140
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
135
|
-
if (!
|
|
136
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::InitiateCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
141
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
142
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::InitiateCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
137
143
|
end
|
|
138
144
|
h[k.to_sym] = v
|
|
139
145
|
}
|
|
@@ -280,61 +286,6 @@ module Bandwidth
|
|
|
280
286
|
new(transformed_hash)
|
|
281
287
|
end
|
|
282
288
|
|
|
283
|
-
# Deserializes the data based on type
|
|
284
|
-
# @param string type Data type
|
|
285
|
-
# @param string value Value to be deserialized
|
|
286
|
-
# @return [Object] Deserialized data
|
|
287
|
-
def self._deserialize(type, value)
|
|
288
|
-
case type.to_sym
|
|
289
|
-
when :Time
|
|
290
|
-
Time.parse(value)
|
|
291
|
-
when :Date
|
|
292
|
-
Date.parse(value)
|
|
293
|
-
when :String
|
|
294
|
-
value.to_s
|
|
295
|
-
when :Integer
|
|
296
|
-
value.to_i
|
|
297
|
-
when :Float
|
|
298
|
-
value.to_f
|
|
299
|
-
when :Boolean
|
|
300
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
301
|
-
true
|
|
302
|
-
else
|
|
303
|
-
false
|
|
304
|
-
end
|
|
305
|
-
when :Object
|
|
306
|
-
# generic object (usually a Hash), return directly
|
|
307
|
-
value
|
|
308
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
309
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
310
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
311
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
312
|
-
k_type = Regexp.last_match[:k_type]
|
|
313
|
-
v_type = Regexp.last_match[:v_type]
|
|
314
|
-
{}.tap do |hash|
|
|
315
|
-
value.each do |k, v|
|
|
316
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
317
|
-
end
|
|
318
|
-
end
|
|
319
|
-
else # model
|
|
320
|
-
# models (e.g. Pet) or oneOf
|
|
321
|
-
klass = Bandwidth.const_get(type)
|
|
322
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
323
|
-
end
|
|
324
|
-
end
|
|
325
|
-
|
|
326
|
-
# Returns the string representation of the object
|
|
327
|
-
# @return [String] String presentation of the object
|
|
328
|
-
def to_s
|
|
329
|
-
to_hash.to_s
|
|
330
|
-
end
|
|
331
|
-
|
|
332
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
333
|
-
# @return [Hash] Returns the object in the form of hash
|
|
334
|
-
def to_body
|
|
335
|
-
to_hash
|
|
336
|
-
end
|
|
337
|
-
|
|
338
289
|
# Returns the object in the form of hash
|
|
339
290
|
# @return [Hash] Returns the object in the form of hash
|
|
340
291
|
def to_hash
|
|
@@ -350,23 +301,5 @@ module Bandwidth
|
|
|
350
301
|
end
|
|
351
302
|
hash
|
|
352
303
|
end
|
|
353
|
-
|
|
354
|
-
# Outputs non-array value in the form of hash
|
|
355
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
356
|
-
# @param [Object] value Any valid value
|
|
357
|
-
# @return [Hash] Returns the value in the form of hash
|
|
358
|
-
def _to_hash(value)
|
|
359
|
-
if value.is_a?(Array)
|
|
360
|
-
value.compact.map { |v| _to_hash(v) }
|
|
361
|
-
elsif value.is_a?(Hash)
|
|
362
|
-
{}.tap do |hash|
|
|
363
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
364
|
-
end
|
|
365
|
-
elsif value.respond_to? :to_hash
|
|
366
|
-
value.to_hash
|
|
367
|
-
else
|
|
368
|
-
value
|
|
369
|
-
end
|
|
370
|
-
end
|
|
371
304
|
end
|
|
372
305
|
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 Link
|
|
17
|
+
class Link < ApiModelBase
|
|
18
18
|
attr_accessor :rel
|
|
19
19
|
|
|
20
20
|
attr_accessor :href
|
|
@@ -27,9 +27,14 @@ module Bandwidth
|
|
|
27
27
|
}
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
30
35
|
# Returns all the JSON keys this model knows about
|
|
31
36
|
def self.acceptable_attributes
|
|
32
|
-
|
|
37
|
+
acceptable_attribute_map.values
|
|
33
38
|
end
|
|
34
39
|
|
|
35
40
|
# Attribute type mapping.
|
|
@@ -54,9 +59,10 @@ module Bandwidth
|
|
|
54
59
|
end
|
|
55
60
|
|
|
56
61
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
57
63
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
58
|
-
if (!
|
|
59
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Link`. Please check the name to make sure it's valid. List of attributes: " +
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Link`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
60
66
|
end
|
|
61
67
|
h[k.to_sym] = v
|
|
62
68
|
}
|
|
@@ -129,61 +135,6 @@ module Bandwidth
|
|
|
129
135
|
new(transformed_hash)
|
|
130
136
|
end
|
|
131
137
|
|
|
132
|
-
# Deserializes the data based on type
|
|
133
|
-
# @param string type Data type
|
|
134
|
-
# @param string value Value to be deserialized
|
|
135
|
-
# @return [Object] Deserialized data
|
|
136
|
-
def self._deserialize(type, value)
|
|
137
|
-
case type.to_sym
|
|
138
|
-
when :Time
|
|
139
|
-
Time.parse(value)
|
|
140
|
-
when :Date
|
|
141
|
-
Date.parse(value)
|
|
142
|
-
when :String
|
|
143
|
-
value.to_s
|
|
144
|
-
when :Integer
|
|
145
|
-
value.to_i
|
|
146
|
-
when :Float
|
|
147
|
-
value.to_f
|
|
148
|
-
when :Boolean
|
|
149
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
150
|
-
true
|
|
151
|
-
else
|
|
152
|
-
false
|
|
153
|
-
end
|
|
154
|
-
when :Object
|
|
155
|
-
# generic object (usually a Hash), return directly
|
|
156
|
-
value
|
|
157
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
158
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
159
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
160
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
161
|
-
k_type = Regexp.last_match[:k_type]
|
|
162
|
-
v_type = Regexp.last_match[:v_type]
|
|
163
|
-
{}.tap do |hash|
|
|
164
|
-
value.each do |k, v|
|
|
165
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
else # model
|
|
169
|
-
# models (e.g. Pet) or oneOf
|
|
170
|
-
klass = Bandwidth.const_get(type)
|
|
171
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
172
|
-
end
|
|
173
|
-
end
|
|
174
|
-
|
|
175
|
-
# Returns the string representation of the object
|
|
176
|
-
# @return [String] String presentation of the object
|
|
177
|
-
def to_s
|
|
178
|
-
to_hash.to_s
|
|
179
|
-
end
|
|
180
|
-
|
|
181
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
182
|
-
# @return [Hash] Returns the object in the form of hash
|
|
183
|
-
def to_body
|
|
184
|
-
to_hash
|
|
185
|
-
end
|
|
186
|
-
|
|
187
138
|
# Returns the object in the form of hash
|
|
188
139
|
# @return [Hash] Returns the object in the form of hash
|
|
189
140
|
def to_hash
|
|
@@ -199,23 +150,5 @@ module Bandwidth
|
|
|
199
150
|
end
|
|
200
151
|
hash
|
|
201
152
|
end
|
|
202
|
-
|
|
203
|
-
# Outputs non-array value in the form of hash
|
|
204
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
205
|
-
# @param [Object] value Any valid value
|
|
206
|
-
# @return [Hash] Returns the value in the form of hash
|
|
207
|
-
def _to_hash(value)
|
|
208
|
-
if value.is_a?(Array)
|
|
209
|
-
value.compact.map { |v| _to_hash(v) }
|
|
210
|
-
elsif value.is_a?(Hash)
|
|
211
|
-
{}.tap do |hash|
|
|
212
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
213
|
-
end
|
|
214
|
-
elsif value.respond_to? :to_hash
|
|
215
|
-
value.to_hash
|
|
216
|
-
else
|
|
217
|
-
value
|
|
218
|
-
end
|
|
219
|
-
end
|
|
220
153
|
end
|
|
221
154
|
end
|