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 LinkSchema
|
|
17
|
+
class LinkSchema < ApiModelBase
|
|
18
18
|
# URI of the link.
|
|
19
19
|
attr_accessor :href
|
|
20
20
|
|
|
@@ -33,9 +33,14 @@ module Bandwidth
|
|
|
33
33
|
}
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
36
41
|
# Returns all the JSON keys this model knows about
|
|
37
42
|
def self.acceptable_attributes
|
|
38
|
-
|
|
43
|
+
acceptable_attribute_map.values
|
|
39
44
|
end
|
|
40
45
|
|
|
41
46
|
# Attribute type mapping.
|
|
@@ -61,9 +66,10 @@ module Bandwidth
|
|
|
61
66
|
end
|
|
62
67
|
|
|
63
68
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
70
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
-
if (!
|
|
66
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::LinkSchema`. Please check the name to make sure it's valid. List of attributes: " +
|
|
71
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::LinkSchema`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
73
|
end
|
|
68
74
|
h[k.to_sym] = v
|
|
69
75
|
}
|
|
@@ -141,61 +147,6 @@ module Bandwidth
|
|
|
141
147
|
new(transformed_hash)
|
|
142
148
|
end
|
|
143
149
|
|
|
144
|
-
# Deserializes the data based on type
|
|
145
|
-
# @param string type Data type
|
|
146
|
-
# @param string value Value to be deserialized
|
|
147
|
-
# @return [Object] Deserialized data
|
|
148
|
-
def self._deserialize(type, value)
|
|
149
|
-
case type.to_sym
|
|
150
|
-
when :Time
|
|
151
|
-
Time.parse(value)
|
|
152
|
-
when :Date
|
|
153
|
-
Date.parse(value)
|
|
154
|
-
when :String
|
|
155
|
-
value.to_s
|
|
156
|
-
when :Integer
|
|
157
|
-
value.to_i
|
|
158
|
-
when :Float
|
|
159
|
-
value.to_f
|
|
160
|
-
when :Boolean
|
|
161
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
162
|
-
true
|
|
163
|
-
else
|
|
164
|
-
false
|
|
165
|
-
end
|
|
166
|
-
when :Object
|
|
167
|
-
# generic object (usually a Hash), return directly
|
|
168
|
-
value
|
|
169
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
170
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
171
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
172
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
173
|
-
k_type = Regexp.last_match[:k_type]
|
|
174
|
-
v_type = Regexp.last_match[:v_type]
|
|
175
|
-
{}.tap do |hash|
|
|
176
|
-
value.each do |k, v|
|
|
177
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
178
|
-
end
|
|
179
|
-
end
|
|
180
|
-
else # model
|
|
181
|
-
# models (e.g. Pet) or oneOf
|
|
182
|
-
klass = Bandwidth.const_get(type)
|
|
183
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
# Returns the string representation of the object
|
|
188
|
-
# @return [String] String presentation of the object
|
|
189
|
-
def to_s
|
|
190
|
-
to_hash.to_s
|
|
191
|
-
end
|
|
192
|
-
|
|
193
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
194
|
-
# @return [Hash] Returns the object in the form of hash
|
|
195
|
-
def to_body
|
|
196
|
-
to_hash
|
|
197
|
-
end
|
|
198
|
-
|
|
199
150
|
# Returns the object in the form of hash
|
|
200
151
|
# @return [Hash] Returns the object in the form of hash
|
|
201
152
|
def to_hash
|
|
@@ -211,23 +162,5 @@ module Bandwidth
|
|
|
211
162
|
end
|
|
212
163
|
hash
|
|
213
164
|
end
|
|
214
|
-
|
|
215
|
-
# Outputs non-array value in the form of hash
|
|
216
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
217
|
-
# @param [Object] value Any valid value
|
|
218
|
-
# @return [Hash] Returns the value in the form of hash
|
|
219
|
-
def _to_hash(value)
|
|
220
|
-
if value.is_a?(Array)
|
|
221
|
-
value.compact.map { |v| _to_hash(v) }
|
|
222
|
-
elsif value.is_a?(Hash)
|
|
223
|
-
{}.tap do |hash|
|
|
224
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
225
|
-
end
|
|
226
|
-
elsif value.respond_to? :to_hash
|
|
227
|
-
value.to_hash
|
|
228
|
-
else
|
|
229
|
-
value
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
165
|
end
|
|
233
166
|
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 LinksObject
|
|
17
|
+
class LinksObject < ApiModelBase
|
|
18
18
|
# The first (or only) page of results matching the query.
|
|
19
19
|
attr_accessor :first
|
|
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::LinksObject`. 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::LinksObject`. 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 ListMessageItem
|
|
17
|
+
class ListMessageItem < ApiModelBase
|
|
18
18
|
# The message id
|
|
19
19
|
attr_accessor :message_id
|
|
20
20
|
|
|
@@ -132,9 +132,14 @@ module Bandwidth
|
|
|
132
132
|
}
|
|
133
133
|
end
|
|
134
134
|
|
|
135
|
+
# Returns attribute mapping this model knows about
|
|
136
|
+
def self.acceptable_attribute_map
|
|
137
|
+
attribute_map
|
|
138
|
+
end
|
|
139
|
+
|
|
135
140
|
# Returns all the JSON keys this model knows about
|
|
136
141
|
def self.acceptable_attributes
|
|
137
|
-
|
|
142
|
+
acceptable_attribute_map.values
|
|
138
143
|
end
|
|
139
144
|
|
|
140
145
|
# Attribute type mapping.
|
|
@@ -192,9 +197,10 @@ module Bandwidth
|
|
|
192
197
|
end
|
|
193
198
|
|
|
194
199
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
200
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
195
201
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
196
|
-
if (!
|
|
197
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ListMessageItem`. Please check the name to make sure it's valid. List of attributes: " +
|
|
202
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
203
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ListMessageItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
198
204
|
end
|
|
199
205
|
h[k.to_sym] = v
|
|
200
206
|
}
|
|
@@ -372,61 +378,6 @@ module Bandwidth
|
|
|
372
378
|
new(transformed_hash)
|
|
373
379
|
end
|
|
374
380
|
|
|
375
|
-
# Deserializes the data based on type
|
|
376
|
-
# @param string type Data type
|
|
377
|
-
# @param string value Value to be deserialized
|
|
378
|
-
# @return [Object] Deserialized data
|
|
379
|
-
def self._deserialize(type, value)
|
|
380
|
-
case type.to_sym
|
|
381
|
-
when :Time
|
|
382
|
-
Time.parse(value)
|
|
383
|
-
when :Date
|
|
384
|
-
Date.parse(value)
|
|
385
|
-
when :String
|
|
386
|
-
value.to_s
|
|
387
|
-
when :Integer
|
|
388
|
-
value.to_i
|
|
389
|
-
when :Float
|
|
390
|
-
value.to_f
|
|
391
|
-
when :Boolean
|
|
392
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
393
|
-
true
|
|
394
|
-
else
|
|
395
|
-
false
|
|
396
|
-
end
|
|
397
|
-
when :Object
|
|
398
|
-
# generic object (usually a Hash), return directly
|
|
399
|
-
value
|
|
400
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
401
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
402
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
403
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
404
|
-
k_type = Regexp.last_match[:k_type]
|
|
405
|
-
v_type = Regexp.last_match[:v_type]
|
|
406
|
-
{}.tap do |hash|
|
|
407
|
-
value.each do |k, v|
|
|
408
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
409
|
-
end
|
|
410
|
-
end
|
|
411
|
-
else # model
|
|
412
|
-
# models (e.g. Pet) or oneOf
|
|
413
|
-
klass = Bandwidth.const_get(type)
|
|
414
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
415
|
-
end
|
|
416
|
-
end
|
|
417
|
-
|
|
418
|
-
# Returns the string representation of the object
|
|
419
|
-
# @return [String] String presentation of the object
|
|
420
|
-
def to_s
|
|
421
|
-
to_hash.to_s
|
|
422
|
-
end
|
|
423
|
-
|
|
424
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
425
|
-
# @return [Hash] Returns the object in the form of hash
|
|
426
|
-
def to_body
|
|
427
|
-
to_hash
|
|
428
|
-
end
|
|
429
|
-
|
|
430
381
|
# Returns the object in the form of hash
|
|
431
382
|
# @return [Hash] Returns the object in the form of hash
|
|
432
383
|
def to_hash
|
|
@@ -442,23 +393,5 @@ module Bandwidth
|
|
|
442
393
|
end
|
|
443
394
|
hash
|
|
444
395
|
end
|
|
445
|
-
|
|
446
|
-
# Outputs non-array value in the form of hash
|
|
447
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
448
|
-
# @param [Object] value Any valid value
|
|
449
|
-
# @return [Hash] Returns the value in the form of hash
|
|
450
|
-
def _to_hash(value)
|
|
451
|
-
if value.is_a?(Array)
|
|
452
|
-
value.compact.map { |v| _to_hash(v) }
|
|
453
|
-
elsif value.is_a?(Hash)
|
|
454
|
-
{}.tap do |hash|
|
|
455
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
456
|
-
end
|
|
457
|
-
elsif value.respond_to? :to_hash
|
|
458
|
-
value.to_hash
|
|
459
|
-
else
|
|
460
|
-
value
|
|
461
|
-
end
|
|
462
|
-
end
|
|
463
396
|
end
|
|
464
397
|
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 LookupErrorResponse
|
|
17
|
+
class LookupErrorResponse < ApiModelBase
|
|
18
18
|
attr_accessor :links
|
|
19
19
|
|
|
20
20
|
# The phone number lookup response data
|
|
@@ -31,9 +31,14 @@ module Bandwidth
|
|
|
31
31
|
}
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
# Returns attribute mapping this model knows about
|
|
35
|
+
def self.acceptable_attribute_map
|
|
36
|
+
attribute_map
|
|
37
|
+
end
|
|
38
|
+
|
|
34
39
|
# Returns all the JSON keys this model knows about
|
|
35
40
|
def self.acceptable_attributes
|
|
36
|
-
|
|
41
|
+
acceptable_attribute_map.values
|
|
37
42
|
end
|
|
38
43
|
|
|
39
44
|
# 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::LookupErrorResponse`. 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::LookupErrorResponse`. 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
|
}
|
|
@@ -143,61 +149,6 @@ module Bandwidth
|
|
|
143
149
|
new(transformed_hash)
|
|
144
150
|
end
|
|
145
151
|
|
|
146
|
-
# Deserializes the data based on type
|
|
147
|
-
# @param string type Data type
|
|
148
|
-
# @param string value Value to be deserialized
|
|
149
|
-
# @return [Object] Deserialized data
|
|
150
|
-
def self._deserialize(type, value)
|
|
151
|
-
case type.to_sym
|
|
152
|
-
when :Time
|
|
153
|
-
Time.parse(value)
|
|
154
|
-
when :Date
|
|
155
|
-
Date.parse(value)
|
|
156
|
-
when :String
|
|
157
|
-
value.to_s
|
|
158
|
-
when :Integer
|
|
159
|
-
value.to_i
|
|
160
|
-
when :Float
|
|
161
|
-
value.to_f
|
|
162
|
-
when :Boolean
|
|
163
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
164
|
-
true
|
|
165
|
-
else
|
|
166
|
-
false
|
|
167
|
-
end
|
|
168
|
-
when :Object
|
|
169
|
-
# generic object (usually a Hash), return directly
|
|
170
|
-
value
|
|
171
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
172
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
173
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
174
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
175
|
-
k_type = Regexp.last_match[:k_type]
|
|
176
|
-
v_type = Regexp.last_match[:v_type]
|
|
177
|
-
{}.tap do |hash|
|
|
178
|
-
value.each do |k, v|
|
|
179
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
180
|
-
end
|
|
181
|
-
end
|
|
182
|
-
else # model
|
|
183
|
-
# models (e.g. Pet) or oneOf
|
|
184
|
-
klass = Bandwidth.const_get(type)
|
|
185
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
186
|
-
end
|
|
187
|
-
end
|
|
188
|
-
|
|
189
|
-
# Returns the string representation of the object
|
|
190
|
-
# @return [String] String presentation of the object
|
|
191
|
-
def to_s
|
|
192
|
-
to_hash.to_s
|
|
193
|
-
end
|
|
194
|
-
|
|
195
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
196
|
-
# @return [Hash] Returns the object in the form of hash
|
|
197
|
-
def to_body
|
|
198
|
-
to_hash
|
|
199
|
-
end
|
|
200
|
-
|
|
201
152
|
# Returns the object in the form of hash
|
|
202
153
|
# @return [Hash] Returns the object in the form of hash
|
|
203
154
|
def to_hash
|
|
@@ -213,23 +164,5 @@ module Bandwidth
|
|
|
213
164
|
end
|
|
214
165
|
hash
|
|
215
166
|
end
|
|
216
|
-
|
|
217
|
-
# Outputs non-array value in the form of hash
|
|
218
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
219
|
-
# @param [Object] value Any valid value
|
|
220
|
-
# @return [Hash] Returns the value in the form of hash
|
|
221
|
-
def _to_hash(value)
|
|
222
|
-
if value.is_a?(Array)
|
|
223
|
-
value.compact.map { |v| _to_hash(v) }
|
|
224
|
-
elsif value.is_a?(Hash)
|
|
225
|
-
{}.tap do |hash|
|
|
226
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
227
|
-
end
|
|
228
|
-
elsif value.respond_to? :to_hash
|
|
229
|
-
value.to_hash
|
|
230
|
-
else
|
|
231
|
-
value
|
|
232
|
-
end
|
|
233
|
-
end
|
|
234
167
|
end
|
|
235
168
|
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 LookupErrorSchema
|
|
17
|
+
class LookupErrorSchema < ApiModelBase
|
|
18
18
|
# Validation error code
|
|
19
19
|
attr_accessor :code
|
|
20
20
|
|
|
@@ -36,9 +36,14 @@ module Bandwidth
|
|
|
36
36
|
}
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
# Returns attribute mapping this model knows about
|
|
40
|
+
def self.acceptable_attribute_map
|
|
41
|
+
attribute_map
|
|
42
|
+
end
|
|
43
|
+
|
|
39
44
|
# Returns all the JSON keys this model knows about
|
|
40
45
|
def self.acceptable_attributes
|
|
41
|
-
|
|
46
|
+
acceptable_attribute_map.values
|
|
42
47
|
end
|
|
43
48
|
|
|
44
49
|
# Attribute type mapping.
|
|
@@ -65,9 +70,10 @@ module Bandwidth
|
|
|
65
70
|
end
|
|
66
71
|
|
|
67
72
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
73
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
68
74
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
69
|
-
if (!
|
|
70
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::LookupErrorSchema`. Please check the name to make sure it's valid. List of attributes: " +
|
|
75
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::LookupErrorSchema`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
71
77
|
end
|
|
72
78
|
h[k.to_sym] = v
|
|
73
79
|
}
|
|
@@ -150,61 +156,6 @@ module Bandwidth
|
|
|
150
156
|
new(transformed_hash)
|
|
151
157
|
end
|
|
152
158
|
|
|
153
|
-
# Deserializes the data based on type
|
|
154
|
-
# @param string type Data type
|
|
155
|
-
# @param string value Value to be deserialized
|
|
156
|
-
# @return [Object] Deserialized data
|
|
157
|
-
def self._deserialize(type, value)
|
|
158
|
-
case type.to_sym
|
|
159
|
-
when :Time
|
|
160
|
-
Time.parse(value)
|
|
161
|
-
when :Date
|
|
162
|
-
Date.parse(value)
|
|
163
|
-
when :String
|
|
164
|
-
value.to_s
|
|
165
|
-
when :Integer
|
|
166
|
-
value.to_i
|
|
167
|
-
when :Float
|
|
168
|
-
value.to_f
|
|
169
|
-
when :Boolean
|
|
170
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
171
|
-
true
|
|
172
|
-
else
|
|
173
|
-
false
|
|
174
|
-
end
|
|
175
|
-
when :Object
|
|
176
|
-
# generic object (usually a Hash), return directly
|
|
177
|
-
value
|
|
178
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
179
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
180
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
181
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
182
|
-
k_type = Regexp.last_match[:k_type]
|
|
183
|
-
v_type = Regexp.last_match[:v_type]
|
|
184
|
-
{}.tap do |hash|
|
|
185
|
-
value.each do |k, v|
|
|
186
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
187
|
-
end
|
|
188
|
-
end
|
|
189
|
-
else # model
|
|
190
|
-
# models (e.g. Pet) or oneOf
|
|
191
|
-
klass = Bandwidth.const_get(type)
|
|
192
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
193
|
-
end
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
# Returns the string representation of the object
|
|
197
|
-
# @return [String] String presentation of the object
|
|
198
|
-
def to_s
|
|
199
|
-
to_hash.to_s
|
|
200
|
-
end
|
|
201
|
-
|
|
202
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
203
|
-
# @return [Hash] Returns the object in the form of hash
|
|
204
|
-
def to_body
|
|
205
|
-
to_hash
|
|
206
|
-
end
|
|
207
|
-
|
|
208
159
|
# Returns the object in the form of hash
|
|
209
160
|
# @return [Hash] Returns the object in the form of hash
|
|
210
161
|
def to_hash
|
|
@@ -220,23 +171,5 @@ module Bandwidth
|
|
|
220
171
|
end
|
|
221
172
|
hash
|
|
222
173
|
end
|
|
223
|
-
|
|
224
|
-
# Outputs non-array value in the form of hash
|
|
225
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
226
|
-
# @param [Object] value Any valid value
|
|
227
|
-
# @return [Hash] Returns the value in the form of hash
|
|
228
|
-
def _to_hash(value)
|
|
229
|
-
if value.is_a?(Array)
|
|
230
|
-
value.compact.map { |v| _to_hash(v) }
|
|
231
|
-
elsif value.is_a?(Hash)
|
|
232
|
-
{}.tap do |hash|
|
|
233
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
234
|
-
end
|
|
235
|
-
elsif value.respond_to? :to_hash
|
|
236
|
-
value.to_hash
|
|
237
|
-
else
|
|
238
|
-
value
|
|
239
|
-
end
|
|
240
|
-
end
|
|
241
174
|
end
|
|
242
175
|
end
|