bandwidth-sdk 15.1.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 +11 -11
  3. data/README.md +17 -10
  4. data/bandwidth.yml +523 -184
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +321 -366
  7. data/coverage/index.html +10047 -10501
  8. data/custom_templates/README.mustache +1 -1
  9. data/docs/BlockedWebhook.md +2 -2
  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 +3 -3
  39. data/docs/TollFreeVerificationApi.md +72 -0
  40. data/docs/VerificationDenialWebhook.md +2 -2
  41. data/docs/VerificationRequest.md +3 -3
  42. data/docs/VerificationUpdateRequest.md +3 -3
  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 +2 -2
  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 +3 -3
  75. data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +2 -2
  76. data/lib/bandwidth-sdk/models/verification_request.rb +3 -3
  77. data/lib/bandwidth-sdk/models/verification_update_request.rb +3 -3
  78. data/lib/bandwidth-sdk/version.rb +1 -1
  79. data/lib/bandwidth-sdk.rb +15 -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 -100
  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,372 @@
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
+ # The data returned in a multichannel message response.
18
+ class MultiChannelMessageResponseData
19
+ # The ID of the message.
20
+ attr_accessor :message_id
21
+
22
+ # The time the message was received by the Bandwidth API.
23
+ attr_accessor :time
24
+
25
+ attr_accessor :direction
26
+
27
+ # The destination phone number(s) of the message, in E164 format.
28
+ attr_accessor :to
29
+
30
+ # A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored.
31
+ attr_accessor :channel_list
32
+
33
+ # A custom string that will be included in callback events of the message. Max 1024 characters.
34
+ attr_accessor :tag
35
+
36
+ attr_accessor :priority
37
+
38
+ # A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future.
39
+ attr_accessor :expiration
40
+
41
+ class EnumAttributeValidator
42
+ attr_reader :datatype
43
+ attr_reader :allowable_values
44
+
45
+ def initialize(datatype, allowable_values)
46
+ @allowable_values = allowable_values.map do |value|
47
+ case datatype.to_s
48
+ when /Integer/i
49
+ value.to_i
50
+ when /Float/i
51
+ value.to_f
52
+ else
53
+ value
54
+ end
55
+ end
56
+ end
57
+
58
+ def valid?(value)
59
+ !value || allowable_values.include?(value)
60
+ end
61
+ end
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'message_id' => :'messageId',
67
+ :'time' => :'time',
68
+ :'direction' => :'direction',
69
+ :'to' => :'to',
70
+ :'channel_list' => :'channelList',
71
+ :'tag' => :'tag',
72
+ :'priority' => :'priority',
73
+ :'expiration' => :'expiration'
74
+ }
75
+ end
76
+
77
+ # Returns all the JSON keys this model knows about
78
+ def self.acceptable_attributes
79
+ attribute_map.values
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.openapi_types
84
+ {
85
+ :'message_id' => :'String',
86
+ :'time' => :'Time',
87
+ :'direction' => :'MessageDirectionEnum',
88
+ :'to' => :'Array<String>',
89
+ :'channel_list' => :'Array<MultiChannelMessageResponseDataChannelListInner>',
90
+ :'tag' => :'String',
91
+ :'priority' => :'PriorityEnum',
92
+ :'expiration' => :'Time'
93
+ }
94
+ end
95
+
96
+ # List of attributes with nullable: true
97
+ def self.openapi_nullable
98
+ Set.new([
99
+ ])
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ if (!attributes.is_a?(Hash))
106
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelMessageResponseData` initialize method'
107
+ end
108
+
109
+ # check to see if the attribute exists and convert string to symbol for hash key
110
+ attributes = attributes.each_with_object({}) { |(k, v), h|
111
+ if (!self.class.attribute_map.key?(k.to_sym))
112
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelMessageResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
113
+ end
114
+ h[k.to_sym] = v
115
+ }
116
+
117
+ if attributes.key?(:'message_id')
118
+ self.message_id = attributes[:'message_id']
119
+ else
120
+ self.message_id = nil
121
+ end
122
+
123
+ if attributes.key?(:'time')
124
+ self.time = attributes[:'time']
125
+ else
126
+ self.time = nil
127
+ end
128
+
129
+ if attributes.key?(:'direction')
130
+ self.direction = attributes[:'direction']
131
+ else
132
+ self.direction = nil
133
+ end
134
+
135
+ if attributes.key?(:'to')
136
+ if (value = attributes[:'to']).is_a?(Array)
137
+ self.to = value
138
+ end
139
+ else
140
+ self.to = nil
141
+ end
142
+
143
+ if attributes.key?(:'channel_list')
144
+ if (value = attributes[:'channel_list']).is_a?(Array)
145
+ self.channel_list = value
146
+ end
147
+ else
148
+ self.channel_list = nil
149
+ end
150
+
151
+ if attributes.key?(:'tag')
152
+ self.tag = attributes[:'tag']
153
+ end
154
+
155
+ if attributes.key?(:'priority')
156
+ self.priority = attributes[:'priority']
157
+ end
158
+
159
+ if attributes.key?(:'expiration')
160
+ self.expiration = attributes[:'expiration']
161
+ end
162
+ end
163
+
164
+ # Show invalid properties with the reasons. Usually used together with valid?
165
+ # @return Array for valid properties with the reasons
166
+ def list_invalid_properties
167
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
168
+ invalid_properties = Array.new
169
+ if @message_id.nil?
170
+ invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
171
+ end
172
+
173
+ if @time.nil?
174
+ invalid_properties.push('invalid value for "time", time cannot be nil.')
175
+ end
176
+
177
+ if @direction.nil?
178
+ invalid_properties.push('invalid value for "direction", direction cannot be nil.')
179
+ end
180
+
181
+ if @to.nil?
182
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
183
+ end
184
+
185
+ if @channel_list.nil?
186
+ invalid_properties.push('invalid value for "channel_list", channel_list cannot be nil.')
187
+ end
188
+
189
+ if @channel_list.length > 4
190
+ invalid_properties.push('invalid value for "channel_list", number of items must be less than or equal to 4.')
191
+ end
192
+
193
+ invalid_properties
194
+ end
195
+
196
+ # Check to see if the all the properties in the model are valid
197
+ # @return true if the model is valid
198
+ def valid?
199
+ warn '[DEPRECATED] the `valid?` method is obsolete'
200
+ return false if @message_id.nil?
201
+ return false if @time.nil?
202
+ return false if @direction.nil?
203
+ return false if @to.nil?
204
+ return false if @channel_list.nil?
205
+ return false if @channel_list.length > 4
206
+ true
207
+ end
208
+
209
+ # Custom attribute writer method with validation
210
+ # @param [Object] to Value to be assigned
211
+ def to=(to)
212
+ if to.nil?
213
+ fail ArgumentError, 'to cannot be nil'
214
+ end
215
+
216
+ @to = to
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] channel_list Value to be assigned
221
+ def channel_list=(channel_list)
222
+ if channel_list.nil?
223
+ fail ArgumentError, 'channel_list cannot be nil'
224
+ end
225
+
226
+ if channel_list.length > 4
227
+ fail ArgumentError, 'invalid value for "channel_list", number of items must be less than or equal to 4.'
228
+ end
229
+
230
+ @channel_list = channel_list
231
+ end
232
+
233
+ # Checks equality by comparing each attribute.
234
+ # @param [Object] Object to be compared
235
+ def ==(o)
236
+ return true if self.equal?(o)
237
+ self.class == o.class &&
238
+ message_id == o.message_id &&
239
+ time == o.time &&
240
+ direction == o.direction &&
241
+ to == o.to &&
242
+ channel_list == o.channel_list &&
243
+ tag == o.tag &&
244
+ priority == o.priority &&
245
+ expiration == o.expiration
246
+ end
247
+
248
+ # @see the `==` method
249
+ # @param [Object] Object to be compared
250
+ def eql?(o)
251
+ self == o
252
+ end
253
+
254
+ # Calculates hash code according to all attributes.
255
+ # @return [Integer] Hash code
256
+ def hash
257
+ [message_id, time, direction, to, channel_list, tag, priority, expiration].hash
258
+ end
259
+
260
+ # Builds the object from hash
261
+ # @param [Hash] attributes Model attributes in the form of hash
262
+ # @return [Object] Returns the model itself
263
+ def self.build_from_hash(attributes)
264
+ return nil unless attributes.is_a?(Hash)
265
+ attributes = attributes.transform_keys(&:to_sym)
266
+ transformed_hash = {}
267
+ openapi_types.each_pair do |key, type|
268
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
269
+ transformed_hash["#{key}"] = nil
270
+ elsif type =~ /\AArray<(.*)>/i
271
+ # check to ensure the input is an array given that the attribute
272
+ # is documented as an array but the input is not
273
+ if attributes[attribute_map[key]].is_a?(Array)
274
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
275
+ end
276
+ elsif !attributes[attribute_map[key]].nil?
277
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
278
+ end
279
+ end
280
+ new(transformed_hash)
281
+ end
282
+
283
+ # Deserializes the data based on type
284
+ # @param string type Data type
285
+ # @param string value Value to be deserialized
286
+ # @return [Object] Deserialized data
287
+ def self._deserialize(type, value)
288
+ case type.to_sym
289
+ when :Time
290
+ Time.parse(value)
291
+ when :Date
292
+ Date.parse(value)
293
+ when :String
294
+ value.to_s
295
+ when :Integer
296
+ value.to_i
297
+ when :Float
298
+ value.to_f
299
+ when :Boolean
300
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
301
+ true
302
+ else
303
+ false
304
+ end
305
+ when :Object
306
+ # generic object (usually a Hash), return directly
307
+ value
308
+ when /\AArray<(?<inner_type>.+)>\z/
309
+ inner_type = Regexp.last_match[:inner_type]
310
+ value.map { |v| _deserialize(inner_type, v) }
311
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
312
+ k_type = Regexp.last_match[:k_type]
313
+ v_type = Regexp.last_match[:v_type]
314
+ {}.tap do |hash|
315
+ value.each do |k, v|
316
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
317
+ end
318
+ end
319
+ else # model
320
+ # models (e.g. Pet) or oneOf
321
+ klass = Bandwidth.const_get(type)
322
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
323
+ end
324
+ end
325
+
326
+ # Returns the string representation of the object
327
+ # @return [String] String presentation of the object
328
+ def to_s
329
+ to_hash.to_s
330
+ end
331
+
332
+ # to_body is an alias to to_hash (backward compatibility)
333
+ # @return [Hash] Returns the object in the form of hash
334
+ def to_body
335
+ to_hash
336
+ end
337
+
338
+ # Returns the object in the form of hash
339
+ # @return [Hash] Returns the object in the form of hash
340
+ def to_hash
341
+ hash = {}
342
+ self.class.attribute_map.each_pair do |attr, param|
343
+ value = self.send(attr)
344
+ if value.nil?
345
+ is_nullable = self.class.openapi_nullable.include?(attr)
346
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
347
+ end
348
+
349
+ hash[param] = _to_hash(value)
350
+ end
351
+ hash
352
+ end
353
+
354
+ # Outputs non-array value in the form of hash
355
+ # For object, use to_hash. Otherwise, just return the value
356
+ # @param [Object] value Any valid value
357
+ # @return [Hash] Returns the value in the form of hash
358
+ def _to_hash(value)
359
+ if value.is_a?(Array)
360
+ value.compact.map { |v| _to_hash(v) }
361
+ elsif value.is_a?(Hash)
362
+ {}.tap do |hash|
363
+ value.each { |k, v| hash[k] = _to_hash(v) }
364
+ end
365
+ elsif value.respond_to? :to_hash
366
+ value.to_hash
367
+ else
368
+ value
369
+ end
370
+ end
371
+ end
372
+ end
@@ -14,30 +14,19 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Bandwidth
17
- class MultiChannelMessageData
18
- # The ID of the message.
19
- attr_accessor :message_id
20
-
21
- attr_accessor :status
22
-
23
- # The time the message was received by the Bandwidth API.
24
- attr_accessor :time
25
-
26
- attr_accessor :direction
27
-
17
+ class MultiChannelMessageResponseDataChannelListInner
28
18
  # The sender ID of the message. This could be an alphanumeric sender ID.
29
19
  attr_accessor :from
30
20
 
31
- # The phone number the message should be sent to in E164 format.
32
- attr_accessor :to
33
-
34
21
  # The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.
35
22
  attr_accessor :application_id
36
23
 
37
24
  attr_accessor :channel
38
25
 
39
- # A custom string that will be included in callback events of the message. Max 1024 characters.
40
- attr_accessor :tag
26
+ attr_accessor :content
27
+
28
+ # The Bandwidth senderId associated with the message. Identical to 'from'.
29
+ attr_accessor :owner
41
30
 
42
31
  class EnumAttributeValidator
43
32
  attr_reader :datatype
@@ -64,15 +53,11 @@ module Bandwidth
64
53
  # Attribute mapping from ruby-style variable name to JSON key.
65
54
  def self.attribute_map
66
55
  {
67
- :'message_id' => :'messageId',
68
- :'status' => :'status',
69
- :'time' => :'time',
70
- :'direction' => :'direction',
71
56
  :'from' => :'from',
72
- :'to' => :'to',
73
57
  :'application_id' => :'applicationId',
74
58
  :'channel' => :'channel',
75
- :'tag' => :'tag'
59
+ :'content' => :'content',
60
+ :'owner' => :'owner'
76
61
  }
77
62
  end
78
63
 
@@ -84,15 +69,11 @@ module Bandwidth
84
69
  # Attribute type mapping.
85
70
  def self.openapi_types
86
71
  {
87
- :'message_id' => :'String',
88
- :'status' => :'MultiChannelStatusEnum',
89
- :'time' => :'Time',
90
- :'direction' => :'MultiChannelMessageDirectionEnum',
91
72
  :'from' => :'String',
92
- :'to' => :'String',
93
73
  :'application_id' => :'String',
94
74
  :'channel' => :'MultiChannelMessageChannelEnum',
95
- :'tag' => :'String'
75
+ :'content' => :'MultiChannelChannelListObjectContent',
76
+ :'owner' => :'String'
96
77
  }
97
78
  end
98
79
 
@@ -102,55 +83,56 @@ module Bandwidth
102
83
  ])
103
84
  end
104
85
 
86
+ # List of class defined in allOf (OpenAPI v3)
87
+ def self.openapi_all_of
88
+ [
89
+ :'MultiChannelChannelListObject'
90
+ ]
91
+ end
92
+
105
93
  # Initializes the object
106
94
  # @param [Hash] attributes Model attributes in the form of hash
107
95
  def initialize(attributes = {})
108
96
  if (!attributes.is_a?(Hash))
109
- fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelMessageData` initialize method'
97
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelMessageResponseDataChannelListInner` initialize method'
110
98
  end
111
99
 
112
100
  # check to see if the attribute exists and convert string to symbol for hash key
113
101
  attributes = attributes.each_with_object({}) { |(k, v), h|
114
102
  if (!self.class.attribute_map.key?(k.to_sym))
115
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelMessageData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelMessageResponseDataChannelListInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
116
104
  end
117
105
  h[k.to_sym] = v
118
106
  }
119
107
 
120
- if attributes.key?(:'message_id')
121
- self.message_id = attributes[:'message_id']
122
- end
123
-
124
- if attributes.key?(:'status')
125
- self.status = attributes[:'status']
126
- end
127
-
128
- if attributes.key?(:'time')
129
- self.time = attributes[:'time']
130
- end
131
-
132
- if attributes.key?(:'direction')
133
- self.direction = attributes[:'direction']
134
- end
135
-
136
108
  if attributes.key?(:'from')
137
109
  self.from = attributes[:'from']
138
- end
139
-
140
- if attributes.key?(:'to')
141
- self.to = attributes[:'to']
110
+ else
111
+ self.from = nil
142
112
  end
143
113
 
144
114
  if attributes.key?(:'application_id')
145
115
  self.application_id = attributes[:'application_id']
116
+ else
117
+ self.application_id = nil
146
118
  end
147
119
 
148
120
  if attributes.key?(:'channel')
149
121
  self.channel = attributes[:'channel']
122
+ else
123
+ self.channel = nil
150
124
  end
151
125
 
152
- if attributes.key?(:'tag')
153
- self.tag = attributes[:'tag']
126
+ if attributes.key?(:'content')
127
+ self.content = attributes[:'content']
128
+ else
129
+ self.content = nil
130
+ end
131
+
132
+ if attributes.key?(:'owner')
133
+ self.owner = attributes[:'owner']
134
+ else
135
+ self.owner = nil
154
136
  end
155
137
  end
156
138
 
@@ -159,6 +141,26 @@ module Bandwidth
159
141
  def list_invalid_properties
160
142
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
161
143
  invalid_properties = Array.new
144
+ if @from.nil?
145
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
146
+ end
147
+
148
+ if @application_id.nil?
149
+ invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
150
+ end
151
+
152
+ if @channel.nil?
153
+ invalid_properties.push('invalid value for "channel", channel cannot be nil.')
154
+ end
155
+
156
+ if @content.nil?
157
+ invalid_properties.push('invalid value for "content", content cannot be nil.')
158
+ end
159
+
160
+ if @owner.nil?
161
+ invalid_properties.push('invalid value for "owner", owner cannot be nil.')
162
+ end
163
+
162
164
  invalid_properties
163
165
  end
164
166
 
@@ -166,6 +168,11 @@ module Bandwidth
166
168
  # @return true if the model is valid
167
169
  def valid?
168
170
  warn '[DEPRECATED] the `valid?` method is obsolete'
171
+ return false if @from.nil?
172
+ return false if @application_id.nil?
173
+ return false if @channel.nil?
174
+ return false if @content.nil?
175
+ return false if @owner.nil?
169
176
  true
170
177
  end
171
178
 
@@ -174,15 +181,11 @@ module Bandwidth
174
181
  def ==(o)
175
182
  return true if self.equal?(o)
176
183
  self.class == o.class &&
177
- message_id == o.message_id &&
178
- status == o.status &&
179
- time == o.time &&
180
- direction == o.direction &&
181
184
  from == o.from &&
182
- to == o.to &&
183
185
  application_id == o.application_id &&
184
186
  channel == o.channel &&
185
- tag == o.tag
187
+ content == o.content &&
188
+ owner == o.owner
186
189
  end
187
190
 
188
191
  # @see the `==` method
@@ -194,7 +197,7 @@ module Bandwidth
194
197
  # Calculates hash code according to all attributes.
195
198
  # @return [Integer] Hash code
196
199
  def hash
197
- [message_id, status, time, direction, from, to, application_id, channel, tag].hash
200
+ [from, application_id, channel, content, owner].hash
198
201
  end
199
202
 
200
203
  # Builds the object from hash
@@ -21,7 +21,7 @@ module Bandwidth
21
21
  attr_accessor :text
22
22
 
23
23
  # Base64 payload the customer receives when the reply is clicked.
24
- attr_accessor :post_back_data
24
+ attr_accessor :postback_data
25
25
 
26
26
  class EnumAttributeValidator
27
27
  attr_reader :datatype
@@ -50,7 +50,7 @@ module Bandwidth
50
50
  {
51
51
  :'type' => :'type',
52
52
  :'text' => :'text',
53
- :'post_back_data' => :'postBackData'
53
+ :'postback_data' => :'postbackData'
54
54
  }
55
55
  end
56
56
 
@@ -64,7 +64,7 @@ module Bandwidth
64
64
  {
65
65
  :'type' => :'RbmActionTypeEnum',
66
66
  :'text' => :'String',
67
- :'post_back_data' => :'String'
67
+ :'postback_data' => :'String'
68
68
  }
69
69
  end
70
70
 
@@ -101,10 +101,10 @@ module Bandwidth
101
101
  self.text = nil
102
102
  end
103
103
 
104
- if attributes.key?(:'post_back_data')
105
- self.post_back_data = attributes[:'post_back_data']
104
+ if attributes.key?(:'postback_data')
105
+ self.postback_data = attributes[:'postback_data']
106
106
  else
107
- self.post_back_data = nil
107
+ self.postback_data = nil
108
108
  end
109
109
  end
110
110
 
@@ -125,12 +125,12 @@ module Bandwidth
125
125
  invalid_properties.push('invalid value for "text", the character length must be smaller than or equal to 25.')
126
126
  end
127
127
 
128
- if @post_back_data.nil?
129
- invalid_properties.push('invalid value for "post_back_data", post_back_data cannot be nil.')
128
+ if @postback_data.nil?
129
+ invalid_properties.push('invalid value for "postback_data", postback_data cannot be nil.')
130
130
  end
131
131
 
132
- if @post_back_data.to_s.length > 2048
133
- invalid_properties.push('invalid value for "post_back_data", the character length must be smaller than or equal to 2048.')
132
+ if @postback_data.to_s.length > 2048
133
+ invalid_properties.push('invalid value for "postback_data", the character length must be smaller than or equal to 2048.')
134
134
  end
135
135
 
136
136
  invalid_properties
@@ -143,8 +143,8 @@ module Bandwidth
143
143
  return false if @type.nil?
144
144
  return false if @text.nil?
145
145
  return false if @text.to_s.length > 25
146
- return false if @post_back_data.nil?
147
- return false if @post_back_data.to_s.length > 2048
146
+ return false if @postback_data.nil?
147
+ return false if @postback_data.to_s.length > 2048
148
148
  true
149
149
  end
150
150
 
@@ -163,17 +163,17 @@ module Bandwidth
163
163
  end
164
164
 
165
165
  # Custom attribute writer method with validation
166
- # @param [Object] post_back_data Value to be assigned
167
- def post_back_data=(post_back_data)
168
- if post_back_data.nil?
169
- fail ArgumentError, 'post_back_data cannot be nil'
166
+ # @param [Object] postback_data Value to be assigned
167
+ def postback_data=(postback_data)
168
+ if postback_data.nil?
169
+ fail ArgumentError, 'postback_data cannot be nil'
170
170
  end
171
171
 
172
- if post_back_data.to_s.length > 2048
173
- fail ArgumentError, 'invalid value for "post_back_data", the character length must be smaller than or equal to 2048.'
172
+ if postback_data.to_s.length > 2048
173
+ fail ArgumentError, 'invalid value for "postback_data", the character length must be smaller than or equal to 2048.'
174
174
  end
175
175
 
176
- @post_back_data = post_back_data
176
+ @postback_data = postback_data
177
177
  end
178
178
 
179
179
  # Checks equality by comparing each attribute.
@@ -183,7 +183,7 @@ module Bandwidth
183
183
  self.class == o.class &&
184
184
  type == o.type &&
185
185
  text == o.text &&
186
- post_back_data == o.post_back_data
186
+ postback_data == o.postback_data
187
187
  end
188
188
 
189
189
  # @see the `==` method
@@ -195,7 +195,7 @@ module Bandwidth
195
195
  # Calculates hash code according to all attributes.
196
196
  # @return [Integer] Hash code
197
197
  def hash
198
- [type, text, post_back_data].hash
198
+ [type, text, postback_data].hash
199
199
  end
200
200
 
201
201
  # Builds the object from hash