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 CreateMessageRequestError
|
|
17
|
+
class CreateMessageRequestError < 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.
|
|
@@ -58,9 +63,10 @@ module Bandwidth
|
|
|
58
63
|
end
|
|
59
64
|
|
|
60
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
61
67
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
62
|
-
if (!
|
|
63
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateMessageRequestError`. Please check the name to make sure it's valid. List of attributes: " +
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateMessageRequestError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
64
70
|
end
|
|
65
71
|
h[k.to_sym] = v
|
|
66
72
|
}
|
|
@@ -109,6 +115,26 @@ module Bandwidth
|
|
|
109
115
|
true
|
|
110
116
|
end
|
|
111
117
|
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] type Value to be assigned
|
|
120
|
+
def type=(type)
|
|
121
|
+
if type.nil?
|
|
122
|
+
fail ArgumentError, 'type cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
@type = type
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Custom attribute writer method with validation
|
|
129
|
+
# @param [Object] description Value to be assigned
|
|
130
|
+
def description=(description)
|
|
131
|
+
if description.nil?
|
|
132
|
+
fail ArgumentError, 'description cannot be nil'
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
@description = description
|
|
136
|
+
end
|
|
137
|
+
|
|
112
138
|
# Checks equality by comparing each attribute.
|
|
113
139
|
# @param [Object] Object to be compared
|
|
114
140
|
def ==(o)
|
|
@@ -154,61 +180,6 @@ module Bandwidth
|
|
|
154
180
|
new(transformed_hash)
|
|
155
181
|
end
|
|
156
182
|
|
|
157
|
-
# Deserializes the data based on type
|
|
158
|
-
# @param string type Data type
|
|
159
|
-
# @param string value Value to be deserialized
|
|
160
|
-
# @return [Object] Deserialized data
|
|
161
|
-
def self._deserialize(type, value)
|
|
162
|
-
case type.to_sym
|
|
163
|
-
when :Time
|
|
164
|
-
Time.parse(value)
|
|
165
|
-
when :Date
|
|
166
|
-
Date.parse(value)
|
|
167
|
-
when :String
|
|
168
|
-
value.to_s
|
|
169
|
-
when :Integer
|
|
170
|
-
value.to_i
|
|
171
|
-
when :Float
|
|
172
|
-
value.to_f
|
|
173
|
-
when :Boolean
|
|
174
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
175
|
-
true
|
|
176
|
-
else
|
|
177
|
-
false
|
|
178
|
-
end
|
|
179
|
-
when :Object
|
|
180
|
-
# generic object (usually a Hash), return directly
|
|
181
|
-
value
|
|
182
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
183
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
184
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
185
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
186
|
-
k_type = Regexp.last_match[:k_type]
|
|
187
|
-
v_type = Regexp.last_match[:v_type]
|
|
188
|
-
{}.tap do |hash|
|
|
189
|
-
value.each do |k, v|
|
|
190
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
191
|
-
end
|
|
192
|
-
end
|
|
193
|
-
else # model
|
|
194
|
-
# models (e.g. Pet) or oneOf
|
|
195
|
-
klass = Bandwidth.const_get(type)
|
|
196
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
197
|
-
end
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
# Returns the string representation of the object
|
|
201
|
-
# @return [String] String presentation of the object
|
|
202
|
-
def to_s
|
|
203
|
-
to_hash.to_s
|
|
204
|
-
end
|
|
205
|
-
|
|
206
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
207
|
-
# @return [Hash] Returns the object in the form of hash
|
|
208
|
-
def to_body
|
|
209
|
-
to_hash
|
|
210
|
-
end
|
|
211
|
-
|
|
212
183
|
# Returns the object in the form of hash
|
|
213
184
|
# @return [Hash] Returns the object in the form of hash
|
|
214
185
|
def to_hash
|
|
@@ -224,23 +195,5 @@ module Bandwidth
|
|
|
224
195
|
end
|
|
225
196
|
hash
|
|
226
197
|
end
|
|
227
|
-
|
|
228
|
-
# Outputs non-array value in the form of hash
|
|
229
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
230
|
-
# @param [Object] value Any valid value
|
|
231
|
-
# @return [Hash] Returns the value in the form of hash
|
|
232
|
-
def _to_hash(value)
|
|
233
|
-
if value.is_a?(Array)
|
|
234
|
-
value.compact.map { |v| _to_hash(v) }
|
|
235
|
-
elsif value.is_a?(Hash)
|
|
236
|
-
{}.tap do |hash|
|
|
237
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
238
|
-
end
|
|
239
|
-
elsif value.respond_to? :to_hash
|
|
240
|
-
value.to_hash
|
|
241
|
-
else
|
|
242
|
-
value
|
|
243
|
-
end
|
|
244
|
-
end
|
|
245
198
|
end
|
|
246
199
|
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 CreateMultiChannelMessageResponse
|
|
17
|
+
class CreateMultiChannelMessageResponse < ApiModelBase
|
|
18
18
|
attr_accessor :links
|
|
19
19
|
|
|
20
20
|
attr_accessor :data
|
|
@@ -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.
|
|
@@ -58,9 +63,10 @@ module Bandwidth
|
|
|
58
63
|
end
|
|
59
64
|
|
|
60
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
61
67
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
62
|
-
if (!
|
|
63
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateMultiChannelMessageResponse`. Please check the name to make sure it's valid. List of attributes: " +
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateMultiChannelMessageResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
64
70
|
end
|
|
65
71
|
h[k.to_sym] = v
|
|
66
72
|
}
|
|
@@ -142,61 +148,6 @@ module Bandwidth
|
|
|
142
148
|
new(transformed_hash)
|
|
143
149
|
end
|
|
144
150
|
|
|
145
|
-
# Deserializes the data based on type
|
|
146
|
-
# @param string type Data type
|
|
147
|
-
# @param string value Value to be deserialized
|
|
148
|
-
# @return [Object] Deserialized data
|
|
149
|
-
def self._deserialize(type, value)
|
|
150
|
-
case type.to_sym
|
|
151
|
-
when :Time
|
|
152
|
-
Time.parse(value)
|
|
153
|
-
when :Date
|
|
154
|
-
Date.parse(value)
|
|
155
|
-
when :String
|
|
156
|
-
value.to_s
|
|
157
|
-
when :Integer
|
|
158
|
-
value.to_i
|
|
159
|
-
when :Float
|
|
160
|
-
value.to_f
|
|
161
|
-
when :Boolean
|
|
162
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
163
|
-
true
|
|
164
|
-
else
|
|
165
|
-
false
|
|
166
|
-
end
|
|
167
|
-
when :Object
|
|
168
|
-
# generic object (usually a Hash), return directly
|
|
169
|
-
value
|
|
170
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
171
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
172
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
173
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
174
|
-
k_type = Regexp.last_match[:k_type]
|
|
175
|
-
v_type = Regexp.last_match[:v_type]
|
|
176
|
-
{}.tap do |hash|
|
|
177
|
-
value.each do |k, v|
|
|
178
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
179
|
-
end
|
|
180
|
-
end
|
|
181
|
-
else # model
|
|
182
|
-
# models (e.g. Pet) or oneOf
|
|
183
|
-
klass = Bandwidth.const_get(type)
|
|
184
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
# Returns the string representation of the object
|
|
189
|
-
# @return [String] String presentation of the object
|
|
190
|
-
def to_s
|
|
191
|
-
to_hash.to_s
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
195
|
-
# @return [Hash] Returns the object in the form of hash
|
|
196
|
-
def to_body
|
|
197
|
-
to_hash
|
|
198
|
-
end
|
|
199
|
-
|
|
200
151
|
# Returns the object in the form of hash
|
|
201
152
|
# @return [Hash] Returns the object in the form of hash
|
|
202
153
|
def to_hash
|
|
@@ -212,23 +163,5 @@ module Bandwidth
|
|
|
212
163
|
end
|
|
213
164
|
hash
|
|
214
165
|
end
|
|
215
|
-
|
|
216
|
-
# Outputs non-array value in the form of hash
|
|
217
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
218
|
-
# @param [Object] value Any valid value
|
|
219
|
-
# @return [Hash] Returns the value in the form of hash
|
|
220
|
-
def _to_hash(value)
|
|
221
|
-
if value.is_a?(Array)
|
|
222
|
-
value.compact.map { |v| _to_hash(v) }
|
|
223
|
-
elsif value.is_a?(Hash)
|
|
224
|
-
{}.tap do |hash|
|
|
225
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
226
|
-
end
|
|
227
|
-
elsif value.respond_to? :to_hash
|
|
228
|
-
value.to_hash
|
|
229
|
-
else
|
|
230
|
-
value
|
|
231
|
-
end
|
|
232
|
-
end
|
|
233
166
|
end
|
|
234
167
|
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 CreateSyncLookupResponse
|
|
17
|
+
class CreateSyncLookupResponse < ApiModelBase
|
|
18
18
|
attr_accessor :links
|
|
19
19
|
|
|
20
20
|
attr_accessor :data
|
|
@@ -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.
|
|
@@ -58,9 +63,10 @@ module Bandwidth
|
|
|
58
63
|
end
|
|
59
64
|
|
|
60
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
61
67
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
62
|
-
if (!
|
|
63
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateSyncLookupResponse`. Please check the name to make sure it's valid. List of attributes: " +
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateSyncLookupResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
64
70
|
end
|
|
65
71
|
h[k.to_sym] = v
|
|
66
72
|
}
|
|
@@ -142,61 +148,6 @@ module Bandwidth
|
|
|
142
148
|
new(transformed_hash)
|
|
143
149
|
end
|
|
144
150
|
|
|
145
|
-
# Deserializes the data based on type
|
|
146
|
-
# @param string type Data type
|
|
147
|
-
# @param string value Value to be deserialized
|
|
148
|
-
# @return [Object] Deserialized data
|
|
149
|
-
def self._deserialize(type, value)
|
|
150
|
-
case type.to_sym
|
|
151
|
-
when :Time
|
|
152
|
-
Time.parse(value)
|
|
153
|
-
when :Date
|
|
154
|
-
Date.parse(value)
|
|
155
|
-
when :String
|
|
156
|
-
value.to_s
|
|
157
|
-
when :Integer
|
|
158
|
-
value.to_i
|
|
159
|
-
when :Float
|
|
160
|
-
value.to_f
|
|
161
|
-
when :Boolean
|
|
162
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
163
|
-
true
|
|
164
|
-
else
|
|
165
|
-
false
|
|
166
|
-
end
|
|
167
|
-
when :Object
|
|
168
|
-
# generic object (usually a Hash), return directly
|
|
169
|
-
value
|
|
170
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
171
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
172
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
173
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
174
|
-
k_type = Regexp.last_match[:k_type]
|
|
175
|
-
v_type = Regexp.last_match[:v_type]
|
|
176
|
-
{}.tap do |hash|
|
|
177
|
-
value.each do |k, v|
|
|
178
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
179
|
-
end
|
|
180
|
-
end
|
|
181
|
-
else # model
|
|
182
|
-
# models (e.g. Pet) or oneOf
|
|
183
|
-
klass = Bandwidth.const_get(type)
|
|
184
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
# Returns the string representation of the object
|
|
189
|
-
# @return [String] String presentation of the object
|
|
190
|
-
def to_s
|
|
191
|
-
to_hash.to_s
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
195
|
-
# @return [Hash] Returns the object in the form of hash
|
|
196
|
-
def to_body
|
|
197
|
-
to_hash
|
|
198
|
-
end
|
|
199
|
-
|
|
200
151
|
# Returns the object in the form of hash
|
|
201
152
|
# @return [Hash] Returns the object in the form of hash
|
|
202
153
|
def to_hash
|
|
@@ -212,23 +163,5 @@ module Bandwidth
|
|
|
212
163
|
end
|
|
213
164
|
hash
|
|
214
165
|
end
|
|
215
|
-
|
|
216
|
-
# Outputs non-array value in the form of hash
|
|
217
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
218
|
-
# @param [Object] value Any valid value
|
|
219
|
-
# @return [Hash] Returns the value in the form of hash
|
|
220
|
-
def _to_hash(value)
|
|
221
|
-
if value.is_a?(Array)
|
|
222
|
-
value.compact.map { |v| _to_hash(v) }
|
|
223
|
-
elsif value.is_a?(Hash)
|
|
224
|
-
{}.tap do |hash|
|
|
225
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
226
|
-
end
|
|
227
|
-
elsif value.respond_to? :to_hash
|
|
228
|
-
value.to_hash
|
|
229
|
-
else
|
|
230
|
-
value
|
|
231
|
-
end
|
|
232
|
-
end
|
|
233
166
|
end
|
|
234
167
|
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 phone number lookup response data
|
|
18
|
-
class CreateSyncLookupResponseData
|
|
18
|
+
class CreateSyncLookupResponseData < ApiModelBase
|
|
19
19
|
# The phone number lookup request ID from Bandwidth.
|
|
20
20
|
attr_accessor :request_id
|
|
21
21
|
|
|
@@ -55,9 +55,14 @@ module Bandwidth
|
|
|
55
55
|
}
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
# Returns attribute mapping this model knows about
|
|
59
|
+
def self.acceptable_attribute_map
|
|
60
|
+
attribute_map
|
|
61
|
+
end
|
|
62
|
+
|
|
58
63
|
# Returns all the JSON keys this model knows about
|
|
59
64
|
def self.acceptable_attributes
|
|
60
|
-
|
|
65
|
+
acceptable_attribute_map.values
|
|
61
66
|
end
|
|
62
67
|
|
|
63
68
|
# Attribute type mapping.
|
|
@@ -83,9 +88,10 @@ module Bandwidth
|
|
|
83
88
|
end
|
|
84
89
|
|
|
85
90
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
91
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
86
92
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
87
|
-
if (!
|
|
88
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateSyncLookupResponseData`. Please check the name to make sure it's valid. List of attributes: " +
|
|
93
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
94
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateSyncLookupResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
89
95
|
end
|
|
90
96
|
h[k.to_sym] = v
|
|
91
97
|
}
|
|
@@ -165,61 +171,6 @@ module Bandwidth
|
|
|
165
171
|
new(transformed_hash)
|
|
166
172
|
end
|
|
167
173
|
|
|
168
|
-
# Deserializes the data based on type
|
|
169
|
-
# @param string type Data type
|
|
170
|
-
# @param string value Value to be deserialized
|
|
171
|
-
# @return [Object] Deserialized data
|
|
172
|
-
def self._deserialize(type, value)
|
|
173
|
-
case type.to_sym
|
|
174
|
-
when :Time
|
|
175
|
-
Time.parse(value)
|
|
176
|
-
when :Date
|
|
177
|
-
Date.parse(value)
|
|
178
|
-
when :String
|
|
179
|
-
value.to_s
|
|
180
|
-
when :Integer
|
|
181
|
-
value.to_i
|
|
182
|
-
when :Float
|
|
183
|
-
value.to_f
|
|
184
|
-
when :Boolean
|
|
185
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
186
|
-
true
|
|
187
|
-
else
|
|
188
|
-
false
|
|
189
|
-
end
|
|
190
|
-
when :Object
|
|
191
|
-
# generic object (usually a Hash), return directly
|
|
192
|
-
value
|
|
193
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
194
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
195
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
196
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
197
|
-
k_type = Regexp.last_match[:k_type]
|
|
198
|
-
v_type = Regexp.last_match[:v_type]
|
|
199
|
-
{}.tap do |hash|
|
|
200
|
-
value.each do |k, v|
|
|
201
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
202
|
-
end
|
|
203
|
-
end
|
|
204
|
-
else # model
|
|
205
|
-
# models (e.g. Pet) or oneOf
|
|
206
|
-
klass = Bandwidth.const_get(type)
|
|
207
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
208
|
-
end
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
# Returns the string representation of the object
|
|
212
|
-
# @return [String] String presentation of the object
|
|
213
|
-
def to_s
|
|
214
|
-
to_hash.to_s
|
|
215
|
-
end
|
|
216
|
-
|
|
217
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
218
|
-
# @return [Hash] Returns the object in the form of hash
|
|
219
|
-
def to_body
|
|
220
|
-
to_hash
|
|
221
|
-
end
|
|
222
|
-
|
|
223
174
|
# Returns the object in the form of hash
|
|
224
175
|
# @return [Hash] Returns the object in the form of hash
|
|
225
176
|
def to_hash
|
|
@@ -235,23 +186,5 @@ module Bandwidth
|
|
|
235
186
|
end
|
|
236
187
|
hash
|
|
237
188
|
end
|
|
238
|
-
|
|
239
|
-
# Outputs non-array value in the form of hash
|
|
240
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
241
|
-
# @param [Object] value Any valid value
|
|
242
|
-
# @return [Hash] Returns the value in the form of hash
|
|
243
|
-
def _to_hash(value)
|
|
244
|
-
if value.is_a?(Array)
|
|
245
|
-
value.compact.map { |v| _to_hash(v) }
|
|
246
|
-
elsif value.is_a?(Hash)
|
|
247
|
-
{}.tap do |hash|
|
|
248
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
249
|
-
end
|
|
250
|
-
elsif value.respond_to? :to_hash
|
|
251
|
-
value.to_hash
|
|
252
|
-
else
|
|
253
|
-
value
|
|
254
|
-
end
|
|
255
|
-
end
|
|
256
189
|
end
|
|
257
190
|
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 Disconnect event is fired when a call ends, for any reason.
|
|
18
|
-
class DisconnectCallback
|
|
18
|
+
class DisconnectCallback < ApiModelBase
|
|
19
19
|
# The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
|
|
20
20
|
attr_accessor :event_type
|
|
21
21
|
|
|
@@ -111,9 +111,14 @@ module Bandwidth
|
|
|
111
111
|
}
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
+
# Returns attribute mapping this model knows about
|
|
115
|
+
def self.acceptable_attribute_map
|
|
116
|
+
attribute_map
|
|
117
|
+
end
|
|
118
|
+
|
|
114
119
|
# Returns all the JSON keys this model knows about
|
|
115
120
|
def self.acceptable_attributes
|
|
116
|
-
|
|
121
|
+
acceptable_attribute_map.values
|
|
117
122
|
end
|
|
118
123
|
|
|
119
124
|
# Attribute type mapping.
|
|
@@ -158,9 +163,10 @@ module Bandwidth
|
|
|
158
163
|
end
|
|
159
164
|
|
|
160
165
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
166
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
161
167
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
162
|
-
if (!
|
|
163
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DisconnectCallback`. Please check the name to make sure it's valid. List of attributes: " +
|
|
168
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
169
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DisconnectCallback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
164
170
|
end
|
|
165
171
|
h[k.to_sym] = v
|
|
166
172
|
}
|
|
@@ -308,61 +314,6 @@ module Bandwidth
|
|
|
308
314
|
new(transformed_hash)
|
|
309
315
|
end
|
|
310
316
|
|
|
311
|
-
# Deserializes the data based on type
|
|
312
|
-
# @param string type Data type
|
|
313
|
-
# @param string value Value to be deserialized
|
|
314
|
-
# @return [Object] Deserialized data
|
|
315
|
-
def self._deserialize(type, value)
|
|
316
|
-
case type.to_sym
|
|
317
|
-
when :Time
|
|
318
|
-
Time.parse(value)
|
|
319
|
-
when :Date
|
|
320
|
-
Date.parse(value)
|
|
321
|
-
when :String
|
|
322
|
-
value.to_s
|
|
323
|
-
when :Integer
|
|
324
|
-
value.to_i
|
|
325
|
-
when :Float
|
|
326
|
-
value.to_f
|
|
327
|
-
when :Boolean
|
|
328
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
329
|
-
true
|
|
330
|
-
else
|
|
331
|
-
false
|
|
332
|
-
end
|
|
333
|
-
when :Object
|
|
334
|
-
# generic object (usually a Hash), return directly
|
|
335
|
-
value
|
|
336
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
337
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
338
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
339
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
340
|
-
k_type = Regexp.last_match[:k_type]
|
|
341
|
-
v_type = Regexp.last_match[:v_type]
|
|
342
|
-
{}.tap do |hash|
|
|
343
|
-
value.each do |k, v|
|
|
344
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
345
|
-
end
|
|
346
|
-
end
|
|
347
|
-
else # model
|
|
348
|
-
# models (e.g. Pet) or oneOf
|
|
349
|
-
klass = Bandwidth.const_get(type)
|
|
350
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
351
|
-
end
|
|
352
|
-
end
|
|
353
|
-
|
|
354
|
-
# Returns the string representation of the object
|
|
355
|
-
# @return [String] String presentation of the object
|
|
356
|
-
def to_s
|
|
357
|
-
to_hash.to_s
|
|
358
|
-
end
|
|
359
|
-
|
|
360
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
361
|
-
# @return [Hash] Returns the object in the form of hash
|
|
362
|
-
def to_body
|
|
363
|
-
to_hash
|
|
364
|
-
end
|
|
365
|
-
|
|
366
317
|
# Returns the object in the form of hash
|
|
367
318
|
# @return [Hash] Returns the object in the form of hash
|
|
368
319
|
def to_hash
|
|
@@ -378,23 +329,5 @@ module Bandwidth
|
|
|
378
329
|
end
|
|
379
330
|
hash
|
|
380
331
|
end
|
|
381
|
-
|
|
382
|
-
# Outputs non-array value in the form of hash
|
|
383
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
384
|
-
# @param [Object] value Any valid value
|
|
385
|
-
# @return [Hash] Returns the value in the form of hash
|
|
386
|
-
def _to_hash(value)
|
|
387
|
-
if value.is_a?(Array)
|
|
388
|
-
value.compact.map { |v| _to_hash(v) }
|
|
389
|
-
elsif value.is_a?(Hash)
|
|
390
|
-
{}.tap do |hash|
|
|
391
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
392
|
-
end
|
|
393
|
-
elsif value.respond_to? :to_hash
|
|
394
|
-
value.to_hash
|
|
395
|
-
else
|
|
396
|
-
value
|
|
397
|
-
end
|
|
398
|
-
end
|
|
399
332
|
end
|
|
400
333
|
end
|