bandwidth-sdk 14.1.2 → 15.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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +18 -16
  3. data/README.md +34 -1
  4. data/bandwidth.yml +675 -101
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +210 -6
  7. data/coverage/index.html +14901 -12699
  8. data/docs/Address.md +1 -1
  9. data/docs/CallsApi.md +1 -1
  10. data/docs/CardWidthEnum.md +15 -0
  11. data/docs/ConferencesApi.md +1 -1
  12. data/docs/CreateMultiChannelMessageResponse.md +22 -0
  13. data/docs/ErrorObject.md +20 -0
  14. data/docs/Link.md +20 -0
  15. data/docs/Message.md +1 -1
  16. data/docs/MessageCallback.md +3 -1
  17. data/docs/MessageRequest.md +1 -1
  18. data/docs/MmsMessageContent.md +20 -0
  19. data/docs/MultiChannelAction.md +89 -0
  20. data/docs/MultiChannelActionCalendarEvent.md +30 -0
  21. data/docs/MultiChannelApi.md +80 -0
  22. data/docs/MultiChannelCallbackData.md +26 -0
  23. data/docs/MultiChannelChannelListObject.md +24 -0
  24. data/docs/MultiChannelChannelListObjectContent.md +55 -0
  25. data/docs/MultiChannelMessageCallbackData.md +32 -0
  26. data/docs/MultiChannelMessageChannelEnum.md +15 -0
  27. data/docs/MultiChannelMessageData.md +34 -0
  28. data/docs/MultiChannelMessageDirectionEnum.md +15 -0
  29. data/docs/MultiChannelMessageRequest.md +26 -0
  30. data/docs/MultiChannelStatusEnum.md +15 -0
  31. data/docs/RbmActionBase.md +22 -0
  32. data/docs/RbmActionDial.md +24 -0
  33. data/docs/RbmActionOpenUrl.md +24 -0
  34. data/docs/RbmActionTypeEnum.md +15 -0
  35. data/docs/RbmActionViewLocation.md +28 -0
  36. data/docs/RbmCardContent.md +24 -0
  37. data/docs/RbmCardContentMedia.md +22 -0
  38. data/docs/RbmMediaHeightEnum.md +15 -0
  39. data/docs/RbmMessageCarouselCard.md +22 -0
  40. data/docs/RbmMessageContentFile.md +20 -0
  41. data/docs/RbmMessageContentRichCard.md +49 -0
  42. data/docs/RbmMessageContentText.md +20 -0
  43. data/docs/RbmMessageMedia.md +20 -0
  44. data/docs/RbmStandaloneCard.md +24 -0
  45. data/docs/SmsMessageContent.md +18 -0
  46. data/docs/StandaloneCardOrientationEnum.md +15 -0
  47. data/docs/TfvBasicAuthentication.md +2 -2
  48. data/docs/TfvStatus.md +5 -1
  49. data/docs/TfvSubmissionInfo.md +7 -1
  50. data/docs/ThumbnailAlignmentEnum.md +15 -0
  51. data/docs/TollFreeVerificationApi.md +1 -1
  52. data/docs/VerificationDenialWebhook.md +5 -1
  53. data/docs/VerificationRequest.md +10 -4
  54. data/docs/VerificationUpdateRequest.md +10 -4
  55. data/lib/bandwidth-sdk/api/multi_channel_api.rb +96 -0
  56. data/lib/bandwidth-sdk/configuration.rb +6 -0
  57. data/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb +1 -0
  58. data/lib/bandwidth-sdk/models/card_width_enum.rb +40 -0
  59. data/lib/bandwidth-sdk/models/create_multi_channel_message_response.rb +234 -0
  60. data/lib/bandwidth-sdk/models/error_object.rb +221 -0
  61. data/lib/bandwidth-sdk/models/link.rb +221 -0
  62. data/lib/bandwidth-sdk/models/message.rb +1 -1
  63. data/lib/bandwidth-sdk/models/message_callback.rb +16 -5
  64. data/lib/bandwidth-sdk/models/message_request.rb +1 -1
  65. data/lib/bandwidth-sdk/models/mms_message_content.rb +244 -0
  66. data/lib/bandwidth-sdk/models/multi_channel_action.rb +61 -0
  67. data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +419 -0
  68. data/lib/bandwidth-sdk/models/multi_channel_callback_data.rb +272 -0
  69. data/lib/bandwidth-sdk/models/multi_channel_channel_list_object.rb +291 -0
  70. data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_content.rb +108 -0
  71. data/lib/bandwidth-sdk/models/multi_channel_message_callback_data.rb +302 -0
  72. data/lib/bandwidth-sdk/models/multi_channel_message_channel_enum.rb +41 -0
  73. data/lib/bandwidth-sdk/models/multi_channel_message_data.rb +312 -0
  74. data/lib/bandwidth-sdk/models/multi_channel_message_direction_enum.rb +40 -0
  75. data/lib/bandwidth-sdk/models/multi_channel_message_request.rb +310 -0
  76. data/lib/bandwidth-sdk/models/multi_channel_status_enum.rb +42 -0
  77. data/lib/bandwidth-sdk/models/rbm_action_base.rb +313 -0
  78. data/lib/bandwidth-sdk/models/rbm_action_dial.rb +337 -0
  79. data/lib/bandwidth-sdk/models/rbm_action_open_url.rb +356 -0
  80. data/lib/bandwidth-sdk/models/rbm_action_type_enum.rb +44 -0
  81. data/lib/bandwidth-sdk/models/rbm_action_view_location.rb +383 -0
  82. data/lib/bandwidth-sdk/models/rbm_card_content.rb +301 -0
  83. data/lib/bandwidth-sdk/models/rbm_card_content_media.rb +313 -0
  84. data/lib/bandwidth-sdk/models/rbm_media_height_enum.rb +41 -0
  85. data/lib/bandwidth-sdk/models/rbm_message_carousel_card.rb +309 -0
  86. data/lib/bandwidth-sdk/models/rbm_message_content_file.rb +268 -0
  87. data/lib/bandwidth-sdk/models/rbm_message_content_rich_card.rb +104 -0
  88. data/lib/bandwidth-sdk/models/rbm_message_content_text.rb +270 -0
  89. data/lib/bandwidth-sdk/models/rbm_message_media.rb +250 -0
  90. data/lib/bandwidth-sdk/models/rbm_standalone_card.rb +304 -0
  91. data/lib/bandwidth-sdk/models/sms_message_content.rb +239 -0
  92. data/lib/bandwidth-sdk/models/standalone_card_orientation_enum.rb +40 -0
  93. data/lib/bandwidth-sdk/models/tfv_status.rb +24 -4
  94. data/lib/bandwidth-sdk/models/tfv_status_enum.rb +1 -3
  95. data/lib/bandwidth-sdk/models/tfv_submission_info.rb +35 -5
  96. data/lib/bandwidth-sdk/models/thumbnail_alignment_enum.rb +40 -0
  97. data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +24 -4
  98. data/lib/bandwidth-sdk/models/verification_request.rb +45 -15
  99. data/lib/bandwidth-sdk/models/verification_update_request.rb +35 -5
  100. data/lib/bandwidth-sdk/version.rb +1 -1
  101. data/lib/bandwidth-sdk.rb +34 -1
  102. data/spec/smoke/conferences_api_spec.rb +4 -4
  103. data/spec/smoke/multi_channel_api_spec.rb +40 -0
  104. data/spec/smoke/transcriptions_api_spec.rb +1 -1
  105. data/spec/unit/api/multi_channel_api_spec.rb +59 -0
  106. data/spec/unit/models/bxml/verbs/phone_number_spec.rb +6 -4
  107. metadata +117 -45
@@ -0,0 +1,356 @@
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 RbmActionOpenUrl
18
+ attr_accessor :type
19
+
20
+ # Displayed text for user to click
21
+ attr_accessor :text
22
+
23
+ # Base64 payload the customer receives when the reply is clicked.
24
+ attr_accessor :post_back_data
25
+
26
+ # The URL to open in browser.
27
+ attr_accessor :url
28
+
29
+ class EnumAttributeValidator
30
+ attr_reader :datatype
31
+ attr_reader :allowable_values
32
+
33
+ def initialize(datatype, allowable_values)
34
+ @allowable_values = allowable_values.map do |value|
35
+ case datatype.to_s
36
+ when /Integer/i
37
+ value.to_i
38
+ when /Float/i
39
+ value.to_f
40
+ else
41
+ value
42
+ end
43
+ end
44
+ end
45
+
46
+ def valid?(value)
47
+ !value || allowable_values.include?(value)
48
+ end
49
+ end
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'type' => :'type',
55
+ :'text' => :'text',
56
+ :'post_back_data' => :'postBackData',
57
+ :'url' => :'url'
58
+ }
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'type' => :'RbmActionTypeEnum',
70
+ :'text' => :'String',
71
+ :'post_back_data' => :'String',
72
+ :'url' => :'String'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # List of class defined in allOf (OpenAPI v3)
83
+ def self.openapi_all_of
84
+ [
85
+ :'RbmActionBase'
86
+ ]
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ if (!attributes.is_a?(Hash))
93
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::RbmActionOpenUrl` initialize method'
94
+ end
95
+
96
+ # check to see if the attribute exists and convert string to symbol for hash key
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!self.class.attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmActionOpenUrl`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'type')
105
+ self.type = attributes[:'type']
106
+ else
107
+ self.type = nil
108
+ end
109
+
110
+ if attributes.key?(:'text')
111
+ self.text = attributes[:'text']
112
+ else
113
+ self.text = nil
114
+ end
115
+
116
+ if attributes.key?(:'post_back_data')
117
+ self.post_back_data = attributes[:'post_back_data']
118
+ else
119
+ self.post_back_data = nil
120
+ end
121
+
122
+ if attributes.key?(:'url')
123
+ self.url = attributes[:'url']
124
+ else
125
+ self.url = nil
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ if @type.nil?
135
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
136
+ end
137
+
138
+ if @text.nil?
139
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
140
+ end
141
+
142
+ if @text.to_s.length > 25
143
+ invalid_properties.push('invalid value for "text", the character length must be smaller than or equal to 25.')
144
+ end
145
+
146
+ if @post_back_data.nil?
147
+ invalid_properties.push('invalid value for "post_back_data", post_back_data cannot be nil.')
148
+ end
149
+
150
+ if @post_back_data.to_s.length > 2048
151
+ invalid_properties.push('invalid value for "post_back_data", the character length must be smaller than or equal to 2048.')
152
+ end
153
+
154
+ if @url.nil?
155
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
156
+ end
157
+
158
+ if @url.to_s.length > 2048
159
+ invalid_properties.push('invalid value for "url", the character length must be smaller than or equal to 2048.')
160
+ end
161
+
162
+ invalid_properties
163
+ end
164
+
165
+ # Check to see if the all the properties in the model are valid
166
+ # @return true if the model is valid
167
+ def valid?
168
+ warn '[DEPRECATED] the `valid?` method is obsolete'
169
+ return false if @type.nil?
170
+ return false if @text.nil?
171
+ return false if @text.to_s.length > 25
172
+ return false if @post_back_data.nil?
173
+ return false if @post_back_data.to_s.length > 2048
174
+ return false if @url.nil?
175
+ return false if @url.to_s.length > 2048
176
+ true
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] text Value to be assigned
181
+ def text=(text)
182
+ if text.nil?
183
+ fail ArgumentError, 'text cannot be nil'
184
+ end
185
+
186
+ if text.to_s.length > 25
187
+ fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 25.'
188
+ end
189
+
190
+ @text = text
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] post_back_data Value to be assigned
195
+ def post_back_data=(post_back_data)
196
+ if post_back_data.nil?
197
+ fail ArgumentError, 'post_back_data cannot be nil'
198
+ end
199
+
200
+ if post_back_data.to_s.length > 2048
201
+ fail ArgumentError, 'invalid value for "post_back_data", the character length must be smaller than or equal to 2048.'
202
+ end
203
+
204
+ @post_back_data = post_back_data
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] url Value to be assigned
209
+ def url=(url)
210
+ if url.nil?
211
+ fail ArgumentError, 'url cannot be nil'
212
+ end
213
+
214
+ if url.to_s.length > 2048
215
+ fail ArgumentError, 'invalid value for "url", the character length must be smaller than or equal to 2048.'
216
+ end
217
+
218
+ @url = url
219
+ end
220
+
221
+ # Checks equality by comparing each attribute.
222
+ # @param [Object] Object to be compared
223
+ def ==(o)
224
+ return true if self.equal?(o)
225
+ self.class == o.class &&
226
+ type == o.type &&
227
+ text == o.text &&
228
+ post_back_data == o.post_back_data &&
229
+ url == o.url
230
+ end
231
+
232
+ # @see the `==` method
233
+ # @param [Object] Object to be compared
234
+ def eql?(o)
235
+ self == o
236
+ end
237
+
238
+ # Calculates hash code according to all attributes.
239
+ # @return [Integer] Hash code
240
+ def hash
241
+ [type, text, post_back_data, url].hash
242
+ end
243
+
244
+ # Builds the object from hash
245
+ # @param [Hash] attributes Model attributes in the form of hash
246
+ # @return [Object] Returns the model itself
247
+ def self.build_from_hash(attributes)
248
+ return nil unless attributes.is_a?(Hash)
249
+ attributes = attributes.transform_keys(&:to_sym)
250
+ transformed_hash = {}
251
+ openapi_types.each_pair do |key, type|
252
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
253
+ transformed_hash["#{key}"] = nil
254
+ elsif type =~ /\AArray<(.*)>/i
255
+ # check to ensure the input is an array given that the attribute
256
+ # is documented as an array but the input is not
257
+ if attributes[attribute_map[key]].is_a?(Array)
258
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
259
+ end
260
+ elsif !attributes[attribute_map[key]].nil?
261
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
262
+ end
263
+ end
264
+ new(transformed_hash)
265
+ end
266
+
267
+ # Deserializes the data based on type
268
+ # @param string type Data type
269
+ # @param string value Value to be deserialized
270
+ # @return [Object] Deserialized data
271
+ def self._deserialize(type, value)
272
+ case type.to_sym
273
+ when :Time
274
+ Time.parse(value)
275
+ when :Date
276
+ Date.parse(value)
277
+ when :String
278
+ value.to_s
279
+ when :Integer
280
+ value.to_i
281
+ when :Float
282
+ value.to_f
283
+ when :Boolean
284
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
285
+ true
286
+ else
287
+ false
288
+ end
289
+ when :Object
290
+ # generic object (usually a Hash), return directly
291
+ value
292
+ when /\AArray<(?<inner_type>.+)>\z/
293
+ inner_type = Regexp.last_match[:inner_type]
294
+ value.map { |v| _deserialize(inner_type, v) }
295
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
296
+ k_type = Regexp.last_match[:k_type]
297
+ v_type = Regexp.last_match[:v_type]
298
+ {}.tap do |hash|
299
+ value.each do |k, v|
300
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
301
+ end
302
+ end
303
+ else # model
304
+ # models (e.g. Pet) or oneOf
305
+ klass = Bandwidth.const_get(type)
306
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
307
+ end
308
+ end
309
+
310
+ # Returns the string representation of the object
311
+ # @return [String] String presentation of the object
312
+ def to_s
313
+ to_hash.to_s
314
+ end
315
+
316
+ # to_body is an alias to to_hash (backward compatibility)
317
+ # @return [Hash] Returns the object in the form of hash
318
+ def to_body
319
+ to_hash
320
+ end
321
+
322
+ # Returns the object in the form of hash
323
+ # @return [Hash] Returns the object in the form of hash
324
+ def to_hash
325
+ hash = {}
326
+ self.class.attribute_map.each_pair do |attr, param|
327
+ value = self.send(attr)
328
+ if value.nil?
329
+ is_nullable = self.class.openapi_nullable.include?(attr)
330
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
331
+ end
332
+
333
+ hash[param] = _to_hash(value)
334
+ end
335
+ hash
336
+ end
337
+
338
+ # Outputs non-array value in the form of hash
339
+ # For object, use to_hash. Otherwise, just return the value
340
+ # @param [Object] value Any valid value
341
+ # @return [Hash] Returns the value in the form of hash
342
+ def _to_hash(value)
343
+ if value.is_a?(Array)
344
+ value.compact.map { |v| _to_hash(v) }
345
+ elsif value.is_a?(Hash)
346
+ {}.tap do |hash|
347
+ value.each { |k, v| hash[k] = _to_hash(v) }
348
+ end
349
+ elsif value.respond_to? :to_hash
350
+ value.to_hash
351
+ else
352
+ value
353
+ end
354
+ end
355
+ end
356
+ end
@@ -0,0 +1,44 @@
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 RbmActionTypeEnum
18
+ REPLY = 'REPLY'.freeze
19
+ DIAL_PHONE = 'DIAL_PHONE'.freeze
20
+ SHOW_LOCATION = 'SHOW_LOCATION'.freeze
21
+ CREATE_CALENDAR_EVENT = 'CREATE_CALENDAR_EVENT'.freeze
22
+ OPEN_URL = 'OPEN_URL'.freeze
23
+ REQUEST_LOCATION = 'REQUEST_LOCATION'.freeze
24
+
25
+ def self.all_vars
26
+ @all_vars ||= [REPLY, DIAL_PHONE, SHOW_LOCATION, CREATE_CALENDAR_EVENT, OPEN_URL, REQUEST_LOCATION].freeze
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def self.build_from_hash(value)
33
+ new.build_from_hash(value)
34
+ end
35
+
36
+ # Builds the enum from string
37
+ # @param [String] The enum value in the form of the string
38
+ # @return [String] The enum value
39
+ def build_from_hash(value)
40
+ return value if RbmActionTypeEnum.all_vars.include?(value)
41
+ raise "Invalid ENUM value #{value} for class #RbmActionTypeEnum"
42
+ end
43
+ end
44
+ end