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