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 OptInWorkflow
|
|
17
|
+
class OptInWorkflow < ApiModelBase
|
|
18
18
|
attr_accessor :description
|
|
19
19
|
|
|
20
20
|
attr_accessor :image_urls
|
|
@@ -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.
|
|
@@ -59,9 +64,10 @@ module Bandwidth
|
|
|
59
64
|
end
|
|
60
65
|
|
|
61
66
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
67
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
62
68
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
63
|
-
if (!
|
|
64
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::OptInWorkflow`. Please check the name to make sure it's valid. List of attributes: " +
|
|
69
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
70
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::OptInWorkflow`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
65
71
|
end
|
|
66
72
|
h[k.to_sym] = v
|
|
67
73
|
}
|
|
@@ -99,7 +105,7 @@ module Bandwidth
|
|
|
99
105
|
end
|
|
100
106
|
|
|
101
107
|
if @description.to_s.length < 1
|
|
102
|
-
invalid_properties.push('invalid value for "description", the character length must be
|
|
108
|
+
invalid_properties.push('invalid value for "description", the character length must be greater than or equal to 1.')
|
|
103
109
|
end
|
|
104
110
|
|
|
105
111
|
if @image_urls.nil?
|
|
@@ -111,7 +117,7 @@ module Bandwidth
|
|
|
111
117
|
end
|
|
112
118
|
|
|
113
119
|
if !@confirmation_response.nil? && @confirmation_response.to_s.length < 0
|
|
114
|
-
invalid_properties.push('invalid value for "confirmation_response", the character length must be
|
|
120
|
+
invalid_properties.push('invalid value for "confirmation_response", the character length must be greater than or equal to 0.')
|
|
115
121
|
end
|
|
116
122
|
|
|
117
123
|
invalid_properties
|
|
@@ -142,12 +148,22 @@ module Bandwidth
|
|
|
142
148
|
end
|
|
143
149
|
|
|
144
150
|
if description.to_s.length < 1
|
|
145
|
-
fail ArgumentError, 'invalid value for "description", the character length must be
|
|
151
|
+
fail ArgumentError, 'invalid value for "description", the character length must be greater than or equal to 1.'
|
|
146
152
|
end
|
|
147
153
|
|
|
148
154
|
@description = description
|
|
149
155
|
end
|
|
150
156
|
|
|
157
|
+
# Custom attribute writer method with validation
|
|
158
|
+
# @param [Object] image_urls Value to be assigned
|
|
159
|
+
def image_urls=(image_urls)
|
|
160
|
+
if image_urls.nil?
|
|
161
|
+
fail ArgumentError, 'image_urls cannot be nil'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
@image_urls = image_urls
|
|
165
|
+
end
|
|
166
|
+
|
|
151
167
|
# Custom attribute writer method with validation
|
|
152
168
|
# @param [Object] confirmation_response Value to be assigned
|
|
153
169
|
def confirmation_response=(confirmation_response)
|
|
@@ -156,7 +172,7 @@ module Bandwidth
|
|
|
156
172
|
end
|
|
157
173
|
|
|
158
174
|
if !confirmation_response.nil? && confirmation_response.to_s.length < 0
|
|
159
|
-
fail ArgumentError, 'invalid value for "confirmation_response", the character length must be
|
|
175
|
+
fail ArgumentError, 'invalid value for "confirmation_response", the character length must be greater than or equal to 0.'
|
|
160
176
|
end
|
|
161
177
|
|
|
162
178
|
@confirmation_response = confirmation_response
|
|
@@ -207,61 +223,6 @@ module Bandwidth
|
|
|
207
223
|
new(transformed_hash)
|
|
208
224
|
end
|
|
209
225
|
|
|
210
|
-
# Deserializes the data based on type
|
|
211
|
-
# @param string type Data type
|
|
212
|
-
# @param string value Value to be deserialized
|
|
213
|
-
# @return [Object] Deserialized data
|
|
214
|
-
def self._deserialize(type, value)
|
|
215
|
-
case type.to_sym
|
|
216
|
-
when :Time
|
|
217
|
-
Time.parse(value)
|
|
218
|
-
when :Date
|
|
219
|
-
Date.parse(value)
|
|
220
|
-
when :String
|
|
221
|
-
value.to_s
|
|
222
|
-
when :Integer
|
|
223
|
-
value.to_i
|
|
224
|
-
when :Float
|
|
225
|
-
value.to_f
|
|
226
|
-
when :Boolean
|
|
227
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
228
|
-
true
|
|
229
|
-
else
|
|
230
|
-
false
|
|
231
|
-
end
|
|
232
|
-
when :Object
|
|
233
|
-
# generic object (usually a Hash), return directly
|
|
234
|
-
value
|
|
235
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
236
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
237
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
238
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
239
|
-
k_type = Regexp.last_match[:k_type]
|
|
240
|
-
v_type = Regexp.last_match[:v_type]
|
|
241
|
-
{}.tap do |hash|
|
|
242
|
-
value.each do |k, v|
|
|
243
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
244
|
-
end
|
|
245
|
-
end
|
|
246
|
-
else # model
|
|
247
|
-
# models (e.g. Pet) or oneOf
|
|
248
|
-
klass = Bandwidth.const_get(type)
|
|
249
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
250
|
-
end
|
|
251
|
-
end
|
|
252
|
-
|
|
253
|
-
# Returns the string representation of the object
|
|
254
|
-
# @return [String] String presentation of the object
|
|
255
|
-
def to_s
|
|
256
|
-
to_hash.to_s
|
|
257
|
-
end
|
|
258
|
-
|
|
259
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
260
|
-
# @return [Hash] Returns the object in the form of hash
|
|
261
|
-
def to_body
|
|
262
|
-
to_hash
|
|
263
|
-
end
|
|
264
|
-
|
|
265
226
|
# Returns the object in the form of hash
|
|
266
227
|
# @return [Hash] Returns the object in the form of hash
|
|
267
228
|
def to_hash
|
|
@@ -277,23 +238,5 @@ module Bandwidth
|
|
|
277
238
|
end
|
|
278
239
|
hash
|
|
279
240
|
end
|
|
280
|
-
|
|
281
|
-
# Outputs non-array value in the form of hash
|
|
282
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
283
|
-
# @param [Object] value Any valid value
|
|
284
|
-
# @return [Hash] Returns the value in the form of hash
|
|
285
|
-
def _to_hash(value)
|
|
286
|
-
if value.is_a?(Array)
|
|
287
|
-
value.compact.map { |v| _to_hash(v) }
|
|
288
|
-
elsif value.is_a?(Hash)
|
|
289
|
-
{}.tap do |hash|
|
|
290
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
291
|
-
end
|
|
292
|
-
elsif value.respond_to? :to_hash
|
|
293
|
-
value.to_hash
|
|
294
|
-
else
|
|
295
|
-
value
|
|
296
|
-
end
|
|
297
|
-
end
|
|
298
241
|
end
|
|
299
242
|
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 PageInfo
|
|
17
|
+
class PageInfo < ApiModelBase
|
|
18
18
|
# The link to the previous page for pagination.
|
|
19
19
|
attr_accessor :prev_page
|
|
20
20
|
|
|
@@ -37,9 +37,14 @@ module Bandwidth
|
|
|
37
37
|
}
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
40
45
|
# Returns all the JSON keys this model knows about
|
|
41
46
|
def self.acceptable_attributes
|
|
42
|
-
|
|
47
|
+
acceptable_attribute_map.values
|
|
43
48
|
end
|
|
44
49
|
|
|
45
50
|
# Attribute type mapping.
|
|
@@ -66,9 +71,10 @@ module Bandwidth
|
|
|
66
71
|
end
|
|
67
72
|
|
|
68
73
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
69
75
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
70
|
-
if (!
|
|
71
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::PageInfo`. Please check the name to make sure it's valid. List of attributes: " +
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::PageInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
72
78
|
end
|
|
73
79
|
h[k.to_sym] = v
|
|
74
80
|
}
|
|
@@ -151,61 +157,6 @@ module Bandwidth
|
|
|
151
157
|
new(transformed_hash)
|
|
152
158
|
end
|
|
153
159
|
|
|
154
|
-
# Deserializes the data based on type
|
|
155
|
-
# @param string type Data type
|
|
156
|
-
# @param string value Value to be deserialized
|
|
157
|
-
# @return [Object] Deserialized data
|
|
158
|
-
def self._deserialize(type, value)
|
|
159
|
-
case type.to_sym
|
|
160
|
-
when :Time
|
|
161
|
-
Time.parse(value)
|
|
162
|
-
when :Date
|
|
163
|
-
Date.parse(value)
|
|
164
|
-
when :String
|
|
165
|
-
value.to_s
|
|
166
|
-
when :Integer
|
|
167
|
-
value.to_i
|
|
168
|
-
when :Float
|
|
169
|
-
value.to_f
|
|
170
|
-
when :Boolean
|
|
171
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
172
|
-
true
|
|
173
|
-
else
|
|
174
|
-
false
|
|
175
|
-
end
|
|
176
|
-
when :Object
|
|
177
|
-
# generic object (usually a Hash), return directly
|
|
178
|
-
value
|
|
179
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
180
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
181
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
182
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
183
|
-
k_type = Regexp.last_match[:k_type]
|
|
184
|
-
v_type = Regexp.last_match[:v_type]
|
|
185
|
-
{}.tap do |hash|
|
|
186
|
-
value.each do |k, v|
|
|
187
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
188
|
-
end
|
|
189
|
-
end
|
|
190
|
-
else # model
|
|
191
|
-
# models (e.g. Pet) or oneOf
|
|
192
|
-
klass = Bandwidth.const_get(type)
|
|
193
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
194
|
-
end
|
|
195
|
-
end
|
|
196
|
-
|
|
197
|
-
# Returns the string representation of the object
|
|
198
|
-
# @return [String] String presentation of the object
|
|
199
|
-
def to_s
|
|
200
|
-
to_hash.to_s
|
|
201
|
-
end
|
|
202
|
-
|
|
203
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
204
|
-
# @return [Hash] Returns the object in the form of hash
|
|
205
|
-
def to_body
|
|
206
|
-
to_hash
|
|
207
|
-
end
|
|
208
|
-
|
|
209
160
|
# Returns the object in the form of hash
|
|
210
161
|
# @return [Hash] Returns the object in the form of hash
|
|
211
162
|
def to_hash
|
|
@@ -221,23 +172,5 @@ module Bandwidth
|
|
|
221
172
|
end
|
|
222
173
|
hash
|
|
223
174
|
end
|
|
224
|
-
|
|
225
|
-
# Outputs non-array value in the form of hash
|
|
226
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
227
|
-
# @param [Object] value Any valid value
|
|
228
|
-
# @return [Hash] Returns the value in the form of hash
|
|
229
|
-
def _to_hash(value)
|
|
230
|
-
if value.is_a?(Array)
|
|
231
|
-
value.compact.map { |v| _to_hash(v) }
|
|
232
|
-
elsif value.is_a?(Hash)
|
|
233
|
-
{}.tap do |hash|
|
|
234
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
235
|
-
end
|
|
236
|
-
elsif value.respond_to? :to_hash
|
|
237
|
-
value.to_hash
|
|
238
|
-
else
|
|
239
|
-
value
|
|
240
|
-
end
|
|
241
|
-
end
|
|
242
175
|
end
|
|
243
176
|
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 RbmActionBase
|
|
17
|
+
class RbmActionBase < ApiModelBase
|
|
18
18
|
attr_accessor :type
|
|
19
19
|
|
|
20
20
|
# Displayed text for user to click
|
|
@@ -54,9 +54,14 @@ module Bandwidth
|
|
|
54
54
|
}
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
+
# Returns attribute mapping this model knows about
|
|
58
|
+
def self.acceptable_attribute_map
|
|
59
|
+
attribute_map
|
|
60
|
+
end
|
|
61
|
+
|
|
57
62
|
# Returns all the JSON keys this model knows about
|
|
58
63
|
def self.acceptable_attributes
|
|
59
|
-
|
|
64
|
+
acceptable_attribute_map.values
|
|
60
65
|
end
|
|
61
66
|
|
|
62
67
|
# Attribute type mapping.
|
|
@@ -82,9 +87,10 @@ module Bandwidth
|
|
|
82
87
|
end
|
|
83
88
|
|
|
84
89
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
90
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
91
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
-
if (!
|
|
87
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmActionBase`. Please check the name to make sure it's valid. List of attributes: " +
|
|
92
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
93
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmActionBase`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
94
|
end
|
|
89
95
|
h[k.to_sym] = v
|
|
90
96
|
}
|
|
@@ -148,6 +154,16 @@ module Bandwidth
|
|
|
148
154
|
true
|
|
149
155
|
end
|
|
150
156
|
|
|
157
|
+
# Custom attribute writer method with validation
|
|
158
|
+
# @param [Object] type Value to be assigned
|
|
159
|
+
def type=(type)
|
|
160
|
+
if type.nil?
|
|
161
|
+
fail ArgumentError, 'type cannot be nil'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
@type = type
|
|
165
|
+
end
|
|
166
|
+
|
|
151
167
|
# Custom attribute writer method with validation
|
|
152
168
|
# @param [Object] text Value to be assigned
|
|
153
169
|
def text=(text)
|
|
@@ -221,61 +237,6 @@ module Bandwidth
|
|
|
221
237
|
new(transformed_hash)
|
|
222
238
|
end
|
|
223
239
|
|
|
224
|
-
# Deserializes the data based on type
|
|
225
|
-
# @param string type Data type
|
|
226
|
-
# @param string value Value to be deserialized
|
|
227
|
-
# @return [Object] Deserialized data
|
|
228
|
-
def self._deserialize(type, value)
|
|
229
|
-
case type.to_sym
|
|
230
|
-
when :Time
|
|
231
|
-
Time.parse(value)
|
|
232
|
-
when :Date
|
|
233
|
-
Date.parse(value)
|
|
234
|
-
when :String
|
|
235
|
-
value.to_s
|
|
236
|
-
when :Integer
|
|
237
|
-
value.to_i
|
|
238
|
-
when :Float
|
|
239
|
-
value.to_f
|
|
240
|
-
when :Boolean
|
|
241
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
242
|
-
true
|
|
243
|
-
else
|
|
244
|
-
false
|
|
245
|
-
end
|
|
246
|
-
when :Object
|
|
247
|
-
# generic object (usually a Hash), return directly
|
|
248
|
-
value
|
|
249
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
250
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
251
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
252
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
253
|
-
k_type = Regexp.last_match[:k_type]
|
|
254
|
-
v_type = Regexp.last_match[:v_type]
|
|
255
|
-
{}.tap do |hash|
|
|
256
|
-
value.each do |k, v|
|
|
257
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
258
|
-
end
|
|
259
|
-
end
|
|
260
|
-
else # model
|
|
261
|
-
# models (e.g. Pet) or oneOf
|
|
262
|
-
klass = Bandwidth.const_get(type)
|
|
263
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
264
|
-
end
|
|
265
|
-
end
|
|
266
|
-
|
|
267
|
-
# Returns the string representation of the object
|
|
268
|
-
# @return [String] String presentation of the object
|
|
269
|
-
def to_s
|
|
270
|
-
to_hash.to_s
|
|
271
|
-
end
|
|
272
|
-
|
|
273
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
274
|
-
# @return [Hash] Returns the object in the form of hash
|
|
275
|
-
def to_body
|
|
276
|
-
to_hash
|
|
277
|
-
end
|
|
278
|
-
|
|
279
240
|
# Returns the object in the form of hash
|
|
280
241
|
# @return [Hash] Returns the object in the form of hash
|
|
281
242
|
def to_hash
|
|
@@ -291,23 +252,5 @@ module Bandwidth
|
|
|
291
252
|
end
|
|
292
253
|
hash
|
|
293
254
|
end
|
|
294
|
-
|
|
295
|
-
# Outputs non-array value in the form of hash
|
|
296
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
297
|
-
# @param [Object] value Any valid value
|
|
298
|
-
# @return [Hash] Returns the value in the form of hash
|
|
299
|
-
def _to_hash(value)
|
|
300
|
-
if value.is_a?(Array)
|
|
301
|
-
value.compact.map { |v| _to_hash(v) }
|
|
302
|
-
elsif value.is_a?(Hash)
|
|
303
|
-
{}.tap do |hash|
|
|
304
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
305
|
-
end
|
|
306
|
-
elsif value.respond_to? :to_hash
|
|
307
|
-
value.to_hash
|
|
308
|
-
else
|
|
309
|
-
value
|
|
310
|
-
end
|
|
311
|
-
end
|
|
312
255
|
end
|
|
313
256
|
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 RbmActionDial
|
|
17
|
+
class RbmActionDial < ApiModelBase
|
|
18
18
|
attr_accessor :type
|
|
19
19
|
|
|
20
20
|
# Displayed text for user to click
|
|
@@ -58,9 +58,14 @@ module Bandwidth
|
|
|
58
58
|
}
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
+
# Returns attribute mapping this model knows about
|
|
62
|
+
def self.acceptable_attribute_map
|
|
63
|
+
attribute_map
|
|
64
|
+
end
|
|
65
|
+
|
|
61
66
|
# Returns all the JSON keys this model knows about
|
|
62
67
|
def self.acceptable_attributes
|
|
63
|
-
|
|
68
|
+
acceptable_attribute_map.values
|
|
64
69
|
end
|
|
65
70
|
|
|
66
71
|
# Attribute type mapping.
|
|
@@ -94,9 +99,10 @@ module Bandwidth
|
|
|
94
99
|
end
|
|
95
100
|
|
|
96
101
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
102
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
97
103
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
98
|
-
if (!
|
|
99
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmActionDial`. Please check the name to make sure it's valid. List of attributes: " +
|
|
104
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
105
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmActionDial`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
100
106
|
end
|
|
101
107
|
h[k.to_sym] = v
|
|
102
108
|
}
|
|
@@ -171,6 +177,16 @@ module Bandwidth
|
|
|
171
177
|
true
|
|
172
178
|
end
|
|
173
179
|
|
|
180
|
+
# Custom attribute writer method with validation
|
|
181
|
+
# @param [Object] type Value to be assigned
|
|
182
|
+
def type=(type)
|
|
183
|
+
if type.nil?
|
|
184
|
+
fail ArgumentError, 'type cannot be nil'
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
@type = type
|
|
188
|
+
end
|
|
189
|
+
|
|
174
190
|
# Custom attribute writer method with validation
|
|
175
191
|
# @param [Object] text Value to be assigned
|
|
176
192
|
def text=(text)
|
|
@@ -199,6 +215,16 @@ module Bandwidth
|
|
|
199
215
|
@postback_data = postback_data
|
|
200
216
|
end
|
|
201
217
|
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] phone_number Value to be assigned
|
|
220
|
+
def phone_number=(phone_number)
|
|
221
|
+
if phone_number.nil?
|
|
222
|
+
fail ArgumentError, 'phone_number cannot be nil'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@phone_number = phone_number
|
|
226
|
+
end
|
|
227
|
+
|
|
202
228
|
# Checks equality by comparing each attribute.
|
|
203
229
|
# @param [Object] Object to be compared
|
|
204
230
|
def ==(o)
|
|
@@ -245,61 +271,6 @@ module Bandwidth
|
|
|
245
271
|
new(transformed_hash)
|
|
246
272
|
end
|
|
247
273
|
|
|
248
|
-
# Deserializes the data based on type
|
|
249
|
-
# @param string type Data type
|
|
250
|
-
# @param string value Value to be deserialized
|
|
251
|
-
# @return [Object] Deserialized data
|
|
252
|
-
def self._deserialize(type, value)
|
|
253
|
-
case type.to_sym
|
|
254
|
-
when :Time
|
|
255
|
-
Time.parse(value)
|
|
256
|
-
when :Date
|
|
257
|
-
Date.parse(value)
|
|
258
|
-
when :String
|
|
259
|
-
value.to_s
|
|
260
|
-
when :Integer
|
|
261
|
-
value.to_i
|
|
262
|
-
when :Float
|
|
263
|
-
value.to_f
|
|
264
|
-
when :Boolean
|
|
265
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
266
|
-
true
|
|
267
|
-
else
|
|
268
|
-
false
|
|
269
|
-
end
|
|
270
|
-
when :Object
|
|
271
|
-
# generic object (usually a Hash), return directly
|
|
272
|
-
value
|
|
273
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
274
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
275
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
276
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
277
|
-
k_type = Regexp.last_match[:k_type]
|
|
278
|
-
v_type = Regexp.last_match[:v_type]
|
|
279
|
-
{}.tap do |hash|
|
|
280
|
-
value.each do |k, v|
|
|
281
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
282
|
-
end
|
|
283
|
-
end
|
|
284
|
-
else # model
|
|
285
|
-
# models (e.g. Pet) or oneOf
|
|
286
|
-
klass = Bandwidth.const_get(type)
|
|
287
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
288
|
-
end
|
|
289
|
-
end
|
|
290
|
-
|
|
291
|
-
# Returns the string representation of the object
|
|
292
|
-
# @return [String] String presentation of the object
|
|
293
|
-
def to_s
|
|
294
|
-
to_hash.to_s
|
|
295
|
-
end
|
|
296
|
-
|
|
297
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
298
|
-
# @return [Hash] Returns the object in the form of hash
|
|
299
|
-
def to_body
|
|
300
|
-
to_hash
|
|
301
|
-
end
|
|
302
|
-
|
|
303
274
|
# Returns the object in the form of hash
|
|
304
275
|
# @return [Hash] Returns the object in the form of hash
|
|
305
276
|
def to_hash
|
|
@@ -315,23 +286,5 @@ module Bandwidth
|
|
|
315
286
|
end
|
|
316
287
|
hash
|
|
317
288
|
end
|
|
318
|
-
|
|
319
|
-
# Outputs non-array value in the form of hash
|
|
320
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
321
|
-
# @param [Object] value Any valid value
|
|
322
|
-
# @return [Hash] Returns the value in the form of hash
|
|
323
|
-
def _to_hash(value)
|
|
324
|
-
if value.is_a?(Array)
|
|
325
|
-
value.compact.map { |v| _to_hash(v) }
|
|
326
|
-
elsif value.is_a?(Hash)
|
|
327
|
-
{}.tap do |hash|
|
|
328
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
329
|
-
end
|
|
330
|
-
elsif value.respond_to? :to_hash
|
|
331
|
-
value.to_hash
|
|
332
|
-
else
|
|
333
|
-
value
|
|
334
|
-
end
|
|
335
|
-
end
|
|
336
289
|
end
|
|
337
290
|
end
|