bandwidth-sdk 11.0.0.pre.beta.2.0 → 11.0.0.pre.beta.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bandwidth-sdk.gemspec +1 -1
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +262 -295
- data/coverage/index.html +2527 -2890
- data/lib/bandwidth-sdk/api/calls_api.rb +1 -1
- data/lib/bandwidth-sdk/api/conferences_api.rb +1 -1
- data/lib/bandwidth-sdk/api/media_api.rb +1 -1
- data/lib/bandwidth-sdk/api/messages_api.rb +1 -1
- data/lib/bandwidth-sdk/api/mfa_api.rb +1 -1
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +1 -1
- data/lib/bandwidth-sdk/api/recordings_api.rb +1 -1
- data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
- data/lib/bandwidth-sdk/api_client.rb +1 -1
- data/lib/bandwidth-sdk/api_error.rb +1 -1
- data/lib/bandwidth-sdk/configuration.rb +10 -8
- data/lib/bandwidth-sdk/models/account_statistics.rb +13 -18
- data/lib/bandwidth-sdk/models/answer_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +13 -18
- data/lib/bandwidth-sdk/models/call_state.rb +13 -18
- data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/code_request.rb +28 -19
- data/lib/bandwidth-sdk/models/conference.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_member.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/create_call.rb +21 -18
- data/lib/bandwidth-sdk/models/create_call_response.rb +27 -18
- data/lib/bandwidth-sdk/models/create_lookup_response.rb +13 -18
- data/lib/bandwidth-sdk/models/create_message_request_error.rb +17 -18
- data/lib/bandwidth-sdk/models/deferred_result.rb +13 -18
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/diversion.rb +13 -18
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/field_error.rb +13 -18
- data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/gather_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/inbound_message_callback.rb +23 -18
- data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +31 -18
- data/lib/bandwidth-sdk/models/initiate_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/list_message_item.rb +13 -18
- data/lib/bandwidth-sdk/models/lookup_request.rb +15 -18
- data/lib/bandwidth-sdk/models/lookup_result.rb +13 -18
- data/lib/bandwidth-sdk/models/lookup_status.rb +13 -18
- data/lib/bandwidth-sdk/models/lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +13 -18
- data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_result.rb +13 -18
- data/lib/bandwidth-sdk/models/media.rb +13 -18
- data/lib/bandwidth-sdk/models/message.rb +21 -18
- data/lib/bandwidth-sdk/models/message_delivered_callback.rb +23 -18
- data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +33 -18
- data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_failed_callback.rb +25 -18
- data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +35 -18
- data/lib/bandwidth-sdk/models/message_request.rb +24 -19
- data/lib/bandwidth-sdk/models/message_sending_callback.rb +23 -18
- data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +35 -18
- 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 +13 -18
- data/lib/bandwidth-sdk/models/messaging_code_response.rb +13 -18
- data/lib/bandwidth-sdk/models/messaging_request_error.rb +17 -18
- data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/mfa_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/page_info.rb +13 -18
- data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/redirect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/stir_shaken.rb +13 -18
- data/lib/bandwidth-sdk/models/tag.rb +13 -18
- data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +13 -18
- data/lib/bandwidth-sdk/models/transcribe_recording.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription_list.rb +13 -18
- data/lib/bandwidth-sdk/models/transcription_metadata.rb +13 -18
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +13 -18
- data/lib/bandwidth-sdk/models/update_call.rb +13 -18
- data/lib/bandwidth-sdk/models/update_call_recording.rb +15 -18
- data/lib/bandwidth-sdk/models/update_conference.rb +13 -18
- data/lib/bandwidth-sdk/models/update_conference_member.rb +13 -18
- data/lib/bandwidth-sdk/models/verify_code_request.rb +19 -18
- data/lib/bandwidth-sdk/models/verify_code_response.rb +13 -18
- data/lib/bandwidth-sdk/models/voice_api_error.rb +13 -18
- data/lib/bandwidth-sdk/models/voice_code_response.rb +13 -18
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +19 -7
- data/spec/models/call_state_spec.rb +0 -13
- data/spec/models/deferred_result_spec.rb +1 -14
- data/spec/models/message_spec.rb +10 -17
- data/spec/models/verify_code_request_spec.rb +7 -15
- metadata +2 -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -66,6 +66,7 @@ module Bandwidth
|
|
66
66
|
# Show invalid properties with the reasons. Usually used together with valid?
|
67
67
|
# @return Array for valid properties with the reasons
|
68
68
|
def list_invalid_properties
|
69
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
69
70
|
invalid_properties = Array.new
|
70
71
|
invalid_properties
|
71
72
|
end
|
@@ -73,6 +74,7 @@ module Bandwidth
|
|
73
74
|
# Check to see if the all the properties in the model are valid
|
74
75
|
# @return true if the model is valid
|
75
76
|
def valid?
|
77
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
76
78
|
true
|
77
79
|
end
|
78
80
|
|
@@ -100,37 +102,30 @@ module Bandwidth
|
|
100
102
|
# @param [Hash] attributes Model attributes in the form of hash
|
101
103
|
# @return [Object] Returns the model itself
|
102
104
|
def self.build_from_hash(attributes)
|
103
|
-
new.build_from_hash(attributes)
|
104
|
-
end
|
105
|
-
|
106
|
-
# Builds the object from hash
|
107
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
-
# @return [Object] Returns the model itself
|
109
|
-
def build_from_hash(attributes)
|
110
105
|
return nil unless attributes.is_a?(Hash)
|
111
106
|
attributes = attributes.transform_keys(&:to_sym)
|
112
|
-
|
113
|
-
|
114
|
-
|
107
|
+
transformed_hash = {}
|
108
|
+
openapi_types.each_pair do |key, type|
|
109
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
110
|
+
transformed_hash["#{key}"] = nil
|
115
111
|
elsif type =~ /\AArray<(.*)>/i
|
116
112
|
# check to ensure the input is an array given that the attribute
|
117
113
|
# is documented as an array but the input is not
|
118
|
-
if attributes[
|
119
|
-
|
114
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
115
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
120
116
|
end
|
121
|
-
elsif !attributes[
|
122
|
-
|
117
|
+
elsif !attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
123
119
|
end
|
124
120
|
end
|
125
|
-
|
126
|
-
self
|
121
|
+
new(transformed_hash)
|
127
122
|
end
|
128
123
|
|
129
124
|
# Deserializes the data based on type
|
130
125
|
# @param string type Data type
|
131
126
|
# @param string value Value to be deserialized
|
132
127
|
# @return [Object] Deserialized data
|
133
|
-
def _deserialize(type, value)
|
128
|
+
def self._deserialize(type, value)
|
134
129
|
case type.to_sym
|
135
130
|
when :Time
|
136
131
|
Time.parse(value)
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -75,6 +75,7 @@ module Bandwidth
|
|
75
75
|
# Show invalid properties with the reasons. Usually used together with valid?
|
76
76
|
# @return Array for valid properties with the reasons
|
77
77
|
def list_invalid_properties
|
78
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
78
79
|
invalid_properties = Array.new
|
79
80
|
invalid_properties
|
80
81
|
end
|
@@ -82,6 +83,7 @@ module Bandwidth
|
|
82
83
|
# Check to see if the all the properties in the model are valid
|
83
84
|
# @return true if the model is valid
|
84
85
|
def valid?
|
86
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
85
87
|
true
|
86
88
|
end
|
87
89
|
|
@@ -110,37 +112,30 @@ module Bandwidth
|
|
110
112
|
# @param [Hash] attributes Model attributes in the form of hash
|
111
113
|
# @return [Object] Returns the model itself
|
112
114
|
def self.build_from_hash(attributes)
|
113
|
-
new.build_from_hash(attributes)
|
114
|
-
end
|
115
|
-
|
116
|
-
# Builds the object from hash
|
117
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
-
# @return [Object] Returns the model itself
|
119
|
-
def build_from_hash(attributes)
|
120
115
|
return nil unless attributes.is_a?(Hash)
|
121
116
|
attributes = attributes.transform_keys(&:to_sym)
|
122
|
-
|
123
|
-
|
124
|
-
|
117
|
+
transformed_hash = {}
|
118
|
+
openapi_types.each_pair do |key, type|
|
119
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
120
|
+
transformed_hash["#{key}"] = nil
|
125
121
|
elsif type =~ /\AArray<(.*)>/i
|
126
122
|
# check to ensure the input is an array given that the attribute
|
127
123
|
# is documented as an array but the input is not
|
128
|
-
if attributes[
|
129
|
-
|
124
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
125
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
130
126
|
end
|
131
|
-
elsif !attributes[
|
132
|
-
|
127
|
+
elsif !attributes[attribute_map[key]].nil?
|
128
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
133
129
|
end
|
134
130
|
end
|
135
|
-
|
136
|
-
self
|
131
|
+
new(transformed_hash)
|
137
132
|
end
|
138
133
|
|
139
134
|
# Deserializes the data based on type
|
140
135
|
# @param string type Data type
|
141
136
|
# @param string value Value to be deserialized
|
142
137
|
# @return [Object] Deserialized data
|
143
|
-
def _deserialize(type, value)
|
138
|
+
def self._deserialize(type, value)
|
144
139
|
case type.to_sym
|
145
140
|
when :Time
|
146
141
|
Time.parse(value)
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -66,6 +66,7 @@ module Bandwidth
|
|
66
66
|
# Show invalid properties with the reasons. Usually used together with valid?
|
67
67
|
# @return Array for valid properties with the reasons
|
68
68
|
def list_invalid_properties
|
69
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
69
70
|
invalid_properties = Array.new
|
70
71
|
invalid_properties
|
71
72
|
end
|
@@ -73,6 +74,7 @@ module Bandwidth
|
|
73
74
|
# Check to see if the all the properties in the model are valid
|
74
75
|
# @return true if the model is valid
|
75
76
|
def valid?
|
77
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
76
78
|
true
|
77
79
|
end
|
78
80
|
|
@@ -100,37 +102,30 @@ module Bandwidth
|
|
100
102
|
# @param [Hash] attributes Model attributes in the form of hash
|
101
103
|
# @return [Object] Returns the model itself
|
102
104
|
def self.build_from_hash(attributes)
|
103
|
-
new.build_from_hash(attributes)
|
104
|
-
end
|
105
|
-
|
106
|
-
# Builds the object from hash
|
107
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
-
# @return [Object] Returns the model itself
|
109
|
-
def build_from_hash(attributes)
|
110
105
|
return nil unless attributes.is_a?(Hash)
|
111
106
|
attributes = attributes.transform_keys(&:to_sym)
|
112
|
-
|
113
|
-
|
114
|
-
|
107
|
+
transformed_hash = {}
|
108
|
+
openapi_types.each_pair do |key, type|
|
109
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
110
|
+
transformed_hash["#{key}"] = nil
|
115
111
|
elsif type =~ /\AArray<(.*)>/i
|
116
112
|
# check to ensure the input is an array given that the attribute
|
117
113
|
# is documented as an array but the input is not
|
118
|
-
if attributes[
|
119
|
-
|
114
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
115
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
120
116
|
end
|
121
|
-
elsif !attributes[
|
122
|
-
|
117
|
+
elsif !attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
123
119
|
end
|
124
120
|
end
|
125
|
-
|
126
|
-
self
|
121
|
+
new(transformed_hash)
|
127
122
|
end
|
128
123
|
|
129
124
|
# Deserializes the data based on type
|
130
125
|
# @param string type Data type
|
131
126
|
# @param string value Value to be deserialized
|
132
127
|
# @return [Object] Deserialized data
|
133
|
-
def _deserialize(type, value)
|
128
|
+
def self._deserialize(type, value)
|
134
129
|
case type.to_sym
|
135
130
|
when :Time
|
136
131
|
Time.parse(value)
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -93,6 +93,7 @@ module Bandwidth
|
|
93
93
|
# Show invalid properties with the reasons. Usually used together with valid?
|
94
94
|
# @return Array for valid properties with the reasons
|
95
95
|
def list_invalid_properties
|
96
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
96
97
|
invalid_properties = Array.new
|
97
98
|
invalid_properties
|
98
99
|
end
|
@@ -100,6 +101,7 @@ module Bandwidth
|
|
100
101
|
# Check to see if the all the properties in the model are valid
|
101
102
|
# @return true if the model is valid
|
102
103
|
def valid?
|
104
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
103
105
|
true
|
104
106
|
end
|
105
107
|
|
@@ -130,37 +132,30 @@ module Bandwidth
|
|
130
132
|
# @param [Hash] attributes Model attributes in the form of hash
|
131
133
|
# @return [Object] Returns the model itself
|
132
134
|
def self.build_from_hash(attributes)
|
133
|
-
new.build_from_hash(attributes)
|
134
|
-
end
|
135
|
-
|
136
|
-
# Builds the object from hash
|
137
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
138
|
-
# @return [Object] Returns the model itself
|
139
|
-
def build_from_hash(attributes)
|
140
135
|
return nil unless attributes.is_a?(Hash)
|
141
136
|
attributes = attributes.transform_keys(&:to_sym)
|
142
|
-
|
143
|
-
|
144
|
-
|
137
|
+
transformed_hash = {}
|
138
|
+
openapi_types.each_pair do |key, type|
|
139
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
140
|
+
transformed_hash["#{key}"] = nil
|
145
141
|
elsif type =~ /\AArray<(.*)>/i
|
146
142
|
# check to ensure the input is an array given that the attribute
|
147
143
|
# is documented as an array but the input is not
|
148
|
-
if attributes[
|
149
|
-
|
144
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
145
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
150
146
|
end
|
151
|
-
elsif !attributes[
|
152
|
-
|
147
|
+
elsif !attributes[attribute_map[key]].nil?
|
148
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
153
149
|
end
|
154
150
|
end
|
155
|
-
|
156
|
-
self
|
151
|
+
new(transformed_hash)
|
157
152
|
end
|
158
153
|
|
159
154
|
# Deserializes the data based on type
|
160
155
|
# @param string type Data type
|
161
156
|
# @param string value Value to be deserialized
|
162
157
|
# @return [Object] Deserialized data
|
163
|
-
def _deserialize(type, value)
|
158
|
+
def self._deserialize(type, value)
|
164
159
|
case type.to_sym
|
165
160
|
when :Time
|
166
161
|
Time.parse(value)
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -279,6 +279,7 @@ module Bandwidth
|
|
279
279
|
# Show invalid properties with the reasons. Usually used together with valid?
|
280
280
|
# @return Array for valid properties with the reasons
|
281
281
|
def list_invalid_properties
|
282
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
282
283
|
invalid_properties = Array.new
|
283
284
|
invalid_properties
|
284
285
|
end
|
@@ -286,6 +287,7 @@ module Bandwidth
|
|
286
287
|
# Check to see if the all the properties in the model are valid
|
287
288
|
# @return true if the model is valid
|
288
289
|
def valid?
|
290
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
289
291
|
true
|
290
292
|
end
|
291
293
|
|
@@ -334,37 +336,30 @@ module Bandwidth
|
|
334
336
|
# @param [Hash] attributes Model attributes in the form of hash
|
335
337
|
# @return [Object] Returns the model itself
|
336
338
|
def self.build_from_hash(attributes)
|
337
|
-
new.build_from_hash(attributes)
|
338
|
-
end
|
339
|
-
|
340
|
-
# Builds the object from hash
|
341
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
342
|
-
# @return [Object] Returns the model itself
|
343
|
-
def build_from_hash(attributes)
|
344
339
|
return nil unless attributes.is_a?(Hash)
|
345
340
|
attributes = attributes.transform_keys(&:to_sym)
|
346
|
-
|
347
|
-
|
348
|
-
|
341
|
+
transformed_hash = {}
|
342
|
+
openapi_types.each_pair do |key, type|
|
343
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
344
|
+
transformed_hash["#{key}"] = nil
|
349
345
|
elsif type =~ /\AArray<(.*)>/i
|
350
346
|
# check to ensure the input is an array given that the attribute
|
351
347
|
# is documented as an array but the input is not
|
352
|
-
if attributes[
|
353
|
-
|
348
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
349
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
354
350
|
end
|
355
|
-
elsif !attributes[
|
356
|
-
|
351
|
+
elsif !attributes[attribute_map[key]].nil?
|
352
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
357
353
|
end
|
358
354
|
end
|
359
|
-
|
360
|
-
self
|
355
|
+
new(transformed_hash)
|
361
356
|
end
|
362
357
|
|
363
358
|
# Deserializes the data based on type
|
364
359
|
# @param string type Data type
|
365
360
|
# @param string value Value to be deserialized
|
366
361
|
# @return [Object] Deserialized data
|
367
|
-
def _deserialize(type, value)
|
362
|
+
def self._deserialize(type, value)
|
368
363
|
case type.to_sym
|
369
364
|
when :Time
|
370
365
|
Time.parse(value)
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -280,6 +280,7 @@ module Bandwidth
|
|
280
280
|
# Show invalid properties with the reasons. Usually used together with valid?
|
281
281
|
# @return Array for valid properties with the reasons
|
282
282
|
def list_invalid_properties
|
283
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
283
284
|
invalid_properties = Array.new
|
284
285
|
invalid_properties
|
285
286
|
end
|
@@ -287,6 +288,7 @@ module Bandwidth
|
|
287
288
|
# Check to see if the all the properties in the model are valid
|
288
289
|
# @return true if the model is valid
|
289
290
|
def valid?
|
291
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
290
292
|
true
|
291
293
|
end
|
292
294
|
|
@@ -335,37 +337,30 @@ module Bandwidth
|
|
335
337
|
# @param [Hash] attributes Model attributes in the form of hash
|
336
338
|
# @return [Object] Returns the model itself
|
337
339
|
def self.build_from_hash(attributes)
|
338
|
-
new.build_from_hash(attributes)
|
339
|
-
end
|
340
|
-
|
341
|
-
# Builds the object from hash
|
342
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
343
|
-
# @return [Object] Returns the model itself
|
344
|
-
def build_from_hash(attributes)
|
345
340
|
return nil unless attributes.is_a?(Hash)
|
346
341
|
attributes = attributes.transform_keys(&:to_sym)
|
347
|
-
|
348
|
-
|
349
|
-
|
342
|
+
transformed_hash = {}
|
343
|
+
openapi_types.each_pair do |key, type|
|
344
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
345
|
+
transformed_hash["#{key}"] = nil
|
350
346
|
elsif type =~ /\AArray<(.*)>/i
|
351
347
|
# check to ensure the input is an array given that the attribute
|
352
348
|
# is documented as an array but the input is not
|
353
|
-
if attributes[
|
354
|
-
|
349
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
350
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
355
351
|
end
|
356
|
-
elsif !attributes[
|
357
|
-
|
352
|
+
elsif !attributes[attribute_map[key]].nil?
|
353
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
358
354
|
end
|
359
355
|
end
|
360
|
-
|
361
|
-
self
|
356
|
+
new(transformed_hash)
|
362
357
|
end
|
363
358
|
|
364
359
|
# Deserializes the data based on type
|
365
360
|
# @param string type Data type
|
366
361
|
# @param string value Value to be deserialized
|
367
362
|
# @return [Object] Deserialized data
|
368
|
-
def _deserialize(type, value)
|
363
|
+
def self._deserialize(type, value)
|
369
364
|
case type.to_sym
|
370
365
|
when :Time
|
371
366
|
Time.parse(value)
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -226,6 +226,7 @@ module Bandwidth
|
|
226
226
|
# Show invalid properties with the reasons. Usually used together with valid?
|
227
227
|
# @return Array for valid properties with the reasons
|
228
228
|
def list_invalid_properties
|
229
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
229
230
|
invalid_properties = Array.new
|
230
231
|
invalid_properties
|
231
232
|
end
|
@@ -233,6 +234,7 @@ module Bandwidth
|
|
233
234
|
# Check to see if the all the properties in the model are valid
|
234
235
|
# @return true if the model is valid
|
235
236
|
def valid?
|
237
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
236
238
|
true
|
237
239
|
end
|
238
240
|
|
@@ -275,37 +277,30 @@ module Bandwidth
|
|
275
277
|
# @param [Hash] attributes Model attributes in the form of hash
|
276
278
|
# @return [Object] Returns the model itself
|
277
279
|
def self.build_from_hash(attributes)
|
278
|
-
new.build_from_hash(attributes)
|
279
|
-
end
|
280
|
-
|
281
|
-
# Builds the object from hash
|
282
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
283
|
-
# @return [Object] Returns the model itself
|
284
|
-
def build_from_hash(attributes)
|
285
280
|
return nil unless attributes.is_a?(Hash)
|
286
281
|
attributes = attributes.transform_keys(&:to_sym)
|
287
|
-
|
288
|
-
|
289
|
-
|
282
|
+
transformed_hash = {}
|
283
|
+
openapi_types.each_pair do |key, type|
|
284
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
285
|
+
transformed_hash["#{key}"] = nil
|
290
286
|
elsif type =~ /\AArray<(.*)>/i
|
291
287
|
# check to ensure the input is an array given that the attribute
|
292
288
|
# is documented as an array but the input is not
|
293
|
-
if attributes[
|
294
|
-
|
289
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
290
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
295
291
|
end
|
296
|
-
elsif !attributes[
|
297
|
-
|
292
|
+
elsif !attributes[attribute_map[key]].nil?
|
293
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
298
294
|
end
|
299
295
|
end
|
300
|
-
|
301
|
-
self
|
296
|
+
new(transformed_hash)
|
302
297
|
end
|
303
298
|
|
304
299
|
# Deserializes the data based on type
|
305
300
|
# @param string type Data type
|
306
301
|
# @param string value Value to be deserialized
|
307
302
|
# @return [Object] Deserialized data
|
308
|
-
def _deserialize(type, value)
|
303
|
+
def self._deserialize(type, value)
|
309
304
|
case type.to_sym
|
310
305
|
when :Time
|
311
306
|
Time.parse(value)
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -84,6 +84,7 @@ module Bandwidth
|
|
84
84
|
# Show invalid properties with the reasons. Usually used together with valid?
|
85
85
|
# @return Array for valid properties with the reasons
|
86
86
|
def list_invalid_properties
|
87
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
87
88
|
invalid_properties = Array.new
|
88
89
|
invalid_properties
|
89
90
|
end
|
@@ -91,6 +92,7 @@ module Bandwidth
|
|
91
92
|
# Check to see if the all the properties in the model are valid
|
92
93
|
# @return true if the model is valid
|
93
94
|
def valid?
|
95
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
94
96
|
true
|
95
97
|
end
|
96
98
|
|
@@ -120,37 +122,30 @@ module Bandwidth
|
|
120
122
|
# @param [Hash] attributes Model attributes in the form of hash
|
121
123
|
# @return [Object] Returns the model itself
|
122
124
|
def self.build_from_hash(attributes)
|
123
|
-
new.build_from_hash(attributes)
|
124
|
-
end
|
125
|
-
|
126
|
-
# Builds the object from hash
|
127
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
128
|
-
# @return [Object] Returns the model itself
|
129
|
-
def build_from_hash(attributes)
|
130
125
|
return nil unless attributes.is_a?(Hash)
|
131
126
|
attributes = attributes.transform_keys(&:to_sym)
|
132
|
-
|
133
|
-
|
134
|
-
|
127
|
+
transformed_hash = {}
|
128
|
+
openapi_types.each_pair do |key, type|
|
129
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
130
|
+
transformed_hash["#{key}"] = nil
|
135
131
|
elsif type =~ /\AArray<(.*)>/i
|
136
132
|
# check to ensure the input is an array given that the attribute
|
137
133
|
# is documented as an array but the input is not
|
138
|
-
if attributes[
|
139
|
-
|
134
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
135
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
140
136
|
end
|
141
|
-
elsif !attributes[
|
142
|
-
|
137
|
+
elsif !attributes[attribute_map[key]].nil?
|
138
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
143
139
|
end
|
144
140
|
end
|
145
|
-
|
146
|
-
self
|
141
|
+
new(transformed_hash)
|
147
142
|
end
|
148
143
|
|
149
144
|
# Deserializes the data based on type
|
150
145
|
# @param string type Data type
|
151
146
|
# @param string value Value to be deserialized
|
152
147
|
# @return [Object] Deserialized data
|
153
|
-
def _deserialize(type, value)
|
148
|
+
def self._deserialize(type, value)
|
154
149
|
case type.to_sym
|
155
150
|
when :Time
|
156
151
|
Time.parse(value)
|