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
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
17
|
# Represents a status callback for an outbound MT SMS or MMS or RBM message.
|
|
18
|
-
class StatusCallback
|
|
18
|
+
class StatusCallback < ApiModelBase
|
|
19
19
|
attr_accessor :time
|
|
20
20
|
|
|
21
21
|
# Represents the time at which the message was read, for `message-read` callbacks.
|
|
@@ -73,9 +73,14 @@ module Bandwidth
|
|
|
73
73
|
}
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
+
# Returns attribute mapping this model knows about
|
|
77
|
+
def self.acceptable_attribute_map
|
|
78
|
+
attribute_map
|
|
79
|
+
end
|
|
80
|
+
|
|
76
81
|
# Returns all the JSON keys this model knows about
|
|
77
82
|
def self.acceptable_attributes
|
|
78
|
-
|
|
83
|
+
acceptable_attribute_map.values
|
|
79
84
|
end
|
|
80
85
|
|
|
81
86
|
# Attribute type mapping.
|
|
@@ -106,9 +111,10 @@ module Bandwidth
|
|
|
106
111
|
end
|
|
107
112
|
|
|
108
113
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
114
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
109
115
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
110
|
-
if (!
|
|
111
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::StatusCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
116
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
117
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::StatusCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
112
118
|
end
|
|
113
119
|
h[k.to_sym] = v
|
|
114
120
|
}
|
|
@@ -196,6 +202,56 @@ module Bandwidth
|
|
|
196
202
|
true
|
|
197
203
|
end
|
|
198
204
|
|
|
205
|
+
# Custom attribute writer method with validation
|
|
206
|
+
# @param [Object] time Value to be assigned
|
|
207
|
+
def time=(time)
|
|
208
|
+
if time.nil?
|
|
209
|
+
fail ArgumentError, 'time cannot be nil'
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
@time = time
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Custom attribute writer method with validation
|
|
216
|
+
# @param [Object] type Value to be assigned
|
|
217
|
+
def type=(type)
|
|
218
|
+
if type.nil?
|
|
219
|
+
fail ArgumentError, 'type cannot be nil'
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
@type = type
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Custom attribute writer method with validation
|
|
226
|
+
# @param [Object] to Value to be assigned
|
|
227
|
+
def to=(to)
|
|
228
|
+
if to.nil?
|
|
229
|
+
fail ArgumentError, 'to cannot be nil'
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
@to = to
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Custom attribute writer method with validation
|
|
236
|
+
# @param [Object] description Value to be assigned
|
|
237
|
+
def description=(description)
|
|
238
|
+
if description.nil?
|
|
239
|
+
fail ArgumentError, 'description cannot be nil'
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
@description = description
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Custom attribute writer method with validation
|
|
246
|
+
# @param [Object] message Value to be assigned
|
|
247
|
+
def message=(message)
|
|
248
|
+
if message.nil?
|
|
249
|
+
fail ArgumentError, 'message cannot be nil'
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
@message = message
|
|
253
|
+
end
|
|
254
|
+
|
|
199
255
|
# Checks equality by comparing each attribute.
|
|
200
256
|
# @param [Object] Object to be compared
|
|
201
257
|
def ==(o)
|
|
@@ -246,61 +302,6 @@ module Bandwidth
|
|
|
246
302
|
new(transformed_hash)
|
|
247
303
|
end
|
|
248
304
|
|
|
249
|
-
# Deserializes the data based on type
|
|
250
|
-
# @param string type Data type
|
|
251
|
-
# @param string value Value to be deserialized
|
|
252
|
-
# @return [Object] Deserialized data
|
|
253
|
-
def self._deserialize(type, value)
|
|
254
|
-
case type.to_sym
|
|
255
|
-
when :Time
|
|
256
|
-
Time.parse(value)
|
|
257
|
-
when :Date
|
|
258
|
-
Date.parse(value)
|
|
259
|
-
when :String
|
|
260
|
-
value.to_s
|
|
261
|
-
when :Integer
|
|
262
|
-
value.to_i
|
|
263
|
-
when :Float
|
|
264
|
-
value.to_f
|
|
265
|
-
when :Boolean
|
|
266
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
267
|
-
true
|
|
268
|
-
else
|
|
269
|
-
false
|
|
270
|
-
end
|
|
271
|
-
when :Object
|
|
272
|
-
# generic object (usually a Hash), return directly
|
|
273
|
-
value
|
|
274
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
275
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
276
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
277
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
278
|
-
k_type = Regexp.last_match[:k_type]
|
|
279
|
-
v_type = Regexp.last_match[:v_type]
|
|
280
|
-
{}.tap do |hash|
|
|
281
|
-
value.each do |k, v|
|
|
282
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
283
|
-
end
|
|
284
|
-
end
|
|
285
|
-
else # model
|
|
286
|
-
# models (e.g. Pet) or oneOf
|
|
287
|
-
klass = Bandwidth.const_get(type)
|
|
288
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
289
|
-
end
|
|
290
|
-
end
|
|
291
|
-
|
|
292
|
-
# Returns the string representation of the object
|
|
293
|
-
# @return [String] String presentation of the object
|
|
294
|
-
def to_s
|
|
295
|
-
to_hash.to_s
|
|
296
|
-
end
|
|
297
|
-
|
|
298
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
299
|
-
# @return [Hash] Returns the object in the form of hash
|
|
300
|
-
def to_body
|
|
301
|
-
to_hash
|
|
302
|
-
end
|
|
303
|
-
|
|
304
305
|
# Returns the object in the form of hash
|
|
305
306
|
# @return [Hash] Returns the object in the form of hash
|
|
306
307
|
def to_hash
|
|
@@ -316,23 +317,5 @@ module Bandwidth
|
|
|
316
317
|
end
|
|
317
318
|
hash
|
|
318
319
|
end
|
|
319
|
-
|
|
320
|
-
# Outputs non-array value in the form of hash
|
|
321
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
322
|
-
# @param [Object] value Any valid value
|
|
323
|
-
# @return [Hash] Returns the value in the form of hash
|
|
324
|
-
def _to_hash(value)
|
|
325
|
-
if value.is_a?(Array)
|
|
326
|
-
value.compact.map { |v| _to_hash(v) }
|
|
327
|
-
elsif value.is_a?(Hash)
|
|
328
|
-
{}.tap do |hash|
|
|
329
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
330
|
-
end
|
|
331
|
-
elsif value.respond_to? :to_hash
|
|
332
|
-
value.to_hash
|
|
333
|
-
else
|
|
334
|
-
value
|
|
335
|
-
end
|
|
336
|
-
end
|
|
337
320
|
end
|
|
338
321
|
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
|
# Message payload schema within a callback
|
|
18
|
-
class StatusCallbackMessage
|
|
18
|
+
class StatusCallbackMessage < ApiModelBase
|
|
19
19
|
# A unique identifier of the message.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -91,9 +91,14 @@ module Bandwidth
|
|
|
91
91
|
}
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
+
# Returns attribute mapping this model knows about
|
|
95
|
+
def self.acceptable_attribute_map
|
|
96
|
+
attribute_map
|
|
97
|
+
end
|
|
98
|
+
|
|
94
99
|
# Returns all the JSON keys this model knows about
|
|
95
100
|
def self.acceptable_attributes
|
|
96
|
-
|
|
101
|
+
acceptable_attribute_map.values
|
|
97
102
|
end
|
|
98
103
|
|
|
99
104
|
# Attribute type mapping.
|
|
@@ -129,9 +134,10 @@ module Bandwidth
|
|
|
129
134
|
end
|
|
130
135
|
|
|
131
136
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
137
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
132
138
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
133
|
-
if (!
|
|
134
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::StatusCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " +
|
|
139
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
140
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::StatusCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
135
141
|
end
|
|
136
142
|
h[k.to_sym] = v
|
|
137
143
|
}
|
|
@@ -264,6 +270,66 @@ module Bandwidth
|
|
|
264
270
|
true
|
|
265
271
|
end
|
|
266
272
|
|
|
273
|
+
# Custom attribute writer method with validation
|
|
274
|
+
# @param [Object] id Value to be assigned
|
|
275
|
+
def id=(id)
|
|
276
|
+
if id.nil?
|
|
277
|
+
fail ArgumentError, 'id cannot be nil'
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
@id = id
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Custom attribute writer method with validation
|
|
284
|
+
# @param [Object] owner Value to be assigned
|
|
285
|
+
def owner=(owner)
|
|
286
|
+
if owner.nil?
|
|
287
|
+
fail ArgumentError, 'owner cannot be nil'
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
@owner = owner
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Custom attribute writer method with validation
|
|
294
|
+
# @param [Object] application_id Value to be assigned
|
|
295
|
+
def application_id=(application_id)
|
|
296
|
+
if application_id.nil?
|
|
297
|
+
fail ArgumentError, 'application_id cannot be nil'
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
@application_id = application_id
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Custom attribute writer method with validation
|
|
304
|
+
# @param [Object] time Value to be assigned
|
|
305
|
+
def time=(time)
|
|
306
|
+
if time.nil?
|
|
307
|
+
fail ArgumentError, 'time cannot be nil'
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
@time = time
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# Custom attribute writer method with validation
|
|
314
|
+
# @param [Object] segment_count Value to be assigned
|
|
315
|
+
def segment_count=(segment_count)
|
|
316
|
+
if segment_count.nil?
|
|
317
|
+
fail ArgumentError, 'segment_count cannot be nil'
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
@segment_count = segment_count
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# Custom attribute writer method with validation
|
|
324
|
+
# @param [Object] direction Value to be assigned
|
|
325
|
+
def direction=(direction)
|
|
326
|
+
if direction.nil?
|
|
327
|
+
fail ArgumentError, 'direction cannot be nil'
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
@direction = direction
|
|
331
|
+
end
|
|
332
|
+
|
|
267
333
|
# Custom attribute writer method with validation
|
|
268
334
|
# @param [Object] to Value to be assigned
|
|
269
335
|
def to=(to)
|
|
@@ -274,6 +340,16 @@ module Bandwidth
|
|
|
274
340
|
@to = to
|
|
275
341
|
end
|
|
276
342
|
|
|
343
|
+
# Custom attribute writer method with validation
|
|
344
|
+
# @param [Object] from Value to be assigned
|
|
345
|
+
def from=(from)
|
|
346
|
+
if from.nil?
|
|
347
|
+
fail ArgumentError, 'from cannot be nil'
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
@from = from
|
|
351
|
+
end
|
|
352
|
+
|
|
277
353
|
# Checks equality by comparing each attribute.
|
|
278
354
|
# @param [Object] Object to be compared
|
|
279
355
|
def ==(o)
|
|
@@ -329,61 +405,6 @@ module Bandwidth
|
|
|
329
405
|
new(transformed_hash)
|
|
330
406
|
end
|
|
331
407
|
|
|
332
|
-
# Deserializes the data based on type
|
|
333
|
-
# @param string type Data type
|
|
334
|
-
# @param string value Value to be deserialized
|
|
335
|
-
# @return [Object] Deserialized data
|
|
336
|
-
def self._deserialize(type, value)
|
|
337
|
-
case type.to_sym
|
|
338
|
-
when :Time
|
|
339
|
-
Time.parse(value)
|
|
340
|
-
when :Date
|
|
341
|
-
Date.parse(value)
|
|
342
|
-
when :String
|
|
343
|
-
value.to_s
|
|
344
|
-
when :Integer
|
|
345
|
-
value.to_i
|
|
346
|
-
when :Float
|
|
347
|
-
value.to_f
|
|
348
|
-
when :Boolean
|
|
349
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
350
|
-
true
|
|
351
|
-
else
|
|
352
|
-
false
|
|
353
|
-
end
|
|
354
|
-
when :Object
|
|
355
|
-
# generic object (usually a Hash), return directly
|
|
356
|
-
value
|
|
357
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
358
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
359
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
360
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
361
|
-
k_type = Regexp.last_match[:k_type]
|
|
362
|
-
v_type = Regexp.last_match[:v_type]
|
|
363
|
-
{}.tap do |hash|
|
|
364
|
-
value.each do |k, v|
|
|
365
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
366
|
-
end
|
|
367
|
-
end
|
|
368
|
-
else # model
|
|
369
|
-
# models (e.g. Pet) or oneOf
|
|
370
|
-
klass = Bandwidth.const_get(type)
|
|
371
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
372
|
-
end
|
|
373
|
-
end
|
|
374
|
-
|
|
375
|
-
# Returns the string representation of the object
|
|
376
|
-
# @return [String] String presentation of the object
|
|
377
|
-
def to_s
|
|
378
|
-
to_hash.to_s
|
|
379
|
-
end
|
|
380
|
-
|
|
381
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
382
|
-
# @return [Hash] Returns the object in the form of hash
|
|
383
|
-
def to_body
|
|
384
|
-
to_hash
|
|
385
|
-
end
|
|
386
|
-
|
|
387
408
|
# Returns the object in the form of hash
|
|
388
409
|
# @return [Hash] Returns the object in the form of hash
|
|
389
410
|
def to_hash
|
|
@@ -399,23 +420,5 @@ module Bandwidth
|
|
|
399
420
|
end
|
|
400
421
|
hash
|
|
401
422
|
end
|
|
402
|
-
|
|
403
|
-
# Outputs non-array value in the form of hash
|
|
404
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
405
|
-
# @param [Object] value Any valid value
|
|
406
|
-
# @return [Hash] Returns the value in the form of hash
|
|
407
|
-
def _to_hash(value)
|
|
408
|
-
if value.is_a?(Array)
|
|
409
|
-
value.compact.map { |v| _to_hash(v) }
|
|
410
|
-
elsif value.is_a?(Hash)
|
|
411
|
-
{}.tap do |hash|
|
|
412
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
413
|
-
end
|
|
414
|
-
elsif value.respond_to? :to_hash
|
|
415
|
-
value.to_hash
|
|
416
|
-
else
|
|
417
|
-
value
|
|
418
|
-
end
|
|
419
|
-
end
|
|
420
423
|
end
|
|
421
424
|
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,13 +15,13 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
17
|
class StatusCallbackTypeEnum
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
MESSAGE_SENDING = 'message-sending'.freeze
|
|
19
|
+
MESSAGE_DELIVERED = 'message-delivered'.freeze
|
|
20
|
+
MESSAGE_FAILED = 'message-failed'.freeze
|
|
21
|
+
MESSAGE_READ = 'message-read'.freeze
|
|
22
22
|
|
|
23
23
|
def self.all_vars
|
|
24
|
-
@all_vars ||= [
|
|
24
|
+
@all_vars ||= [MESSAGE_SENDING, MESSAGE_DELIVERED, MESSAGE_FAILED, MESSAGE_READ].freeze
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
# Builds the enum from string
|
|
@@ -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 StirShaken
|
|
17
|
+
class StirShaken < ApiModelBase
|
|
18
18
|
# (optional) The verification status indicating whether the verification was successful or not. Possible values are TN-Validation-Passed and TN-Validation-Failed.
|
|
19
19
|
attr_accessor :verstat
|
|
20
20
|
|
|
@@ -33,9 +33,14 @@ module Bandwidth
|
|
|
33
33
|
}
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
36
41
|
# Returns all the JSON keys this model knows about
|
|
37
42
|
def self.acceptable_attributes
|
|
38
|
-
|
|
43
|
+
acceptable_attribute_map.values
|
|
39
44
|
end
|
|
40
45
|
|
|
41
46
|
# Attribute type mapping.
|
|
@@ -61,9 +66,10 @@ module Bandwidth
|
|
|
61
66
|
end
|
|
62
67
|
|
|
63
68
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
70
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
-
if (!
|
|
66
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::StirShaken`. Please check the name to make sure it's valid. List of attributes: " +
|
|
71
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::StirShaken`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
73
|
end
|
|
68
74
|
h[k.to_sym] = v
|
|
69
75
|
}
|
|
@@ -141,61 +147,6 @@ module Bandwidth
|
|
|
141
147
|
new(transformed_hash)
|
|
142
148
|
end
|
|
143
149
|
|
|
144
|
-
# Deserializes the data based on type
|
|
145
|
-
# @param string type Data type
|
|
146
|
-
# @param string value Value to be deserialized
|
|
147
|
-
# @return [Object] Deserialized data
|
|
148
|
-
def self._deserialize(type, value)
|
|
149
|
-
case type.to_sym
|
|
150
|
-
when :Time
|
|
151
|
-
Time.parse(value)
|
|
152
|
-
when :Date
|
|
153
|
-
Date.parse(value)
|
|
154
|
-
when :String
|
|
155
|
-
value.to_s
|
|
156
|
-
when :Integer
|
|
157
|
-
value.to_i
|
|
158
|
-
when :Float
|
|
159
|
-
value.to_f
|
|
160
|
-
when :Boolean
|
|
161
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
162
|
-
true
|
|
163
|
-
else
|
|
164
|
-
false
|
|
165
|
-
end
|
|
166
|
-
when :Object
|
|
167
|
-
# generic object (usually a Hash), return directly
|
|
168
|
-
value
|
|
169
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
170
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
171
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
172
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
173
|
-
k_type = Regexp.last_match[:k_type]
|
|
174
|
-
v_type = Regexp.last_match[:v_type]
|
|
175
|
-
{}.tap do |hash|
|
|
176
|
-
value.each do |k, v|
|
|
177
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
178
|
-
end
|
|
179
|
-
end
|
|
180
|
-
else # model
|
|
181
|
-
# models (e.g. Pet) or oneOf
|
|
182
|
-
klass = Bandwidth.const_get(type)
|
|
183
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
# Returns the string representation of the object
|
|
188
|
-
# @return [String] String presentation of the object
|
|
189
|
-
def to_s
|
|
190
|
-
to_hash.to_s
|
|
191
|
-
end
|
|
192
|
-
|
|
193
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
194
|
-
# @return [Hash] Returns the object in the form of hash
|
|
195
|
-
def to_body
|
|
196
|
-
to_hash
|
|
197
|
-
end
|
|
198
|
-
|
|
199
150
|
# Returns the object in the form of hash
|
|
200
151
|
# @return [Hash] Returns the object in the form of hash
|
|
201
152
|
def to_hash
|
|
@@ -211,23 +162,5 @@ module Bandwidth
|
|
|
211
162
|
end
|
|
212
163
|
hash
|
|
213
164
|
end
|
|
214
|
-
|
|
215
|
-
# Outputs non-array value in the form of hash
|
|
216
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
217
|
-
# @param [Object] value Any valid value
|
|
218
|
-
# @return [Hash] Returns the value in the form of hash
|
|
219
|
-
def _to_hash(value)
|
|
220
|
-
if value.is_a?(Array)
|
|
221
|
-
value.compact.map { |v| _to_hash(v) }
|
|
222
|
-
elsif value.is_a?(Hash)
|
|
223
|
-
{}.tap do |hash|
|
|
224
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
225
|
-
end
|
|
226
|
-
elsif value.respond_to? :to_hash
|
|
227
|
-
value.to_hash
|
|
228
|
-
else
|
|
229
|
-
value
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
165
|
end
|
|
233
166
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
|
7
7
|
Contact: letstalk@bandwidth.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.17.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
|
-
class SyncLookupRequest
|
|
17
|
+
class SyncLookupRequest < ApiModelBase
|
|
18
18
|
# Telephone numbers in E.164 format.
|
|
19
19
|
attr_accessor :phone_numbers
|
|
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::SyncLookupRequest`. 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::SyncLookupRequest`. 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
|
}
|
|
@@ -140,61 +146,6 @@ module Bandwidth
|
|
|
140
146
|
new(transformed_hash)
|
|
141
147
|
end
|
|
142
148
|
|
|
143
|
-
# Deserializes the data based on type
|
|
144
|
-
# @param string type Data type
|
|
145
|
-
# @param string value Value to be deserialized
|
|
146
|
-
# @return [Object] Deserialized data
|
|
147
|
-
def self._deserialize(type, value)
|
|
148
|
-
case type.to_sym
|
|
149
|
-
when :Time
|
|
150
|
-
Time.parse(value)
|
|
151
|
-
when :Date
|
|
152
|
-
Date.parse(value)
|
|
153
|
-
when :String
|
|
154
|
-
value.to_s
|
|
155
|
-
when :Integer
|
|
156
|
-
value.to_i
|
|
157
|
-
when :Float
|
|
158
|
-
value.to_f
|
|
159
|
-
when :Boolean
|
|
160
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
161
|
-
true
|
|
162
|
-
else
|
|
163
|
-
false
|
|
164
|
-
end
|
|
165
|
-
when :Object
|
|
166
|
-
# generic object (usually a Hash), return directly
|
|
167
|
-
value
|
|
168
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
169
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
170
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
171
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
172
|
-
k_type = Regexp.last_match[:k_type]
|
|
173
|
-
v_type = Regexp.last_match[:v_type]
|
|
174
|
-
{}.tap do |hash|
|
|
175
|
-
value.each do |k, v|
|
|
176
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
177
|
-
end
|
|
178
|
-
end
|
|
179
|
-
else # model
|
|
180
|
-
# models (e.g. Pet) or oneOf
|
|
181
|
-
klass = Bandwidth.const_get(type)
|
|
182
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
183
|
-
end
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
# Returns the string representation of the object
|
|
187
|
-
# @return [String] String presentation of the object
|
|
188
|
-
def to_s
|
|
189
|
-
to_hash.to_s
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
193
|
-
# @return [Hash] Returns the object in the form of hash
|
|
194
|
-
def to_body
|
|
195
|
-
to_hash
|
|
196
|
-
end
|
|
197
|
-
|
|
198
149
|
# Returns the object in the form of hash
|
|
199
150
|
# @return [Hash] Returns the object in the form of hash
|
|
200
151
|
def to_hash
|
|
@@ -210,23 +161,5 @@ module Bandwidth
|
|
|
210
161
|
end
|
|
211
162
|
hash
|
|
212
163
|
end
|
|
213
|
-
|
|
214
|
-
# Outputs non-array value in the form of hash
|
|
215
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
216
|
-
# @param [Object] value Any valid value
|
|
217
|
-
# @return [Hash] Returns the value in the form of hash
|
|
218
|
-
def _to_hash(value)
|
|
219
|
-
if value.is_a?(Array)
|
|
220
|
-
value.compact.map { |v| _to_hash(v) }
|
|
221
|
-
elsif value.is_a?(Hash)
|
|
222
|
-
{}.tap do |hash|
|
|
223
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
224
|
-
end
|
|
225
|
-
elsif value.respond_to? :to_hash
|
|
226
|
-
value.to_hash
|
|
227
|
-
else
|
|
228
|
-
value
|
|
229
|
-
end
|
|
230
|
-
end
|
|
231
164
|
end
|
|
232
165
|
end
|