bandwidth-sdk 17.0.0 → 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 +4 -4
- data/README.md +29 -3
- data/bandwidth-sdk.gemspec +1 -2
- data/bandwidth.yml +85 -22
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +317 -487
- data/coverage/index.html +6317 -7908
- 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/MultiChannelAction.md +32 -81
- data/docs/MultiChannelApi.md +5 -2
- data/docs/{MultiChannelChannelListObject.md → MultiChannelChannelListMMSObject.md} +3 -3
- data/docs/{MultiChannelMessageResponseDataChannelListInner.md → MultiChannelChannelListMMSResponseObject.md} +3 -3
- data/docs/MultiChannelChannelListObjectBase.md +22 -0
- data/docs/MultiChannelChannelListOwnerObject.md +18 -0
- data/docs/MultiChannelChannelListRBMObject.md +24 -0
- data/docs/{MultiChannelChannelListObjectContent.md → MultiChannelChannelListRBMObjectAllOfContent.md} +6 -10
- data/docs/MultiChannelChannelListRBMResponseObject.md +26 -0
- data/docs/MultiChannelChannelListRequestObject.md +24 -0
- data/docs/MultiChannelChannelListResponseObject.md +26 -0
- data/docs/MultiChannelChannelListSMSObject.md +24 -0
- data/docs/MultiChannelChannelListSMSResponseObject.md +26 -0
- data/docs/MultiChannelMessageRequest.md +1 -1
- data/docs/MultiChannelMessageResponseData.md +1 -1
- data/docs/PhoneNumberLookupApi.md +12 -3
- data/docs/RbmActionBase.md +1 -1
- data/docs/RbmSuggestionResponse.md +1 -1
- 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 +71 -27
- data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +41 -78
- data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object.rb → multi_channel_channel_list_mms_object.rb} +60 -80
- data/lib/bandwidth-sdk/models/{multi_channel_message_response_data_channel_list_inner.rb → multi_channel_channel_list_mms_response_object.rb} +65 -81
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_base.rb +238 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_owner_object.rb +163 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object.rb +271 -0
- data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object_content.rb → multi_channel_channel_list_rbm_object_all_of_content.rb} +5 -8
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_response_object.rb +299 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_request_object.rb +103 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_response_object.rb +103 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_object.rb +271 -0
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_response_object.rb +299 -0
- 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 +22 -79
- data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +42 -79
- 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 +13 -4
- 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 +128 -25
- data/spec/smoke/phone_number_lookup_api_spec.rb +7 -5
- 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/api/multi_channel_api_spec.rb +13 -2
- data/spec/unit/models/verify_code_request_spec.rb +1 -1
- metadata +27 -8
|
@@ -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 RbmCardContent
|
|
17
|
+
class RbmCardContent < ApiModelBase
|
|
18
18
|
# The title of the card. Must be 200 characters or less.
|
|
19
19
|
attr_accessor :title
|
|
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::RbmCardContent`. 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::RbmCardContent`. 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
|
}
|
|
@@ -209,61 +215,6 @@ module Bandwidth
|
|
|
209
215
|
new(transformed_hash)
|
|
210
216
|
end
|
|
211
217
|
|
|
212
|
-
# Deserializes the data based on type
|
|
213
|
-
# @param string type Data type
|
|
214
|
-
# @param string value Value to be deserialized
|
|
215
|
-
# @return [Object] Deserialized data
|
|
216
|
-
def self._deserialize(type, value)
|
|
217
|
-
case type.to_sym
|
|
218
|
-
when :Time
|
|
219
|
-
Time.parse(value)
|
|
220
|
-
when :Date
|
|
221
|
-
Date.parse(value)
|
|
222
|
-
when :String
|
|
223
|
-
value.to_s
|
|
224
|
-
when :Integer
|
|
225
|
-
value.to_i
|
|
226
|
-
when :Float
|
|
227
|
-
value.to_f
|
|
228
|
-
when :Boolean
|
|
229
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
230
|
-
true
|
|
231
|
-
else
|
|
232
|
-
false
|
|
233
|
-
end
|
|
234
|
-
when :Object
|
|
235
|
-
# generic object (usually a Hash), return directly
|
|
236
|
-
value
|
|
237
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
238
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
239
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
240
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
241
|
-
k_type = Regexp.last_match[:k_type]
|
|
242
|
-
v_type = Regexp.last_match[:v_type]
|
|
243
|
-
{}.tap do |hash|
|
|
244
|
-
value.each do |k, v|
|
|
245
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
246
|
-
end
|
|
247
|
-
end
|
|
248
|
-
else # model
|
|
249
|
-
# models (e.g. Pet) or oneOf
|
|
250
|
-
klass = Bandwidth.const_get(type)
|
|
251
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
252
|
-
end
|
|
253
|
-
end
|
|
254
|
-
|
|
255
|
-
# Returns the string representation of the object
|
|
256
|
-
# @return [String] String presentation of the object
|
|
257
|
-
def to_s
|
|
258
|
-
to_hash.to_s
|
|
259
|
-
end
|
|
260
|
-
|
|
261
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
262
|
-
# @return [Hash] Returns the object in the form of hash
|
|
263
|
-
def to_body
|
|
264
|
-
to_hash
|
|
265
|
-
end
|
|
266
|
-
|
|
267
218
|
# Returns the object in the form of hash
|
|
268
219
|
# @return [Hash] Returns the object in the form of hash
|
|
269
220
|
def to_hash
|
|
@@ -279,23 +230,5 @@ module Bandwidth
|
|
|
279
230
|
end
|
|
280
231
|
hash
|
|
281
232
|
end
|
|
282
|
-
|
|
283
|
-
# Outputs non-array value in the form of hash
|
|
284
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
285
|
-
# @param [Object] value Any valid value
|
|
286
|
-
# @return [Hash] Returns the value in the form of hash
|
|
287
|
-
def _to_hash(value)
|
|
288
|
-
if value.is_a?(Array)
|
|
289
|
-
value.compact.map { |v| _to_hash(v) }
|
|
290
|
-
elsif value.is_a?(Hash)
|
|
291
|
-
{}.tap do |hash|
|
|
292
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
293
|
-
end
|
|
294
|
-
elsif value.respond_to? :to_hash
|
|
295
|
-
value.to_hash
|
|
296
|
-
else
|
|
297
|
-
value
|
|
298
|
-
end
|
|
299
|
-
end
|
|
300
233
|
end
|
|
301
234
|
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 RbmCardContentMedia
|
|
17
|
+
class RbmCardContentMedia < ApiModelBase
|
|
18
18
|
# The URL of the media file. 100MB is the maximum file size.
|
|
19
19
|
attr_accessor :file_url
|
|
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.
|
|
@@ -89,9 +94,10 @@ module Bandwidth
|
|
|
89
94
|
end
|
|
90
95
|
|
|
91
96
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
97
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
92
98
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
93
|
-
if (!
|
|
94
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmCardContentMedia`. Please check the name to make sure it's valid. List of attributes: " +
|
|
99
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
100
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmCardContentMedia`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
95
101
|
end
|
|
96
102
|
h[k.to_sym] = v
|
|
97
103
|
}
|
|
@@ -176,6 +182,16 @@ module Bandwidth
|
|
|
176
182
|
@thumbnail_url = thumbnail_url
|
|
177
183
|
end
|
|
178
184
|
|
|
185
|
+
# Custom attribute writer method with validation
|
|
186
|
+
# @param [Object] height Value to be assigned
|
|
187
|
+
def height=(height)
|
|
188
|
+
if height.nil?
|
|
189
|
+
fail ArgumentError, 'height cannot be nil'
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
@height = height
|
|
193
|
+
end
|
|
194
|
+
|
|
179
195
|
# Checks equality by comparing each attribute.
|
|
180
196
|
# @param [Object] Object to be compared
|
|
181
197
|
def ==(o)
|
|
@@ -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 RbmLocationResponse
|
|
17
|
+
class RbmLocationResponse < ApiModelBase
|
|
18
18
|
# The latitude of the client's location.
|
|
19
19
|
attr_accessor :latitude
|
|
20
20
|
|
|
@@ -29,9 +29,14 @@ module Bandwidth
|
|
|
29
29
|
}
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
32
37
|
# Returns all the JSON keys this model knows about
|
|
33
38
|
def self.acceptable_attributes
|
|
34
|
-
|
|
39
|
+
acceptable_attribute_map.values
|
|
35
40
|
end
|
|
36
41
|
|
|
37
42
|
# Attribute type mapping.
|
|
@@ -56,9 +61,10 @@ module Bandwidth
|
|
|
56
61
|
end
|
|
57
62
|
|
|
58
63
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
65
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
-
if (!
|
|
61
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmLocationResponse`. Please check the name to make sure it's valid. List of attributes: " +
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmLocationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
68
|
end
|
|
63
69
|
h[k.to_sym] = v
|
|
64
70
|
}
|
|
@@ -131,61 +137,6 @@ module Bandwidth
|
|
|
131
137
|
new(transformed_hash)
|
|
132
138
|
end
|
|
133
139
|
|
|
134
|
-
# Deserializes the data based on type
|
|
135
|
-
# @param string type Data type
|
|
136
|
-
# @param string value Value to be deserialized
|
|
137
|
-
# @return [Object] Deserialized data
|
|
138
|
-
def self._deserialize(type, value)
|
|
139
|
-
case type.to_sym
|
|
140
|
-
when :Time
|
|
141
|
-
Time.parse(value)
|
|
142
|
-
when :Date
|
|
143
|
-
Date.parse(value)
|
|
144
|
-
when :String
|
|
145
|
-
value.to_s
|
|
146
|
-
when :Integer
|
|
147
|
-
value.to_i
|
|
148
|
-
when :Float
|
|
149
|
-
value.to_f
|
|
150
|
-
when :Boolean
|
|
151
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
152
|
-
true
|
|
153
|
-
else
|
|
154
|
-
false
|
|
155
|
-
end
|
|
156
|
-
when :Object
|
|
157
|
-
# generic object (usually a Hash), return directly
|
|
158
|
-
value
|
|
159
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
160
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
161
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
162
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
163
|
-
k_type = Regexp.last_match[:k_type]
|
|
164
|
-
v_type = Regexp.last_match[:v_type]
|
|
165
|
-
{}.tap do |hash|
|
|
166
|
-
value.each do |k, v|
|
|
167
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
168
|
-
end
|
|
169
|
-
end
|
|
170
|
-
else # model
|
|
171
|
-
# models (e.g. Pet) or oneOf
|
|
172
|
-
klass = Bandwidth.const_get(type)
|
|
173
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
174
|
-
end
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
# Returns the string representation of the object
|
|
178
|
-
# @return [String] String presentation of the object
|
|
179
|
-
def to_s
|
|
180
|
-
to_hash.to_s
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
184
|
-
# @return [Hash] Returns the object in the form of hash
|
|
185
|
-
def to_body
|
|
186
|
-
to_hash
|
|
187
|
-
end
|
|
188
|
-
|
|
189
140
|
# Returns the object in the form of hash
|
|
190
141
|
# @return [Hash] Returns the object in the form of hash
|
|
191
142
|
def to_hash
|
|
@@ -201,23 +152,5 @@ module Bandwidth
|
|
|
201
152
|
end
|
|
202
153
|
hash
|
|
203
154
|
end
|
|
204
|
-
|
|
205
|
-
# Outputs non-array value in the form of hash
|
|
206
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
207
|
-
# @param [Object] value Any valid value
|
|
208
|
-
# @return [Hash] Returns the value in the form of hash
|
|
209
|
-
def _to_hash(value)
|
|
210
|
-
if value.is_a?(Array)
|
|
211
|
-
value.compact.map { |v| _to_hash(v) }
|
|
212
|
-
elsif value.is_a?(Hash)
|
|
213
|
-
{}.tap do |hash|
|
|
214
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
215
|
-
end
|
|
216
|
-
elsif value.respond_to? :to_hash
|
|
217
|
-
value.to_hash
|
|
218
|
-
else
|
|
219
|
-
value
|
|
220
|
-
end
|
|
221
|
-
end
|
|
222
155
|
end
|
|
223
156
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
|
7
7
|
Contact: letstalk@bandwidth.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.17.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
|
-
class RbmMessageCarouselCard
|
|
17
|
+
class RbmMessageCarouselCard < ApiModelBase
|
|
18
18
|
attr_accessor :card_width
|
|
19
19
|
|
|
20
20
|
attr_accessor :card_contents
|
|
@@ -53,9 +53,14 @@ module Bandwidth
|
|
|
53
53
|
}
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
+
# Returns attribute mapping this model knows about
|
|
57
|
+
def self.acceptable_attribute_map
|
|
58
|
+
attribute_map
|
|
59
|
+
end
|
|
60
|
+
|
|
56
61
|
# Returns all the JSON keys this model knows about
|
|
57
62
|
def self.acceptable_attributes
|
|
58
|
-
|
|
63
|
+
acceptable_attribute_map.values
|
|
59
64
|
end
|
|
60
65
|
|
|
61
66
|
# Attribute type mapping.
|
|
@@ -81,9 +86,10 @@ module Bandwidth
|
|
|
81
86
|
end
|
|
82
87
|
|
|
83
88
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
89
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
84
90
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
85
|
-
if (!
|
|
86
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmMessageCarouselCard`. Please check the name to make sure it's valid. List of attributes: " +
|
|
91
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmMessageCarouselCard`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
87
93
|
end
|
|
88
94
|
h[k.to_sym] = v
|
|
89
95
|
}
|
|
@@ -144,6 +150,16 @@ module Bandwidth
|
|
|
144
150
|
true
|
|
145
151
|
end
|
|
146
152
|
|
|
153
|
+
# Custom attribute writer method with validation
|
|
154
|
+
# @param [Object] card_width Value to be assigned
|
|
155
|
+
def card_width=(card_width)
|
|
156
|
+
if card_width.nil?
|
|
157
|
+
fail ArgumentError, 'card_width cannot be nil'
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
@card_width = card_width
|
|
161
|
+
end
|
|
162
|
+
|
|
147
163
|
# Custom attribute writer method with validation
|
|
148
164
|
# @param [Object] card_contents Value to be assigned
|
|
149
165
|
def card_contents=(card_contents)
|
|
@@ -217,61 +233,6 @@ module Bandwidth
|
|
|
217
233
|
new(transformed_hash)
|
|
218
234
|
end
|
|
219
235
|
|
|
220
|
-
# Deserializes the data based on type
|
|
221
|
-
# @param string type Data type
|
|
222
|
-
# @param string value Value to be deserialized
|
|
223
|
-
# @return [Object] Deserialized data
|
|
224
|
-
def self._deserialize(type, value)
|
|
225
|
-
case type.to_sym
|
|
226
|
-
when :Time
|
|
227
|
-
Time.parse(value)
|
|
228
|
-
when :Date
|
|
229
|
-
Date.parse(value)
|
|
230
|
-
when :String
|
|
231
|
-
value.to_s
|
|
232
|
-
when :Integer
|
|
233
|
-
value.to_i
|
|
234
|
-
when :Float
|
|
235
|
-
value.to_f
|
|
236
|
-
when :Boolean
|
|
237
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
238
|
-
true
|
|
239
|
-
else
|
|
240
|
-
false
|
|
241
|
-
end
|
|
242
|
-
when :Object
|
|
243
|
-
# generic object (usually a Hash), return directly
|
|
244
|
-
value
|
|
245
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
246
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
247
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
248
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
249
|
-
k_type = Regexp.last_match[:k_type]
|
|
250
|
-
v_type = Regexp.last_match[:v_type]
|
|
251
|
-
{}.tap do |hash|
|
|
252
|
-
value.each do |k, v|
|
|
253
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
254
|
-
end
|
|
255
|
-
end
|
|
256
|
-
else # model
|
|
257
|
-
# models (e.g. Pet) or oneOf
|
|
258
|
-
klass = Bandwidth.const_get(type)
|
|
259
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
260
|
-
end
|
|
261
|
-
end
|
|
262
|
-
|
|
263
|
-
# Returns the string representation of the object
|
|
264
|
-
# @return [String] String presentation of the object
|
|
265
|
-
def to_s
|
|
266
|
-
to_hash.to_s
|
|
267
|
-
end
|
|
268
|
-
|
|
269
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
270
|
-
# @return [Hash] Returns the object in the form of hash
|
|
271
|
-
def to_body
|
|
272
|
-
to_hash
|
|
273
|
-
end
|
|
274
|
-
|
|
275
236
|
# Returns the object in the form of hash
|
|
276
237
|
# @return [Hash] Returns the object in the form of hash
|
|
277
238
|
def to_hash
|
|
@@ -287,23 +248,5 @@ module Bandwidth
|
|
|
287
248
|
end
|
|
288
249
|
hash
|
|
289
250
|
end
|
|
290
|
-
|
|
291
|
-
# Outputs non-array value in the form of hash
|
|
292
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
293
|
-
# @param [Object] value Any valid value
|
|
294
|
-
# @return [Hash] Returns the value in the form of hash
|
|
295
|
-
def _to_hash(value)
|
|
296
|
-
if value.is_a?(Array)
|
|
297
|
-
value.compact.map { |v| _to_hash(v) }
|
|
298
|
-
elsif value.is_a?(Hash)
|
|
299
|
-
{}.tap do |hash|
|
|
300
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
301
|
-
end
|
|
302
|
-
elsif value.respond_to? :to_hash
|
|
303
|
-
value.to_hash
|
|
304
|
-
else
|
|
305
|
-
value
|
|
306
|
-
end
|
|
307
|
-
end
|
|
308
251
|
end
|
|
309
252
|
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 RbmMessageContentFile
|
|
17
|
+
class RbmMessageContentFile < ApiModelBase
|
|
18
18
|
# The URL of the media file. 100MB is the maximum file size.
|
|
19
19
|
attr_accessor :file_url
|
|
20
20
|
|
|
@@ -29,9 +29,14 @@ module Bandwidth
|
|
|
29
29
|
}
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
32
37
|
# Returns all the JSON keys this model knows about
|
|
33
38
|
def self.acceptable_attributes
|
|
34
|
-
|
|
39
|
+
acceptable_attribute_map.values
|
|
35
40
|
end
|
|
36
41
|
|
|
37
42
|
# Attribute type mapping.
|
|
@@ -56,9 +61,10 @@ module Bandwidth
|
|
|
56
61
|
end
|
|
57
62
|
|
|
58
63
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
65
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
-
if (!
|
|
61
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmMessageContentFile`. Please check the name to make sure it's valid. List of attributes: " +
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmMessageContentFile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
68
|
end
|
|
63
69
|
h[k.to_sym] = v
|
|
64
70
|
}
|
|
@@ -176,61 +182,6 @@ module Bandwidth
|
|
|
176
182
|
new(transformed_hash)
|
|
177
183
|
end
|
|
178
184
|
|
|
179
|
-
# Deserializes the data based on type
|
|
180
|
-
# @param string type Data type
|
|
181
|
-
# @param string value Value to be deserialized
|
|
182
|
-
# @return [Object] Deserialized data
|
|
183
|
-
def self._deserialize(type, value)
|
|
184
|
-
case type.to_sym
|
|
185
|
-
when :Time
|
|
186
|
-
Time.parse(value)
|
|
187
|
-
when :Date
|
|
188
|
-
Date.parse(value)
|
|
189
|
-
when :String
|
|
190
|
-
value.to_s
|
|
191
|
-
when :Integer
|
|
192
|
-
value.to_i
|
|
193
|
-
when :Float
|
|
194
|
-
value.to_f
|
|
195
|
-
when :Boolean
|
|
196
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
197
|
-
true
|
|
198
|
-
else
|
|
199
|
-
false
|
|
200
|
-
end
|
|
201
|
-
when :Object
|
|
202
|
-
# generic object (usually a Hash), return directly
|
|
203
|
-
value
|
|
204
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
205
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
206
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
207
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
208
|
-
k_type = Regexp.last_match[:k_type]
|
|
209
|
-
v_type = Regexp.last_match[:v_type]
|
|
210
|
-
{}.tap do |hash|
|
|
211
|
-
value.each do |k, v|
|
|
212
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
213
|
-
end
|
|
214
|
-
end
|
|
215
|
-
else # model
|
|
216
|
-
# models (e.g. Pet) or oneOf
|
|
217
|
-
klass = Bandwidth.const_get(type)
|
|
218
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
219
|
-
end
|
|
220
|
-
end
|
|
221
|
-
|
|
222
|
-
# Returns the string representation of the object
|
|
223
|
-
# @return [String] String presentation of the object
|
|
224
|
-
def to_s
|
|
225
|
-
to_hash.to_s
|
|
226
|
-
end
|
|
227
|
-
|
|
228
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
229
|
-
# @return [Hash] Returns the object in the form of hash
|
|
230
|
-
def to_body
|
|
231
|
-
to_hash
|
|
232
|
-
end
|
|
233
|
-
|
|
234
185
|
# Returns the object in the form of hash
|
|
235
186
|
# @return [Hash] Returns the object in the form of hash
|
|
236
187
|
def to_hash
|
|
@@ -246,23 +197,5 @@ module Bandwidth
|
|
|
246
197
|
end
|
|
247
198
|
hash
|
|
248
199
|
end
|
|
249
|
-
|
|
250
|
-
# Outputs non-array value in the form of hash
|
|
251
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
252
|
-
# @param [Object] value Any valid value
|
|
253
|
-
# @return [Hash] Returns the value in the form of hash
|
|
254
|
-
def _to_hash(value)
|
|
255
|
-
if value.is_a?(Array)
|
|
256
|
-
value.compact.map { |v| _to_hash(v) }
|
|
257
|
-
elsif value.is_a?(Hash)
|
|
258
|
-
{}.tap do |hash|
|
|
259
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
260
|
-
end
|
|
261
|
-
elsif value.respond_to? :to_hash
|
|
262
|
-
value.to_hash
|
|
263
|
-
else
|
|
264
|
-
value
|
|
265
|
-
end
|
|
266
|
-
end
|
|
267
200
|
end
|
|
268
201
|
end
|