bandwidth-sdk 17.0.1 → 17.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +18 -0
- data/bandwidth-sdk.gemspec +1 -2
- data/bandwidth.yml +7 -0
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +198 -387
- data/coverage/index.html +5842 -7703
- data/custom_templates/README.mustache +4 -1
- data/custom_templates/api_client.mustache +254 -0
- data/custom_templates/configuration.mustache +545 -0
- data/custom_templates/gem.mustache +2 -0
- data/docs/CallsApi.md +20 -5
- data/docs/ConferencesApi.md +36 -9
- data/docs/MFAApi.md +12 -3
- data/docs/MediaApi.md +16 -4
- data/docs/MessagesApi.md +8 -2
- data/docs/MultiChannelApi.md +4 -1
- data/docs/PhoneNumberLookupApi.md +12 -3
- data/docs/RecordingsApi.md +40 -10
- data/docs/StatisticsApi.md +4 -1
- data/docs/TollFreeVerificationApi.md +36 -9
- data/docs/TranscriptionsApi.md +12 -3
- data/lib/bandwidth-sdk/api/calls_api.rb +6 -6
- data/lib/bandwidth-sdk/api/conferences_api.rb +10 -10
- data/lib/bandwidth-sdk/api/media_api.rb +5 -5
- data/lib/bandwidth-sdk/api/messages_api.rb +3 -3
- data/lib/bandwidth-sdk/api/mfa_api.rb +4 -4
- data/lib/bandwidth-sdk/api/multi_channel_api.rb +2 -2
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +4 -4
- data/lib/bandwidth-sdk/api/recordings_api.rb +11 -11
- data/lib/bandwidth-sdk/api/statistics_api.rb +2 -2
- data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +13 -13
- data/lib/bandwidth-sdk/api/transcriptions_api.rb +4 -4
- data/lib/bandwidth-sdk/api_client.rb +9 -5
- data/lib/bandwidth-sdk/api_error.rb +1 -1
- data/lib/bandwidth-sdk/api_model_base.rb +88 -0
- data/lib/bandwidth-sdk/configuration.rb +50 -1
- data/lib/bandwidth-sdk/models/account_statistics.rb +11 -78
- data/lib/bandwidth-sdk/models/additional_denial_reason.rb +41 -78
- data/lib/bandwidth-sdk/models/address.rb +23 -90
- data/lib/bandwidth-sdk/models/answer_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/async_lookup_request.rb +11 -78
- data/lib/bandwidth-sdk/models/blocked_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/business_entity_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/business_registration_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/call_state.rb +11 -78
- data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_transcription.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_response.rb +11 -78
- data/lib/bandwidth-sdk/models/call_transcription_track_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/callback.rb +1 -1
- data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/card_width_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/code_request.rb +11 -78
- data/lib/bandwidth-sdk/models/completed_lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/conference.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/contact.rb +19 -86
- data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/create_call.rb +41 -78
- data/lib/bandwidth-sdk/models/create_call_response.rb +81 -78
- data/lib/bandwidth-sdk/models/create_message_request_error.rb +31 -78
- data/lib/bandwidth-sdk/models/create_multi_channel_message_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_sync_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/create_sync_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/deactivation_event_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/diversion.rb +11 -78
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/error.rb +11 -78
- data/lib/bandwidth-sdk/models/error_object.rb +41 -78
- data/lib/bandwidth-sdk/models/error_source.rb +11 -78
- data/lib/bandwidth-sdk/models/failure_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/field_error.rb +11 -78
- data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/gather_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response.rb +11 -78
- data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response_data.rb +11 -78
- data/lib/bandwidth-sdk/models/in_progress_lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/inbound_callback.rb +61 -78
- data/lib/bandwidth-sdk/models/inbound_callback_message.rb +81 -78
- data/lib/bandwidth-sdk/models/inbound_callback_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/initiate_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/latest_message_delivery_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/line_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/link.rb +11 -78
- data/lib/bandwidth-sdk/models/link_schema.rb +11 -78
- data/lib/bandwidth-sdk/models/links_object.rb +11 -78
- data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/list_message_item.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_response.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_schema.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_error_schema_meta.rb +11 -78
- data/lib/bandwidth-sdk/models/lookup_result.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +11 -78
- data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_result.rb +11 -78
- data/lib/bandwidth-sdk/models/media.rb +11 -78
- data/lib/bandwidth-sdk/models/message.rb +11 -78
- data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_request.rb +31 -78
- data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/messages_list.rb +11 -78
- data/lib/bandwidth-sdk/models/messaging_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/messaging_request_error.rb +31 -78
- data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mfa_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +11 -78
- data/lib/bandwidth-sdk/models/mms_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/mms_message_content_file.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_action.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +41 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_mms_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_mms_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_base.rb +41 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_owner_object.rb +21 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object_all_of_content.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_request_object.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_response_object.rb +3 -4
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_object.rb +51 -78
- data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_response_object.rb +61 -78
- data/lib/bandwidth-sdk/models/multi_channel_error.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_channel_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/multi_channel_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_request.rb +21 -78
- data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +41 -78
- data/lib/bandwidth-sdk/models/opt_in_workflow.rb +25 -82
- data/lib/bandwidth-sdk/models/page_info.rb +11 -78
- data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/product_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_base.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_action_dial.rb +31 -78
- data/lib/bandwidth-sdk/models/rbm_action_open_url.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_action_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_view_location.rb +41 -78
- data/lib/bandwidth-sdk/models/rbm_card_content.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_card_content_media.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_location_response.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_media_height_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_message_carousel_card.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_message_content_file.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_message_content_rich_card.rb +3 -4
- data/lib/bandwidth-sdk/models/rbm_message_content_text.rb +11 -78
- data/lib/bandwidth-sdk/models/rbm_message_media.rb +21 -78
- data/lib/bandwidth-sdk/models/rbm_standalone_card.rb +41 -78
- data/lib/bandwidth-sdk/models/rbm_suggestion_response.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +11 -78
- data/lib/bandwidth-sdk/models/recording_transcriptions.rb +11 -78
- data/lib/bandwidth-sdk/models/redirect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/sms_message_content.rb +11 -78
- data/lib/bandwidth-sdk/models/standalone_card_orientation_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/status_callback.rb +61 -78
- data/lib/bandwidth-sdk/models/status_callback_message.rb +81 -78
- data/lib/bandwidth-sdk/models/status_callback_type_enum.rb +6 -6
- data/lib/bandwidth-sdk/models/stir_shaken.rb +11 -78
- data/lib/bandwidth-sdk/models/sync_lookup_request.rb +11 -78
- data/lib/bandwidth-sdk/models/telephone_number.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_basic_authentication.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_callback_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/tfv_error.rb +11 -78
- data/lib/bandwidth-sdk/models/tfv_status.rb +13 -80
- data/lib/bandwidth-sdk/models/tfv_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/tfv_submission_info.rb +21 -88
- data/lib/bandwidth-sdk/models/tfv_submission_wrapper.rb +11 -78
- data/lib/bandwidth-sdk/models/thumbnail_alignment_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/transcribe_recording.rb +11 -78
- data/lib/bandwidth-sdk/models/transcription.rb +11 -78
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +11 -78
- data/lib/bandwidth-sdk/models/update_call.rb +11 -78
- data/lib/bandwidth-sdk/models/update_call_recording.rb +21 -78
- data/lib/bandwidth-sdk/models/update_conference.rb +11 -78
- data/lib/bandwidth-sdk/models/update_conference_member.rb +11 -78
- data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/verification_request.rb +51 -88
- data/lib/bandwidth-sdk/models/verification_update_request.rb +51 -88
- data/lib/bandwidth-sdk/models/verification_webhook.rb +13 -80
- data/lib/bandwidth-sdk/models/verify_code_request.rb +13 -80
- data/lib/bandwidth-sdk/models/verify_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/voice_api_error.rb +11 -78
- data/lib/bandwidth-sdk/models/voice_code_response.rb +11 -78
- data/lib/bandwidth-sdk/models/webhook_subscription.rb +13 -80
- data/lib/bandwidth-sdk/models/webhook_subscription_basic_authentication.rb +11 -78
- data/lib/bandwidth-sdk/models/webhook_subscription_request_schema.rb +15 -82
- data/lib/bandwidth-sdk/models/webhook_subscription_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +21 -78
- data/lib/bandwidth-sdk/version.rb +2 -2
- data/lib/bandwidth-sdk.rb +2 -1
- data/openapitools.json +1 -1
- data/spec/smoke/calls_api_spec.rb +50 -76
- data/spec/smoke/conferences_api_spec.rb +7 -5
- data/spec/smoke/media_api_spec.rb +4 -2
- data/spec/smoke/messages_api_spec.rb +9 -4
- data/spec/smoke/mfa_api_spec.rb +9 -4
- data/spec/smoke/multi_channel_api_spec.rb +4 -2
- data/spec/smoke/phone_number_lookup_api_spec.rb +6 -4
- data/spec/smoke/recordings_api_spec.rb +7 -33
- data/spec/smoke/statistics_api_spec.rb +16 -8
- data/spec/smoke/toll_free_verification_api_spec.rb +6 -4
- data/spec/smoke/transcriptions_api_spec.rb +7 -5
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/models/verify_code_request_spec.rb +1 -1
- metadata +5 -2
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
|
7
7
|
Contact: letstalk@bandwidth.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.17.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
|
-
class VerifyCodeRequest
|
|
17
|
+
class VerifyCodeRequest < ApiModelBase
|
|
18
18
|
# The phone number to send the mfa code to.
|
|
19
19
|
attr_accessor :to
|
|
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::VerifyCodeRequest`. 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::VerifyCodeRequest`. 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
|
}
|
|
@@ -131,7 +137,7 @@ module Bandwidth
|
|
|
131
137
|
end
|
|
132
138
|
|
|
133
139
|
if @code.to_s.length < 4
|
|
134
|
-
invalid_properties.push('invalid value for "code", the character length must be
|
|
140
|
+
invalid_properties.push('invalid value for "code", the character length must be greater than or equal to 4.')
|
|
135
141
|
end
|
|
136
142
|
|
|
137
143
|
invalid_properties
|
|
@@ -197,7 +203,7 @@ module Bandwidth
|
|
|
197
203
|
end
|
|
198
204
|
|
|
199
205
|
if code.to_s.length < 4
|
|
200
|
-
fail ArgumentError, 'invalid value for "code", the character length must be
|
|
206
|
+
fail ArgumentError, 'invalid value for "code", the character length must be greater than or equal to 4.'
|
|
201
207
|
end
|
|
202
208
|
|
|
203
209
|
@code = code
|
|
@@ -249,61 +255,6 @@ module Bandwidth
|
|
|
249
255
|
new(transformed_hash)
|
|
250
256
|
end
|
|
251
257
|
|
|
252
|
-
# Deserializes the data based on type
|
|
253
|
-
# @param string type Data type
|
|
254
|
-
# @param string value Value to be deserialized
|
|
255
|
-
# @return [Object] Deserialized data
|
|
256
|
-
def self._deserialize(type, value)
|
|
257
|
-
case type.to_sym
|
|
258
|
-
when :Time
|
|
259
|
-
Time.parse(value)
|
|
260
|
-
when :Date
|
|
261
|
-
Date.parse(value)
|
|
262
|
-
when :String
|
|
263
|
-
value.to_s
|
|
264
|
-
when :Integer
|
|
265
|
-
value.to_i
|
|
266
|
-
when :Float
|
|
267
|
-
value.to_f
|
|
268
|
-
when :Boolean
|
|
269
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
270
|
-
true
|
|
271
|
-
else
|
|
272
|
-
false
|
|
273
|
-
end
|
|
274
|
-
when :Object
|
|
275
|
-
# generic object (usually a Hash), return directly
|
|
276
|
-
value
|
|
277
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
278
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
279
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
280
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
281
|
-
k_type = Regexp.last_match[:k_type]
|
|
282
|
-
v_type = Regexp.last_match[:v_type]
|
|
283
|
-
{}.tap do |hash|
|
|
284
|
-
value.each do |k, v|
|
|
285
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
286
|
-
end
|
|
287
|
-
end
|
|
288
|
-
else # model
|
|
289
|
-
# models (e.g. Pet) or oneOf
|
|
290
|
-
klass = Bandwidth.const_get(type)
|
|
291
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
292
|
-
end
|
|
293
|
-
end
|
|
294
|
-
|
|
295
|
-
# Returns the string representation of the object
|
|
296
|
-
# @return [String] String presentation of the object
|
|
297
|
-
def to_s
|
|
298
|
-
to_hash.to_s
|
|
299
|
-
end
|
|
300
|
-
|
|
301
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
302
|
-
# @return [Hash] Returns the object in the form of hash
|
|
303
|
-
def to_body
|
|
304
|
-
to_hash
|
|
305
|
-
end
|
|
306
|
-
|
|
307
258
|
# Returns the object in the form of hash
|
|
308
259
|
# @return [Hash] Returns the object in the form of hash
|
|
309
260
|
def to_hash
|
|
@@ -319,23 +270,5 @@ module Bandwidth
|
|
|
319
270
|
end
|
|
320
271
|
hash
|
|
321
272
|
end
|
|
322
|
-
|
|
323
|
-
# Outputs non-array value in the form of hash
|
|
324
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
325
|
-
# @param [Object] value Any valid value
|
|
326
|
-
# @return [Hash] Returns the value in the form of hash
|
|
327
|
-
def _to_hash(value)
|
|
328
|
-
if value.is_a?(Array)
|
|
329
|
-
value.compact.map { |v| _to_hash(v) }
|
|
330
|
-
elsif value.is_a?(Hash)
|
|
331
|
-
{}.tap do |hash|
|
|
332
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
333
|
-
end
|
|
334
|
-
elsif value.respond_to? :to_hash
|
|
335
|
-
value.to_hash
|
|
336
|
-
else
|
|
337
|
-
value
|
|
338
|
-
end
|
|
339
|
-
end
|
|
340
273
|
end
|
|
341
274
|
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 VerifyCodeResponse
|
|
17
|
+
class VerifyCodeResponse < ApiModelBase
|
|
18
18
|
# Whether or not the supplied code is valid.
|
|
19
19
|
attr_accessor :valid
|
|
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::VerifyCodeResponse`. 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::VerifyCodeResponse`. 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
|
}
|
|
@@ -121,61 +127,6 @@ module Bandwidth
|
|
|
121
127
|
new(transformed_hash)
|
|
122
128
|
end
|
|
123
129
|
|
|
124
|
-
# Deserializes the data based on type
|
|
125
|
-
# @param string type Data type
|
|
126
|
-
# @param string value Value to be deserialized
|
|
127
|
-
# @return [Object] Deserialized data
|
|
128
|
-
def self._deserialize(type, value)
|
|
129
|
-
case type.to_sym
|
|
130
|
-
when :Time
|
|
131
|
-
Time.parse(value)
|
|
132
|
-
when :Date
|
|
133
|
-
Date.parse(value)
|
|
134
|
-
when :String
|
|
135
|
-
value.to_s
|
|
136
|
-
when :Integer
|
|
137
|
-
value.to_i
|
|
138
|
-
when :Float
|
|
139
|
-
value.to_f
|
|
140
|
-
when :Boolean
|
|
141
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
142
|
-
true
|
|
143
|
-
else
|
|
144
|
-
false
|
|
145
|
-
end
|
|
146
|
-
when :Object
|
|
147
|
-
# generic object (usually a Hash), return directly
|
|
148
|
-
value
|
|
149
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
150
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
151
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
152
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
153
|
-
k_type = Regexp.last_match[:k_type]
|
|
154
|
-
v_type = Regexp.last_match[:v_type]
|
|
155
|
-
{}.tap do |hash|
|
|
156
|
-
value.each do |k, v|
|
|
157
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
158
|
-
end
|
|
159
|
-
end
|
|
160
|
-
else # model
|
|
161
|
-
# models (e.g. Pet) or oneOf
|
|
162
|
-
klass = Bandwidth.const_get(type)
|
|
163
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
# Returns the string representation of the object
|
|
168
|
-
# @return [String] String presentation of the object
|
|
169
|
-
def to_s
|
|
170
|
-
to_hash.to_s
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
174
|
-
# @return [Hash] Returns the object in the form of hash
|
|
175
|
-
def to_body
|
|
176
|
-
to_hash
|
|
177
|
-
end
|
|
178
|
-
|
|
179
130
|
# Returns the object in the form of hash
|
|
180
131
|
# @return [Hash] Returns the object in the form of hash
|
|
181
132
|
def to_hash
|
|
@@ -191,23 +142,5 @@ module Bandwidth
|
|
|
191
142
|
end
|
|
192
143
|
hash
|
|
193
144
|
end
|
|
194
|
-
|
|
195
|
-
# Outputs non-array value in the form of hash
|
|
196
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
197
|
-
# @param [Object] value Any valid value
|
|
198
|
-
# @return [Hash] Returns the value in the form of hash
|
|
199
|
-
def _to_hash(value)
|
|
200
|
-
if value.is_a?(Array)
|
|
201
|
-
value.compact.map { |v| _to_hash(v) }
|
|
202
|
-
elsif value.is_a?(Hash)
|
|
203
|
-
{}.tap do |hash|
|
|
204
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
205
|
-
end
|
|
206
|
-
elsif value.respond_to? :to_hash
|
|
207
|
-
value.to_hash
|
|
208
|
-
else
|
|
209
|
-
value
|
|
210
|
-
end
|
|
211
|
-
end
|
|
212
145
|
end
|
|
213
146
|
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 VoiceApiError
|
|
17
|
+
class VoiceApiError < ApiModelBase
|
|
18
18
|
attr_accessor :type
|
|
19
19
|
|
|
20
20
|
attr_accessor :description
|
|
@@ -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::VoiceApiError`. 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::VoiceApiError`. 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
|
}
|
|
@@ -139,61 +145,6 @@ module Bandwidth
|
|
|
139
145
|
new(transformed_hash)
|
|
140
146
|
end
|
|
141
147
|
|
|
142
|
-
# Deserializes the data based on type
|
|
143
|
-
# @param string type Data type
|
|
144
|
-
# @param string value Value to be deserialized
|
|
145
|
-
# @return [Object] Deserialized data
|
|
146
|
-
def self._deserialize(type, value)
|
|
147
|
-
case type.to_sym
|
|
148
|
-
when :Time
|
|
149
|
-
Time.parse(value)
|
|
150
|
-
when :Date
|
|
151
|
-
Date.parse(value)
|
|
152
|
-
when :String
|
|
153
|
-
value.to_s
|
|
154
|
-
when :Integer
|
|
155
|
-
value.to_i
|
|
156
|
-
when :Float
|
|
157
|
-
value.to_f
|
|
158
|
-
when :Boolean
|
|
159
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
160
|
-
true
|
|
161
|
-
else
|
|
162
|
-
false
|
|
163
|
-
end
|
|
164
|
-
when :Object
|
|
165
|
-
# generic object (usually a Hash), return directly
|
|
166
|
-
value
|
|
167
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
168
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
169
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
170
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
171
|
-
k_type = Regexp.last_match[:k_type]
|
|
172
|
-
v_type = Regexp.last_match[:v_type]
|
|
173
|
-
{}.tap do |hash|
|
|
174
|
-
value.each do |k, v|
|
|
175
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
176
|
-
end
|
|
177
|
-
end
|
|
178
|
-
else # model
|
|
179
|
-
# models (e.g. Pet) or oneOf
|
|
180
|
-
klass = Bandwidth.const_get(type)
|
|
181
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
182
|
-
end
|
|
183
|
-
end
|
|
184
|
-
|
|
185
|
-
# Returns the string representation of the object
|
|
186
|
-
# @return [String] String presentation of the object
|
|
187
|
-
def to_s
|
|
188
|
-
to_hash.to_s
|
|
189
|
-
end
|
|
190
|
-
|
|
191
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
192
|
-
# @return [Hash] Returns the object in the form of hash
|
|
193
|
-
def to_body
|
|
194
|
-
to_hash
|
|
195
|
-
end
|
|
196
|
-
|
|
197
148
|
# Returns the object in the form of hash
|
|
198
149
|
# @return [Hash] Returns the object in the form of hash
|
|
199
150
|
def to_hash
|
|
@@ -209,23 +160,5 @@ module Bandwidth
|
|
|
209
160
|
end
|
|
210
161
|
hash
|
|
211
162
|
end
|
|
212
|
-
|
|
213
|
-
# Outputs non-array value in the form of hash
|
|
214
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
215
|
-
# @param [Object] value Any valid value
|
|
216
|
-
# @return [Hash] Returns the value in the form of hash
|
|
217
|
-
def _to_hash(value)
|
|
218
|
-
if value.is_a?(Array)
|
|
219
|
-
value.compact.map { |v| _to_hash(v) }
|
|
220
|
-
elsif value.is_a?(Hash)
|
|
221
|
-
{}.tap do |hash|
|
|
222
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
223
|
-
end
|
|
224
|
-
elsif value.respond_to? :to_hash
|
|
225
|
-
value.to_hash
|
|
226
|
-
else
|
|
227
|
-
value
|
|
228
|
-
end
|
|
229
|
-
end
|
|
230
163
|
end
|
|
231
164
|
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 VoiceCodeResponse
|
|
17
|
+
class VoiceCodeResponse < ApiModelBase
|
|
18
18
|
# Programmable Voice API Call ID.
|
|
19
19
|
attr_accessor :call_id
|
|
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::VoiceCodeResponse`. 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::VoiceCodeResponse`. 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
|
}
|
|
@@ -121,61 +127,6 @@ module Bandwidth
|
|
|
121
127
|
new(transformed_hash)
|
|
122
128
|
end
|
|
123
129
|
|
|
124
|
-
# Deserializes the data based on type
|
|
125
|
-
# @param string type Data type
|
|
126
|
-
# @param string value Value to be deserialized
|
|
127
|
-
# @return [Object] Deserialized data
|
|
128
|
-
def self._deserialize(type, value)
|
|
129
|
-
case type.to_sym
|
|
130
|
-
when :Time
|
|
131
|
-
Time.parse(value)
|
|
132
|
-
when :Date
|
|
133
|
-
Date.parse(value)
|
|
134
|
-
when :String
|
|
135
|
-
value.to_s
|
|
136
|
-
when :Integer
|
|
137
|
-
value.to_i
|
|
138
|
-
when :Float
|
|
139
|
-
value.to_f
|
|
140
|
-
when :Boolean
|
|
141
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
142
|
-
true
|
|
143
|
-
else
|
|
144
|
-
false
|
|
145
|
-
end
|
|
146
|
-
when :Object
|
|
147
|
-
# generic object (usually a Hash), return directly
|
|
148
|
-
value
|
|
149
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
150
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
151
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
152
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
153
|
-
k_type = Regexp.last_match[:k_type]
|
|
154
|
-
v_type = Regexp.last_match[:v_type]
|
|
155
|
-
{}.tap do |hash|
|
|
156
|
-
value.each do |k, v|
|
|
157
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
158
|
-
end
|
|
159
|
-
end
|
|
160
|
-
else # model
|
|
161
|
-
# models (e.g. Pet) or oneOf
|
|
162
|
-
klass = Bandwidth.const_get(type)
|
|
163
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
# Returns the string representation of the object
|
|
168
|
-
# @return [String] String presentation of the object
|
|
169
|
-
def to_s
|
|
170
|
-
to_hash.to_s
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
174
|
-
# @return [Hash] Returns the object in the form of hash
|
|
175
|
-
def to_body
|
|
176
|
-
to_hash
|
|
177
|
-
end
|
|
178
|
-
|
|
179
130
|
# Returns the object in the form of hash
|
|
180
131
|
# @return [Hash] Returns the object in the form of hash
|
|
181
132
|
def to_hash
|
|
@@ -191,23 +142,5 @@ module Bandwidth
|
|
|
191
142
|
end
|
|
192
143
|
hash
|
|
193
144
|
end
|
|
194
|
-
|
|
195
|
-
# Outputs non-array value in the form of hash
|
|
196
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
197
|
-
# @param [Object] value Any valid value
|
|
198
|
-
# @return [Hash] Returns the value in the form of hash
|
|
199
|
-
def _to_hash(value)
|
|
200
|
-
if value.is_a?(Array)
|
|
201
|
-
value.compact.map { |v| _to_hash(v) }
|
|
202
|
-
elsif value.is_a?(Hash)
|
|
203
|
-
{}.tap do |hash|
|
|
204
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
205
|
-
end
|
|
206
|
-
elsif value.respond_to? :to_hash
|
|
207
|
-
value.to_hash
|
|
208
|
-
else
|
|
209
|
-
value
|
|
210
|
-
end
|
|
211
|
-
end
|
|
212
145
|
end
|
|
213
146
|
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
|
# Information about a webhook that Bandwidth should send upon the completion of event customer has subscribed to.
|
|
18
|
-
class WebhookSubscription
|
|
18
|
+
class WebhookSubscription < ApiModelBase
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
21
21
|
attr_accessor :account_id
|
|
@@ -66,9 +66,14 @@ module Bandwidth
|
|
|
66
66
|
}
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
+
# Returns attribute mapping this model knows about
|
|
70
|
+
def self.acceptable_attribute_map
|
|
71
|
+
attribute_map
|
|
72
|
+
end
|
|
73
|
+
|
|
69
74
|
# Returns all the JSON keys this model knows about
|
|
70
75
|
def self.acceptable_attributes
|
|
71
|
-
|
|
76
|
+
acceptable_attribute_map.values
|
|
72
77
|
end
|
|
73
78
|
|
|
74
79
|
# Attribute type mapping.
|
|
@@ -99,9 +104,10 @@ module Bandwidth
|
|
|
99
104
|
end
|
|
100
105
|
|
|
101
106
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
107
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
102
108
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
103
|
-
if (!
|
|
104
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::WebhookSubscription`. Please check the name to make sure it's valid. List of attributes: " +
|
|
109
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
110
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::WebhookSubscription`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
105
111
|
end
|
|
106
112
|
h[k.to_sym] = v
|
|
107
113
|
}
|
|
@@ -147,7 +153,7 @@ module Bandwidth
|
|
|
147
153
|
end
|
|
148
154
|
|
|
149
155
|
if @callback_url.to_s.length < 0
|
|
150
|
-
invalid_properties.push('invalid value for "callback_url", the character length must be
|
|
156
|
+
invalid_properties.push('invalid value for "callback_url", the character length must be greater than or equal to 0.')
|
|
151
157
|
end
|
|
152
158
|
|
|
153
159
|
pattern = Regexp.new(/^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&\/\/=]*)/)
|
|
@@ -176,7 +182,7 @@ module Bandwidth
|
|
|
176
182
|
end
|
|
177
183
|
|
|
178
184
|
if !callback_url.nil? && callback_url.to_s.length < 0
|
|
179
|
-
fail ArgumentError, 'invalid value for "callback_url", the character length must be
|
|
185
|
+
fail ArgumentError, 'invalid value for "callback_url", the character length must be greater than or equal to 0.'
|
|
180
186
|
end
|
|
181
187
|
|
|
182
188
|
pattern = Regexp.new(/^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&\/\/=]*)/)
|
|
@@ -236,61 +242,6 @@ module Bandwidth
|
|
|
236
242
|
new(transformed_hash)
|
|
237
243
|
end
|
|
238
244
|
|
|
239
|
-
# Deserializes the data based on type
|
|
240
|
-
# @param string type Data type
|
|
241
|
-
# @param string value Value to be deserialized
|
|
242
|
-
# @return [Object] Deserialized data
|
|
243
|
-
def self._deserialize(type, value)
|
|
244
|
-
case type.to_sym
|
|
245
|
-
when :Time
|
|
246
|
-
Time.parse(value)
|
|
247
|
-
when :Date
|
|
248
|
-
Date.parse(value)
|
|
249
|
-
when :String
|
|
250
|
-
value.to_s
|
|
251
|
-
when :Integer
|
|
252
|
-
value.to_i
|
|
253
|
-
when :Float
|
|
254
|
-
value.to_f
|
|
255
|
-
when :Boolean
|
|
256
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
257
|
-
true
|
|
258
|
-
else
|
|
259
|
-
false
|
|
260
|
-
end
|
|
261
|
-
when :Object
|
|
262
|
-
# generic object (usually a Hash), return directly
|
|
263
|
-
value
|
|
264
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
265
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
266
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
267
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
268
|
-
k_type = Regexp.last_match[:k_type]
|
|
269
|
-
v_type = Regexp.last_match[:v_type]
|
|
270
|
-
{}.tap do |hash|
|
|
271
|
-
value.each do |k, v|
|
|
272
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
273
|
-
end
|
|
274
|
-
end
|
|
275
|
-
else # model
|
|
276
|
-
# models (e.g. Pet) or oneOf
|
|
277
|
-
klass = Bandwidth.const_get(type)
|
|
278
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
279
|
-
end
|
|
280
|
-
end
|
|
281
|
-
|
|
282
|
-
# Returns the string representation of the object
|
|
283
|
-
# @return [String] String presentation of the object
|
|
284
|
-
def to_s
|
|
285
|
-
to_hash.to_s
|
|
286
|
-
end
|
|
287
|
-
|
|
288
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
289
|
-
# @return [Hash] Returns the object in the form of hash
|
|
290
|
-
def to_body
|
|
291
|
-
to_hash
|
|
292
|
-
end
|
|
293
|
-
|
|
294
245
|
# Returns the object in the form of hash
|
|
295
246
|
# @return [Hash] Returns the object in the form of hash
|
|
296
247
|
def to_hash
|
|
@@ -306,23 +257,5 @@ module Bandwidth
|
|
|
306
257
|
end
|
|
307
258
|
hash
|
|
308
259
|
end
|
|
309
|
-
|
|
310
|
-
# Outputs non-array value in the form of hash
|
|
311
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
312
|
-
# @param [Object] value Any valid value
|
|
313
|
-
# @return [Hash] Returns the value in the form of hash
|
|
314
|
-
def _to_hash(value)
|
|
315
|
-
if value.is_a?(Array)
|
|
316
|
-
value.compact.map { |v| _to_hash(v) }
|
|
317
|
-
elsif value.is_a?(Hash)
|
|
318
|
-
{}.tap do |hash|
|
|
319
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
320
|
-
end
|
|
321
|
-
elsif value.respond_to? :to_hash
|
|
322
|
-
value.to_hash
|
|
323
|
-
else
|
|
324
|
-
value
|
|
325
|
-
end
|
|
326
|
-
end
|
|
327
260
|
end
|
|
328
261
|
end
|