bandwidth-sdk 15.0.0 → 16.0.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.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +16 -16
  3. data/README.md +18 -10
  4. data/bandwidth.yml +549 -194
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +322 -366
  7. data/coverage/index.html +10088 -10530
  8. data/custom_templates/README.mustache +1 -1
  9. data/docs/BlockedWebhook.md +28 -0
  10. data/docs/Callback.md +84 -0
  11. data/docs/CreateMultiChannelMessageResponse.md +3 -3
  12. data/docs/ErrorObject.md +6 -4
  13. data/docs/ErrorSource.md +24 -0
  14. data/docs/FailureWebhook.md +2 -2
  15. data/docs/InboundCallback.md +28 -0
  16. data/docs/InboundCallbackMessage.md +48 -0
  17. data/docs/{MultiChannelStatusEnum.md → InboundCallbackTypeEnum.md} +2 -2
  18. data/docs/ListMessageItem.md +1 -1
  19. data/docs/Message.md +5 -5
  20. data/docs/MessageRequest.md +1 -1
  21. data/docs/MmsMessageContent.md +2 -2
  22. data/docs/MmsMessageContentFile.md +18 -0
  23. data/docs/MultiChannelActionCalendarEvent.md +2 -2
  24. data/docs/MultiChannelError.md +22 -0
  25. data/docs/MultiChannelMessageContent.md +20 -0
  26. data/docs/MultiChannelMessageResponseData.md +32 -0
  27. data/docs/MultiChannelMessageResponseDataChannelListInner.md +26 -0
  28. data/docs/RbmActionBase.md +2 -2
  29. data/docs/RbmActionDial.md +2 -2
  30. data/docs/RbmActionOpenUrl.md +2 -2
  31. data/docs/RbmActionViewLocation.md +2 -2
  32. data/docs/RbmLocationResponse.md +20 -0
  33. data/docs/RbmSuggestionResponse.md +20 -0
  34. data/docs/StatusCallback.md +32 -0
  35. data/docs/StatusCallbackMessage.md +42 -0
  36. data/docs/{CallbackTypeEnum.md → StatusCallbackTypeEnum.md} +2 -2
  37. data/docs/TfvStatus.md +2 -2
  38. data/docs/TfvSubmissionInfo.md +6 -6
  39. data/docs/TollFreeVerificationApi.md +72 -0
  40. data/docs/VerificationDenialWebhook.md +2 -2
  41. data/docs/VerificationRequest.md +6 -6
  42. data/docs/VerificationUpdateRequest.md +6 -6
  43. data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +82 -0
  44. data/lib/bandwidth-sdk/configuration.rb +6 -0
  45. data/lib/bandwidth-sdk/models/blocked_webhook.rb +323 -0
  46. data/lib/bandwidth-sdk/models/callback.rb +60 -0
  47. data/lib/bandwidth-sdk/models/create_multi_channel_message_response.rb +1 -1
  48. data/lib/bandwidth-sdk/models/error_object.rb +45 -13
  49. data/lib/bandwidth-sdk/models/error_source.rb +244 -0
  50. data/lib/bandwidth-sdk/models/failure_webhook.rb +7 -7
  51. data/lib/bandwidth-sdk/models/{message_callback.rb → inbound_callback.rb} +9 -20
  52. data/lib/bandwidth-sdk/models/inbound_callback_message.rb +454 -0
  53. data/lib/bandwidth-sdk/models/{multi_channel_message_direction_enum.rb → inbound_callback_type_enum.rb} +7 -6
  54. data/lib/bandwidth-sdk/models/list_message_item.rb +1 -1
  55. data/lib/bandwidth-sdk/models/message.rb +3 -3
  56. data/lib/bandwidth-sdk/models/message_request.rb +1 -1
  57. data/lib/bandwidth-sdk/models/mms_message_content.rb +1 -2
  58. data/lib/bandwidth-sdk/models/{multi_channel_message_callback_data.rb → mms_message_content_file.rb} +37 -100
  59. data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +21 -21
  60. data/lib/bandwidth-sdk/models/multi_channel_error.rb +235 -0
  61. data/lib/bandwidth-sdk/models/{deferred_result.rb → multi_channel_message_content.rb} +17 -16
  62. data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +372 -0
  63. data/lib/bandwidth-sdk/models/{multi_channel_message_data.rb → multi_channel_message_response_data_channel_list_inner.rb} +62 -59
  64. data/lib/bandwidth-sdk/models/rbm_action_base.rb +21 -21
  65. data/lib/bandwidth-sdk/models/rbm_action_dial.rb +21 -21
  66. data/lib/bandwidth-sdk/models/rbm_action_open_url.rb +21 -21
  67. data/lib/bandwidth-sdk/models/rbm_action_view_location.rb +21 -21
  68. data/lib/bandwidth-sdk/models/{tag.rb → rbm_location_response.rb} +18 -16
  69. data/lib/bandwidth-sdk/models/{multi_channel_callback_data.rb → rbm_suggestion_response.rb} +37 -67
  70. data/lib/bandwidth-sdk/models/status_callback.rb +338 -0
  71. data/lib/bandwidth-sdk/models/{message_callback_message.rb → status_callback_message.rb} +25 -17
  72. data/lib/bandwidth-sdk/models/{callback_type_enum.rb → status_callback_type_enum.rb} +5 -5
  73. data/lib/bandwidth-sdk/models/tfv_status.rb +2 -2
  74. data/lib/bandwidth-sdk/models/tfv_submission_info.rb +4 -4
  75. data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +2 -2
  76. data/lib/bandwidth-sdk/models/verification_request.rb +4 -4
  77. data/lib/bandwidth-sdk/models/verification_update_request.rb +4 -4
  78. data/lib/bandwidth-sdk/version.rb +1 -1
  79. data/lib/bandwidth-sdk.rb +16 -9
  80. data/spec/smoke/multi_channel_api_spec.rb +18 -20
  81. data/spec/smoke/toll_free_verification_api_spec.rb +7 -0
  82. data/spec/unit/api/toll_free_verification_api_spec.rb +8 -0
  83. data/spec/unit/client/api_client_spec.rb +4 -4
  84. data/spec/unit/models/tfv_error_spec.rb +78 -0
  85. data/spec/unit/models/verify_code_response_spec.rb +70 -0
  86. metadata +112 -98
  87. data/docs/DeferredResult.md +0 -20
  88. data/docs/MessageCallback.md +0 -30
  89. data/docs/MessageCallbackMessage.md +0 -40
  90. data/docs/MultiChannelCallbackData.md +0 -26
  91. data/docs/MultiChannelMessageCallbackData.md +0 -32
  92. data/docs/MultiChannelMessageData.md +0 -34
  93. data/docs/MultiChannelMessageDirectionEnum.md +0 -15
  94. data/docs/Tag.md +0 -20
  95. data/lib/bandwidth-sdk/models/multi_channel_status_enum.rb +0 -42
  96. data/spec/unit/models/deferred_result_spec.rb +0 -74
  97. /data/coverage/assets/{0.13.1 → 0.13.2}/DataTables-1.10.20/images/sort_asc.png +0 -0
  98. /data/coverage/assets/{0.13.1 → 0.13.2}/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
  99. /data/coverage/assets/{0.13.1 → 0.13.2}/DataTables-1.10.20/images/sort_both.png +0 -0
  100. /data/coverage/assets/{0.13.1 → 0.13.2}/DataTables-1.10.20/images/sort_desc.png +0 -0
  101. /data/coverage/assets/{0.13.1 → 0.13.2}/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
  102. /data/coverage/assets/{0.13.1 → 0.13.2}/application.css +0 -0
  103. /data/coverage/assets/{0.13.1 → 0.13.2}/application.js +0 -0
  104. /data/coverage/assets/{0.13.1 → 0.13.2}/colorbox/border.png +0 -0
  105. /data/coverage/assets/{0.13.1 → 0.13.2}/colorbox/controls.png +0 -0
  106. /data/coverage/assets/{0.13.1 → 0.13.2}/colorbox/loading.gif +0 -0
  107. /data/coverage/assets/{0.13.1 → 0.13.2}/colorbox/loading_background.png +0 -0
  108. /data/coverage/assets/{0.13.1 → 0.13.2}/favicon_green.png +0 -0
  109. /data/coverage/assets/{0.13.1 → 0.13.2}/favicon_red.png +0 -0
  110. /data/coverage/assets/{0.13.1 → 0.13.2}/favicon_yellow.png +0 -0
  111. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  112. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  113. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  114. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  115. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  116. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  117. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  118. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  119. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-icons_222222_256x240.png +0 -0
  120. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-icons_2e83ff_256x240.png +0 -0
  121. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-icons_454545_256x240.png +0 -0
  122. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-icons_888888_256x240.png +0 -0
  123. /data/coverage/assets/{0.13.1 → 0.13.2}/images/ui-icons_cd0a0a_256x240.png +0 -0
  124. /data/coverage/assets/{0.13.1 → 0.13.2}/loading.gif +0 -0
  125. /data/coverage/assets/{0.13.1 → 0.13.2}/magnify.png +0 -0
@@ -0,0 +1,323 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class BlockedWebhook
18
+ # User's account ID.
19
+ attr_accessor :account_id
20
+
21
+ # Toll-free telephone number in E.164 format.
22
+ attr_accessor :phone_number
23
+
24
+ attr_accessor :status
25
+
26
+ # Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number.
27
+ attr_accessor :internal_ticket_number
28
+
29
+ # Whether a Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked.
30
+ attr_accessor :blocked
31
+
32
+ # The reason why the Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked.
33
+ attr_accessor :blocked_reason
34
+
35
+ class EnumAttributeValidator
36
+ attr_reader :datatype
37
+ attr_reader :allowable_values
38
+
39
+ def initialize(datatype, allowable_values)
40
+ @allowable_values = allowable_values.map do |value|
41
+ case datatype.to_s
42
+ when /Integer/i
43
+ value.to_i
44
+ when /Float/i
45
+ value.to_f
46
+ else
47
+ value
48
+ end
49
+ end
50
+ end
51
+
52
+ def valid?(value)
53
+ !value || allowable_values.include?(value)
54
+ end
55
+ end
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'account_id' => :'accountId',
61
+ :'phone_number' => :'phoneNumber',
62
+ :'status' => :'status',
63
+ :'internal_ticket_number' => :'internalTicketNumber',
64
+ :'blocked' => :'blocked',
65
+ :'blocked_reason' => :'blockedReason'
66
+ }
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'account_id' => :'String',
78
+ :'phone_number' => :'String',
79
+ :'status' => :'TfvCallbackStatusEnum',
80
+ :'internal_ticket_number' => :'String',
81
+ :'blocked' => :'Boolean',
82
+ :'blocked_reason' => :'String'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BlockedWebhook` initialize method'
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!self.class.attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BlockedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'account_id')
108
+ self.account_id = attributes[:'account_id']
109
+ end
110
+
111
+ if attributes.key?(:'phone_number')
112
+ self.phone_number = attributes[:'phone_number']
113
+ end
114
+
115
+ if attributes.key?(:'status')
116
+ self.status = attributes[:'status']
117
+ end
118
+
119
+ if attributes.key?(:'internal_ticket_number')
120
+ self.internal_ticket_number = attributes[:'internal_ticket_number']
121
+ end
122
+
123
+ if attributes.key?(:'blocked')
124
+ self.blocked = attributes[:'blocked']
125
+ end
126
+
127
+ if attributes.key?(:'blocked_reason')
128
+ self.blocked_reason = attributes[:'blocked_reason']
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
136
+ invalid_properties = Array.new
137
+ if !@phone_number.nil? && @phone_number.to_s.length > 12
138
+ invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 12.')
139
+ end
140
+
141
+ if !@phone_number.nil? && @phone_number.to_s.length < 12
142
+ invalid_properties.push('invalid value for "phone_number", the character length must be great than or equal to 12.')
143
+ end
144
+
145
+ pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
146
+ if !@phone_number.nil? && @phone_number !~ pattern
147
+ invalid_properties.push("invalid value for \"phone_number\", must conform to the pattern #{pattern}.")
148
+ end
149
+
150
+ invalid_properties
151
+ end
152
+
153
+ # Check to see if the all the properties in the model are valid
154
+ # @return true if the model is valid
155
+ def valid?
156
+ warn '[DEPRECATED] the `valid?` method is obsolete'
157
+ return false if !@phone_number.nil? && @phone_number.to_s.length > 12
158
+ return false if !@phone_number.nil? && @phone_number.to_s.length < 12
159
+ return false if !@phone_number.nil? && @phone_number !~ Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
160
+ true
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] phone_number Value to be assigned
165
+ def phone_number=(phone_number)
166
+ if phone_number.nil?
167
+ fail ArgumentError, 'phone_number cannot be nil'
168
+ end
169
+
170
+ if phone_number.to_s.length > 12
171
+ fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 12.'
172
+ end
173
+
174
+ if phone_number.to_s.length < 12
175
+ fail ArgumentError, 'invalid value for "phone_number", the character length must be great than or equal to 12.'
176
+ end
177
+
178
+ pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
179
+ if phone_number !~ pattern
180
+ fail ArgumentError, "invalid value for \"phone_number\", must conform to the pattern #{pattern}."
181
+ end
182
+
183
+ @phone_number = phone_number
184
+ end
185
+
186
+ # Checks equality by comparing each attribute.
187
+ # @param [Object] Object to be compared
188
+ def ==(o)
189
+ return true if self.equal?(o)
190
+ self.class == o.class &&
191
+ account_id == o.account_id &&
192
+ phone_number == o.phone_number &&
193
+ status == o.status &&
194
+ internal_ticket_number == o.internal_ticket_number &&
195
+ blocked == o.blocked &&
196
+ blocked_reason == o.blocked_reason
197
+ end
198
+
199
+ # @see the `==` method
200
+ # @param [Object] Object to be compared
201
+ def eql?(o)
202
+ self == o
203
+ end
204
+
205
+ # Calculates hash code according to all attributes.
206
+ # @return [Integer] Hash code
207
+ def hash
208
+ [account_id, phone_number, status, internal_ticket_number, blocked, blocked_reason].hash
209
+ end
210
+
211
+ # Builds the object from hash
212
+ # @param [Hash] attributes Model attributes in the form of hash
213
+ # @return [Object] Returns the model itself
214
+ def self.build_from_hash(attributes)
215
+ return nil unless attributes.is_a?(Hash)
216
+ attributes = attributes.transform_keys(&:to_sym)
217
+ transformed_hash = {}
218
+ openapi_types.each_pair do |key, type|
219
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
220
+ transformed_hash["#{key}"] = nil
221
+ elsif type =~ /\AArray<(.*)>/i
222
+ # check to ensure the input is an array given that the attribute
223
+ # is documented as an array but the input is not
224
+ if attributes[attribute_map[key]].is_a?(Array)
225
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
226
+ end
227
+ elsif !attributes[attribute_map[key]].nil?
228
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
229
+ end
230
+ end
231
+ new(transformed_hash)
232
+ end
233
+
234
+ # Deserializes the data based on type
235
+ # @param string type Data type
236
+ # @param string value Value to be deserialized
237
+ # @return [Object] Deserialized data
238
+ def self._deserialize(type, value)
239
+ case type.to_sym
240
+ when :Time
241
+ Time.parse(value)
242
+ when :Date
243
+ Date.parse(value)
244
+ when :String
245
+ value.to_s
246
+ when :Integer
247
+ value.to_i
248
+ when :Float
249
+ value.to_f
250
+ when :Boolean
251
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
252
+ true
253
+ else
254
+ false
255
+ end
256
+ when :Object
257
+ # generic object (usually a Hash), return directly
258
+ value
259
+ when /\AArray<(?<inner_type>.+)>\z/
260
+ inner_type = Regexp.last_match[:inner_type]
261
+ value.map { |v| _deserialize(inner_type, v) }
262
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
263
+ k_type = Regexp.last_match[:k_type]
264
+ v_type = Regexp.last_match[:v_type]
265
+ {}.tap do |hash|
266
+ value.each do |k, v|
267
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
268
+ end
269
+ end
270
+ else # model
271
+ # models (e.g. Pet) or oneOf
272
+ klass = Bandwidth.const_get(type)
273
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
274
+ end
275
+ end
276
+
277
+ # Returns the string representation of the object
278
+ # @return [String] String presentation of the object
279
+ def to_s
280
+ to_hash.to_s
281
+ end
282
+
283
+ # to_body is an alias to to_hash (backward compatibility)
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_body
286
+ to_hash
287
+ end
288
+
289
+ # Returns the object in the form of hash
290
+ # @return [Hash] Returns the object in the form of hash
291
+ def to_hash
292
+ hash = {}
293
+ self.class.attribute_map.each_pair do |attr, param|
294
+ value = self.send(attr)
295
+ if value.nil?
296
+ is_nullable = self.class.openapi_nullable.include?(attr)
297
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
298
+ end
299
+
300
+ hash[param] = _to_hash(value)
301
+ end
302
+ hash
303
+ end
304
+
305
+ # Outputs non-array value in the form of hash
306
+ # For object, use to_hash. Otherwise, just return the value
307
+ # @param [Object] value Any valid value
308
+ # @return [Hash] Returns the value in the form of hash
309
+ def _to_hash(value)
310
+ if value.is_a?(Array)
311
+ value.compact.map { |v| _to_hash(v) }
312
+ elsif value.is_a?(Hash)
313
+ {}.tap do |hash|
314
+ value.each { |k, v| hash[k] = _to_hash(v) }
315
+ end
316
+ elsif value.respond_to? :to_hash
317
+ value.to_hash
318
+ else
319
+ value
320
+ end
321
+ end
322
+ end
323
+ end
@@ -0,0 +1,60 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ # Callbacks are divided into two types based on direction of the related message: - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM message. - `inboundCallback` indicates an inbound MO message or a multichannel message client's response to a suggestion or location request.
18
+ module Callback
19
+ class << self
20
+ # List of class defined in oneOf (OpenAPI v3)
21
+ def openapi_one_of
22
+ [
23
+ :'InboundCallback',
24
+ :'StatusCallback'
25
+ ]
26
+ end
27
+
28
+ # Discriminator's property name (OpenAPI v3)
29
+ def openapi_discriminator_name
30
+ :'type'
31
+ end
32
+
33
+ # Discriminator's mapping (OpenAPI v3)
34
+ def openapi_discriminator_mapping
35
+ {
36
+ :'message-delivered' => :'StatusCallback',
37
+ :'message-failed' => :'StatusCallback',
38
+ :'message-read' => :'StatusCallback',
39
+ :'message-received' => :'InboundCallback',
40
+ :'message-sent' => :'StatusCallback',
41
+ :'request-location-response' => :'InboundCallback',
42
+ :'suggestion-response' => :'InboundCallback'
43
+ }
44
+ end
45
+
46
+ # Builds the object
47
+ # @param [Mixed] Data to be matched against the list of oneOf items
48
+ # @return [Object] Returns the model or the data itself
49
+ def build(data)
50
+ discriminator_value = data[openapi_discriminator_name]
51
+ return nil if discriminator_value.nil?
52
+
53
+ klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym]
54
+ return nil unless klass
55
+
56
+ Bandwidth.const_get(klass).build_from_hash(data)
57
+ end
58
+ end
59
+ end
60
+ end
@@ -39,7 +39,7 @@ module Bandwidth
39
39
  def self.openapi_types
40
40
  {
41
41
  :'links' => :'Array<Link>',
42
- :'data' => :'MultiChannelMessageData',
42
+ :'data' => :'MultiChannelMessageResponseData',
43
43
  :'errors' => :'Array<ErrorObject>'
44
44
  }
45
45
  end
@@ -15,15 +15,20 @@ require 'time'
15
15
 
16
16
  module Bandwidth
17
17
  class ErrorObject
18
- attr_accessor :code
18
+ # A concise summary of the error used for categorization.
19
+ attr_accessor :type
19
20
 
20
- attr_accessor :message
21
+ # A detailed explanation of the error.
22
+ attr_accessor :description
23
+
24
+ attr_accessor :source
21
25
 
22
26
  # Attribute mapping from ruby-style variable name to JSON key.
23
27
  def self.attribute_map
24
28
  {
25
- :'code' => :'code',
26
- :'message' => :'message'
29
+ :'type' => :'type',
30
+ :'description' => :'description',
31
+ :'source' => :'source'
27
32
  }
28
33
  end
29
34
 
@@ -35,8 +40,9 @@ module Bandwidth
35
40
  # Attribute type mapping.
36
41
  def self.openapi_types
37
42
  {
38
- :'code' => :'String',
39
- :'message' => :'String'
43
+ :'type' => :'String',
44
+ :'description' => :'String',
45
+ :'source' => :'ErrorSource'
40
46
  }
41
47
  end
42
48
 
@@ -61,12 +67,22 @@ module Bandwidth
61
67
  h[k.to_sym] = v
62
68
  }
63
69
 
64
- if attributes.key?(:'code')
65
- self.code = attributes[:'code']
70
+ if attributes.key?(:'type')
71
+ self.type = attributes[:'type']
72
+ else
73
+ self.type = nil
74
+ end
75
+
76
+ if attributes.key?(:'description')
77
+ self.description = attributes[:'description']
78
+ else
79
+ self.description = nil
66
80
  end
67
81
 
68
- if attributes.key?(:'message')
69
- self.message = attributes[:'message']
82
+ if attributes.key?(:'source')
83
+ self.source = attributes[:'source']
84
+ else
85
+ self.source = nil
70
86
  end
71
87
  end
72
88
 
@@ -75,6 +91,18 @@ module Bandwidth
75
91
  def list_invalid_properties
76
92
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
93
  invalid_properties = Array.new
94
+ if @type.nil?
95
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
96
+ end
97
+
98
+ if @description.nil?
99
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
100
+ end
101
+
102
+ if @source.nil?
103
+ invalid_properties.push('invalid value for "source", source cannot be nil.')
104
+ end
105
+
78
106
  invalid_properties
79
107
  end
80
108
 
@@ -82,6 +110,9 @@ module Bandwidth
82
110
  # @return true if the model is valid
83
111
  def valid?
84
112
  warn '[DEPRECATED] the `valid?` method is obsolete'
113
+ return false if @type.nil?
114
+ return false if @description.nil?
115
+ return false if @source.nil?
85
116
  true
86
117
  end
87
118
 
@@ -90,8 +121,9 @@ module Bandwidth
90
121
  def ==(o)
91
122
  return true if self.equal?(o)
92
123
  self.class == o.class &&
93
- code == o.code &&
94
- message == o.message
124
+ type == o.type &&
125
+ description == o.description &&
126
+ source == o.source
95
127
  end
96
128
 
97
129
  # @see the `==` method
@@ -103,7 +135,7 @@ module Bandwidth
103
135
  # Calculates hash code according to all attributes.
104
136
  # @return [Integer] Hash code
105
137
  def hash
106
- [code, message].hash
138
+ [type, description, source].hash
107
139
  end
108
140
 
109
141
  # Builds the object from hash