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 MultiChannelChannelListMMSResponseObject
|
|
17
|
+
class MultiChannelChannelListMMSResponseObject < ApiModelBase
|
|
18
18
|
# The sender ID of the message. This could be an alphanumeric sender ID.
|
|
19
19
|
attr_accessor :from
|
|
20
20
|
|
|
@@ -61,9 +61,14 @@ module Bandwidth
|
|
|
61
61
|
}
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
+
# Returns attribute mapping this model knows about
|
|
65
|
+
def self.acceptable_attribute_map
|
|
66
|
+
attribute_map
|
|
67
|
+
end
|
|
68
|
+
|
|
64
69
|
# Returns all the JSON keys this model knows about
|
|
65
70
|
def self.acceptable_attributes
|
|
66
|
-
|
|
71
|
+
acceptable_attribute_map.values
|
|
67
72
|
end
|
|
68
73
|
|
|
69
74
|
# Attribute type mapping.
|
|
@@ -99,9 +104,10 @@ module Bandwidth
|
|
|
99
104
|
end
|
|
100
105
|
|
|
101
106
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
107
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
102
108
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
103
|
-
if (!
|
|
104
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListMMSResponseObject`. Please check the name to make sure it's valid. List of attributes: " +
|
|
109
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
110
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListMMSResponseObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
105
111
|
end
|
|
106
112
|
h[k.to_sym] = v
|
|
107
113
|
}
|
|
@@ -177,6 +183,56 @@ module Bandwidth
|
|
|
177
183
|
true
|
|
178
184
|
end
|
|
179
185
|
|
|
186
|
+
# Custom attribute writer method with validation
|
|
187
|
+
# @param [Object] from Value to be assigned
|
|
188
|
+
def from=(from)
|
|
189
|
+
if from.nil?
|
|
190
|
+
fail ArgumentError, 'from cannot be nil'
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
@from = from
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Custom attribute writer method with validation
|
|
197
|
+
# @param [Object] application_id Value to be assigned
|
|
198
|
+
def application_id=(application_id)
|
|
199
|
+
if application_id.nil?
|
|
200
|
+
fail ArgumentError, 'application_id cannot be nil'
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
@application_id = application_id
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Custom attribute writer method with validation
|
|
207
|
+
# @param [Object] channel Value to be assigned
|
|
208
|
+
def channel=(channel)
|
|
209
|
+
if channel.nil?
|
|
210
|
+
fail ArgumentError, 'channel cannot be nil'
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
@channel = channel
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Custom attribute writer method with validation
|
|
217
|
+
# @param [Object] content Value to be assigned
|
|
218
|
+
def content=(content)
|
|
219
|
+
if content.nil?
|
|
220
|
+
fail ArgumentError, 'content cannot be nil'
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
@content = content
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Custom attribute writer method with validation
|
|
227
|
+
# @param [Object] owner Value to be assigned
|
|
228
|
+
def owner=(owner)
|
|
229
|
+
if owner.nil?
|
|
230
|
+
fail ArgumentError, 'owner cannot be nil'
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
@owner = owner
|
|
234
|
+
end
|
|
235
|
+
|
|
180
236
|
# Checks equality by comparing each attribute.
|
|
181
237
|
# @param [Object] Object to be compared
|
|
182
238
|
def ==(o)
|
|
@@ -224,61 +280,6 @@ module Bandwidth
|
|
|
224
280
|
new(transformed_hash)
|
|
225
281
|
end
|
|
226
282
|
|
|
227
|
-
# Deserializes the data based on type
|
|
228
|
-
# @param string type Data type
|
|
229
|
-
# @param string value Value to be deserialized
|
|
230
|
-
# @return [Object] Deserialized data
|
|
231
|
-
def self._deserialize(type, value)
|
|
232
|
-
case type.to_sym
|
|
233
|
-
when :Time
|
|
234
|
-
Time.parse(value)
|
|
235
|
-
when :Date
|
|
236
|
-
Date.parse(value)
|
|
237
|
-
when :String
|
|
238
|
-
value.to_s
|
|
239
|
-
when :Integer
|
|
240
|
-
value.to_i
|
|
241
|
-
when :Float
|
|
242
|
-
value.to_f
|
|
243
|
-
when :Boolean
|
|
244
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
245
|
-
true
|
|
246
|
-
else
|
|
247
|
-
false
|
|
248
|
-
end
|
|
249
|
-
when :Object
|
|
250
|
-
# generic object (usually a Hash), return directly
|
|
251
|
-
value
|
|
252
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
253
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
254
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
255
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
256
|
-
k_type = Regexp.last_match[:k_type]
|
|
257
|
-
v_type = Regexp.last_match[:v_type]
|
|
258
|
-
{}.tap do |hash|
|
|
259
|
-
value.each do |k, v|
|
|
260
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
261
|
-
end
|
|
262
|
-
end
|
|
263
|
-
else # model
|
|
264
|
-
# models (e.g. Pet) or oneOf
|
|
265
|
-
klass = Bandwidth.const_get(type)
|
|
266
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
267
|
-
end
|
|
268
|
-
end
|
|
269
|
-
|
|
270
|
-
# Returns the string representation of the object
|
|
271
|
-
# @return [String] String presentation of the object
|
|
272
|
-
def to_s
|
|
273
|
-
to_hash.to_s
|
|
274
|
-
end
|
|
275
|
-
|
|
276
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
277
|
-
# @return [Hash] Returns the object in the form of hash
|
|
278
|
-
def to_body
|
|
279
|
-
to_hash
|
|
280
|
-
end
|
|
281
|
-
|
|
282
283
|
# Returns the object in the form of hash
|
|
283
284
|
# @return [Hash] Returns the object in the form of hash
|
|
284
285
|
def to_hash
|
|
@@ -294,23 +295,5 @@ module Bandwidth
|
|
|
294
295
|
end
|
|
295
296
|
hash
|
|
296
297
|
end
|
|
297
|
-
|
|
298
|
-
# Outputs non-array value in the form of hash
|
|
299
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
300
|
-
# @param [Object] value Any valid value
|
|
301
|
-
# @return [Hash] Returns the value in the form of hash
|
|
302
|
-
def _to_hash(value)
|
|
303
|
-
if value.is_a?(Array)
|
|
304
|
-
value.compact.map { |v| _to_hash(v) }
|
|
305
|
-
elsif value.is_a?(Hash)
|
|
306
|
-
{}.tap do |hash|
|
|
307
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
308
|
-
end
|
|
309
|
-
elsif value.respond_to? :to_hash
|
|
310
|
-
value.to_hash
|
|
311
|
-
else
|
|
312
|
-
value
|
|
313
|
-
end
|
|
314
|
-
end
|
|
315
298
|
end
|
|
316
299
|
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 MultiChannelChannelListObjectBase
|
|
17
|
+
class MultiChannelChannelListObjectBase < ApiModelBase
|
|
18
18
|
# The sender ID of the message. This could be an alphanumeric sender ID.
|
|
19
19
|
attr_accessor :from
|
|
20
20
|
|
|
@@ -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::MultiChannelChannelListObjectBase`. 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::MultiChannelChannelListObjectBase`. 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
|
}
|
|
@@ -138,6 +144,36 @@ module Bandwidth
|
|
|
138
144
|
true
|
|
139
145
|
end
|
|
140
146
|
|
|
147
|
+
# Custom attribute writer method with validation
|
|
148
|
+
# @param [Object] from Value to be assigned
|
|
149
|
+
def from=(from)
|
|
150
|
+
if from.nil?
|
|
151
|
+
fail ArgumentError, 'from cannot be nil'
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
@from = from
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Custom attribute writer method with validation
|
|
158
|
+
# @param [Object] application_id Value to be assigned
|
|
159
|
+
def application_id=(application_id)
|
|
160
|
+
if application_id.nil?
|
|
161
|
+
fail ArgumentError, 'application_id cannot be nil'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
@application_id = application_id
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Custom attribute writer method with validation
|
|
168
|
+
# @param [Object] channel Value to be assigned
|
|
169
|
+
def channel=(channel)
|
|
170
|
+
if channel.nil?
|
|
171
|
+
fail ArgumentError, 'channel cannot be nil'
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
@channel = channel
|
|
175
|
+
end
|
|
176
|
+
|
|
141
177
|
# Checks equality by comparing each attribute.
|
|
142
178
|
# @param [Object] Object to be compared
|
|
143
179
|
def ==(o)
|
|
@@ -183,61 +219,6 @@ module Bandwidth
|
|
|
183
219
|
new(transformed_hash)
|
|
184
220
|
end
|
|
185
221
|
|
|
186
|
-
# Deserializes the data based on type
|
|
187
|
-
# @param string type Data type
|
|
188
|
-
# @param string value Value to be deserialized
|
|
189
|
-
# @return [Object] Deserialized data
|
|
190
|
-
def self._deserialize(type, value)
|
|
191
|
-
case type.to_sym
|
|
192
|
-
when :Time
|
|
193
|
-
Time.parse(value)
|
|
194
|
-
when :Date
|
|
195
|
-
Date.parse(value)
|
|
196
|
-
when :String
|
|
197
|
-
value.to_s
|
|
198
|
-
when :Integer
|
|
199
|
-
value.to_i
|
|
200
|
-
when :Float
|
|
201
|
-
value.to_f
|
|
202
|
-
when :Boolean
|
|
203
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
204
|
-
true
|
|
205
|
-
else
|
|
206
|
-
false
|
|
207
|
-
end
|
|
208
|
-
when :Object
|
|
209
|
-
# generic object (usually a Hash), return directly
|
|
210
|
-
value
|
|
211
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
212
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
213
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
214
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
215
|
-
k_type = Regexp.last_match[:k_type]
|
|
216
|
-
v_type = Regexp.last_match[:v_type]
|
|
217
|
-
{}.tap do |hash|
|
|
218
|
-
value.each do |k, v|
|
|
219
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
220
|
-
end
|
|
221
|
-
end
|
|
222
|
-
else # model
|
|
223
|
-
# models (e.g. Pet) or oneOf
|
|
224
|
-
klass = Bandwidth.const_get(type)
|
|
225
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
226
|
-
end
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
# Returns the string representation of the object
|
|
230
|
-
# @return [String] String presentation of the object
|
|
231
|
-
def to_s
|
|
232
|
-
to_hash.to_s
|
|
233
|
-
end
|
|
234
|
-
|
|
235
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
236
|
-
# @return [Hash] Returns the object in the form of hash
|
|
237
|
-
def to_body
|
|
238
|
-
to_hash
|
|
239
|
-
end
|
|
240
|
-
|
|
241
222
|
# Returns the object in the form of hash
|
|
242
223
|
# @return [Hash] Returns the object in the form of hash
|
|
243
224
|
def to_hash
|
|
@@ -253,23 +234,5 @@ module Bandwidth
|
|
|
253
234
|
end
|
|
254
235
|
hash
|
|
255
236
|
end
|
|
256
|
-
|
|
257
|
-
# Outputs non-array value in the form of hash
|
|
258
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
259
|
-
# @param [Object] value Any valid value
|
|
260
|
-
# @return [Hash] Returns the value in the form of hash
|
|
261
|
-
def _to_hash(value)
|
|
262
|
-
if value.is_a?(Array)
|
|
263
|
-
value.compact.map { |v| _to_hash(v) }
|
|
264
|
-
elsif value.is_a?(Hash)
|
|
265
|
-
{}.tap do |hash|
|
|
266
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
267
|
-
end
|
|
268
|
-
elsif value.respond_to? :to_hash
|
|
269
|
-
value.to_hash
|
|
270
|
-
else
|
|
271
|
-
value
|
|
272
|
-
end
|
|
273
|
-
end
|
|
274
237
|
end
|
|
275
238
|
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 MultiChannelChannelListOwnerObject
|
|
17
|
+
class MultiChannelChannelListOwnerObject < ApiModelBase
|
|
18
18
|
# The Bandwidth senderId associated with the message. Identical to 'from'.
|
|
19
19
|
attr_accessor :owner
|
|
20
20
|
|
|
@@ -25,9 +25,14 @@ module Bandwidth
|
|
|
25
25
|
}
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
28
33
|
# Returns all the JSON keys this model knows about
|
|
29
34
|
def self.acceptable_attributes
|
|
30
|
-
|
|
35
|
+
acceptable_attribute_map.values
|
|
31
36
|
end
|
|
32
37
|
|
|
33
38
|
# Attribute type mapping.
|
|
@@ -51,9 +56,10 @@ module Bandwidth
|
|
|
51
56
|
end
|
|
52
57
|
|
|
53
58
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
54
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
-
if (!
|
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListOwnerObject`. Please check the name to make sure it's valid. List of attributes: " +
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListOwnerObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
57
63
|
end
|
|
58
64
|
h[k.to_sym] = v
|
|
59
65
|
}
|
|
@@ -85,6 +91,16 @@ module Bandwidth
|
|
|
85
91
|
true
|
|
86
92
|
end
|
|
87
93
|
|
|
94
|
+
# Custom attribute writer method with validation
|
|
95
|
+
# @param [Object] owner Value to be assigned
|
|
96
|
+
def owner=(owner)
|
|
97
|
+
if owner.nil?
|
|
98
|
+
fail ArgumentError, 'owner cannot be nil'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
@owner = owner
|
|
102
|
+
end
|
|
103
|
+
|
|
88
104
|
# Checks equality by comparing each attribute.
|
|
89
105
|
# @param [Object] Object to be compared
|
|
90
106
|
def ==(o)
|
|
@@ -128,61 +144,6 @@ module Bandwidth
|
|
|
128
144
|
new(transformed_hash)
|
|
129
145
|
end
|
|
130
146
|
|
|
131
|
-
# Deserializes the data based on type
|
|
132
|
-
# @param string type Data type
|
|
133
|
-
# @param string value Value to be deserialized
|
|
134
|
-
# @return [Object] Deserialized data
|
|
135
|
-
def self._deserialize(type, value)
|
|
136
|
-
case type.to_sym
|
|
137
|
-
when :Time
|
|
138
|
-
Time.parse(value)
|
|
139
|
-
when :Date
|
|
140
|
-
Date.parse(value)
|
|
141
|
-
when :String
|
|
142
|
-
value.to_s
|
|
143
|
-
when :Integer
|
|
144
|
-
value.to_i
|
|
145
|
-
when :Float
|
|
146
|
-
value.to_f
|
|
147
|
-
when :Boolean
|
|
148
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
149
|
-
true
|
|
150
|
-
else
|
|
151
|
-
false
|
|
152
|
-
end
|
|
153
|
-
when :Object
|
|
154
|
-
# generic object (usually a Hash), return directly
|
|
155
|
-
value
|
|
156
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
157
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
158
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
159
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
160
|
-
k_type = Regexp.last_match[:k_type]
|
|
161
|
-
v_type = Regexp.last_match[:v_type]
|
|
162
|
-
{}.tap do |hash|
|
|
163
|
-
value.each do |k, v|
|
|
164
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
165
|
-
end
|
|
166
|
-
end
|
|
167
|
-
else # model
|
|
168
|
-
# models (e.g. Pet) or oneOf
|
|
169
|
-
klass = Bandwidth.const_get(type)
|
|
170
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
171
|
-
end
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
# Returns the string representation of the object
|
|
175
|
-
# @return [String] String presentation of the object
|
|
176
|
-
def to_s
|
|
177
|
-
to_hash.to_s
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
181
|
-
# @return [Hash] Returns the object in the form of hash
|
|
182
|
-
def to_body
|
|
183
|
-
to_hash
|
|
184
|
-
end
|
|
185
|
-
|
|
186
147
|
# Returns the object in the form of hash
|
|
187
148
|
# @return [Hash] Returns the object in the form of hash
|
|
188
149
|
def to_hash
|
|
@@ -198,23 +159,5 @@ module Bandwidth
|
|
|
198
159
|
end
|
|
199
160
|
hash
|
|
200
161
|
end
|
|
201
|
-
|
|
202
|
-
# Outputs non-array value in the form of hash
|
|
203
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
204
|
-
# @param [Object] value Any valid value
|
|
205
|
-
# @return [Hash] Returns the value in the form of hash
|
|
206
|
-
def _to_hash(value)
|
|
207
|
-
if value.is_a?(Array)
|
|
208
|
-
value.compact.map { |v| _to_hash(v) }
|
|
209
|
-
elsif value.is_a?(Hash)
|
|
210
|
-
{}.tap do |hash|
|
|
211
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
212
|
-
end
|
|
213
|
-
elsif value.respond_to? :to_hash
|
|
214
|
-
value.to_hash
|
|
215
|
-
else
|
|
216
|
-
value
|
|
217
|
-
end
|
|
218
|
-
end
|
|
219
162
|
end
|
|
220
163
|
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 MultiChannelChannelListRBMObject
|
|
17
|
+
class MultiChannelChannelListRBMObject < ApiModelBase
|
|
18
18
|
# The sender ID of the message. This could be an alphanumeric sender ID.
|
|
19
19
|
attr_accessor :from
|
|
20
20
|
|
|
@@ -57,9 +57,14 @@ module Bandwidth
|
|
|
57
57
|
}
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
+
# Returns attribute mapping this model knows about
|
|
61
|
+
def self.acceptable_attribute_map
|
|
62
|
+
attribute_map
|
|
63
|
+
end
|
|
64
|
+
|
|
60
65
|
# Returns all the JSON keys this model knows about
|
|
61
66
|
def self.acceptable_attributes
|
|
62
|
-
|
|
67
|
+
acceptable_attribute_map.values
|
|
63
68
|
end
|
|
64
69
|
|
|
65
70
|
# Attribute type mapping.
|
|
@@ -93,9 +98,10 @@ module Bandwidth
|
|
|
93
98
|
end
|
|
94
99
|
|
|
95
100
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
101
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
96
102
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
97
|
-
if (!
|
|
98
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListRBMObject`. Please check the name to make sure it's valid. List of attributes: " +
|
|
103
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
104
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListRBMObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
99
105
|
end
|
|
100
106
|
h[k.to_sym] = v
|
|
101
107
|
}
|
|
@@ -160,6 +166,46 @@ module Bandwidth
|
|
|
160
166
|
true
|
|
161
167
|
end
|
|
162
168
|
|
|
169
|
+
# Custom attribute writer method with validation
|
|
170
|
+
# @param [Object] from Value to be assigned
|
|
171
|
+
def from=(from)
|
|
172
|
+
if from.nil?
|
|
173
|
+
fail ArgumentError, 'from cannot be nil'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
@from = from
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Custom attribute writer method with validation
|
|
180
|
+
# @param [Object] application_id Value to be assigned
|
|
181
|
+
def application_id=(application_id)
|
|
182
|
+
if application_id.nil?
|
|
183
|
+
fail ArgumentError, 'application_id cannot be nil'
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
@application_id = application_id
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Custom attribute writer method with validation
|
|
190
|
+
# @param [Object] channel Value to be assigned
|
|
191
|
+
def channel=(channel)
|
|
192
|
+
if channel.nil?
|
|
193
|
+
fail ArgumentError, 'channel cannot be nil'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
@channel = channel
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Custom attribute writer method with validation
|
|
200
|
+
# @param [Object] content Value to be assigned
|
|
201
|
+
def content=(content)
|
|
202
|
+
if content.nil?
|
|
203
|
+
fail ArgumentError, 'content cannot be nil'
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
@content = content
|
|
207
|
+
end
|
|
208
|
+
|
|
163
209
|
# Checks equality by comparing each attribute.
|
|
164
210
|
# @param [Object] Object to be compared
|
|
165
211
|
def ==(o)
|
|
@@ -206,61 +252,6 @@ module Bandwidth
|
|
|
206
252
|
new(transformed_hash)
|
|
207
253
|
end
|
|
208
254
|
|
|
209
|
-
# Deserializes the data based on type
|
|
210
|
-
# @param string type Data type
|
|
211
|
-
# @param string value Value to be deserialized
|
|
212
|
-
# @return [Object] Deserialized data
|
|
213
|
-
def self._deserialize(type, value)
|
|
214
|
-
case type.to_sym
|
|
215
|
-
when :Time
|
|
216
|
-
Time.parse(value)
|
|
217
|
-
when :Date
|
|
218
|
-
Date.parse(value)
|
|
219
|
-
when :String
|
|
220
|
-
value.to_s
|
|
221
|
-
when :Integer
|
|
222
|
-
value.to_i
|
|
223
|
-
when :Float
|
|
224
|
-
value.to_f
|
|
225
|
-
when :Boolean
|
|
226
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
227
|
-
true
|
|
228
|
-
else
|
|
229
|
-
false
|
|
230
|
-
end
|
|
231
|
-
when :Object
|
|
232
|
-
# generic object (usually a Hash), return directly
|
|
233
|
-
value
|
|
234
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
235
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
236
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
237
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
238
|
-
k_type = Regexp.last_match[:k_type]
|
|
239
|
-
v_type = Regexp.last_match[:v_type]
|
|
240
|
-
{}.tap do |hash|
|
|
241
|
-
value.each do |k, v|
|
|
242
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
243
|
-
end
|
|
244
|
-
end
|
|
245
|
-
else # model
|
|
246
|
-
# models (e.g. Pet) or oneOf
|
|
247
|
-
klass = Bandwidth.const_get(type)
|
|
248
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
249
|
-
end
|
|
250
|
-
end
|
|
251
|
-
|
|
252
|
-
# Returns the string representation of the object
|
|
253
|
-
# @return [String] String presentation of the object
|
|
254
|
-
def to_s
|
|
255
|
-
to_hash.to_s
|
|
256
|
-
end
|
|
257
|
-
|
|
258
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
259
|
-
# @return [Hash] Returns the object in the form of hash
|
|
260
|
-
def to_body
|
|
261
|
-
to_hash
|
|
262
|
-
end
|
|
263
|
-
|
|
264
255
|
# Returns the object in the form of hash
|
|
265
256
|
# @return [Hash] Returns the object in the form of hash
|
|
266
257
|
def to_hash
|
|
@@ -276,23 +267,5 @@ module Bandwidth
|
|
|
276
267
|
end
|
|
277
268
|
hash
|
|
278
269
|
end
|
|
279
|
-
|
|
280
|
-
# Outputs non-array value in the form of hash
|
|
281
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
282
|
-
# @param [Object] value Any valid value
|
|
283
|
-
# @return [Hash] Returns the value in the form of hash
|
|
284
|
-
def _to_hash(value)
|
|
285
|
-
if value.is_a?(Array)
|
|
286
|
-
value.compact.map { |v| _to_hash(v) }
|
|
287
|
-
elsif value.is_a?(Hash)
|
|
288
|
-
{}.tap do |hash|
|
|
289
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
290
|
-
end
|
|
291
|
-
elsif value.respond_to? :to_hash
|
|
292
|
-
value.to_hash
|
|
293
|
-
else
|
|
294
|
-
value
|
|
295
|
-
end
|
|
296
|
-
end
|
|
297
270
|
end
|
|
298
271
|
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
|
|
|
@@ -40,8 +40,7 @@ module Bandwidth
|
|
|
40
40
|
openapi_one_of.each do |klass|
|
|
41
41
|
begin
|
|
42
42
|
next if klass == :AnyType # "nullable: true"
|
|
43
|
-
|
|
44
|
-
return typed_data if typed_data
|
|
43
|
+
return find_and_cast_into_type(klass, data)
|
|
45
44
|
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
46
45
|
end
|
|
47
46
|
end
|
|
@@ -67,7 +66,7 @@ module Bandwidth
|
|
|
67
66
|
when 'Time'
|
|
68
67
|
return Time.parse(data)
|
|
69
68
|
when 'Date'
|
|
70
|
-
return Date.
|
|
69
|
+
return Date.iso8601(data)
|
|
71
70
|
when 'String'
|
|
72
71
|
return data if data.instance_of?(String)
|
|
73
72
|
when 'Object' # "type: object"
|