bandwidth-sdk 13.1.4 → 14.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +15 -12
  3. data/README.md +45 -18
  4. data/bandwidth-sdk.gemspec +1 -1
  5. data/bandwidth.yml +1638 -589
  6. data/coverage/.last_run.json +1 -1
  7. data/coverage/.resultset.json +1388 -420
  8. data/coverage/index.html +20846 -10460
  9. data/custom_templates/README.mustache +6 -6
  10. data/custom_templates/gemspec.mustache +1 -1
  11. data/docs/AdditionalDenialReason.md +22 -0
  12. data/docs/Address.md +30 -0
  13. data/docs/CallbackTypeEnum.md +15 -0
  14. data/docs/Contact.md +24 -0
  15. data/docs/Error.md +22 -0
  16. data/docs/FailureWebhook.md +28 -0
  17. data/docs/LinksObject.md +24 -0
  18. data/docs/MediaApi.md +1 -1
  19. data/docs/Message.md +1 -1
  20. data/docs/MessageCallback.md +28 -0
  21. data/docs/MessageCallbackMessage.md +40 -0
  22. data/docs/OptInWorkflow.md +20 -0
  23. data/docs/TelephoneNumber.md +18 -0
  24. data/docs/TfvBasicAuthentication.md +20 -0
  25. data/docs/TfvCallbackStatusEnum.md +15 -0
  26. data/docs/TfvError.md +22 -0
  27. data/docs/TfvStatus.md +32 -0
  28. data/docs/TfvStatusEnum.md +15 -0
  29. data/docs/TfvSubmissionInfo.md +34 -0
  30. data/docs/TfvSubmissionWrapper.md +18 -0
  31. data/docs/TollFreeVerificationApi.md +585 -0
  32. data/docs/VerificationDenialWebhook.md +32 -0
  33. data/docs/VerificationRequest.md +36 -0
  34. data/docs/VerificationUpdateRequest.md +34 -0
  35. data/docs/VerificationWebhook.md +24 -0
  36. data/docs/WebhookSubscription.md +30 -0
  37. data/docs/WebhookSubscriptionBasicAuthentication.md +20 -0
  38. data/docs/WebhookSubscriptionRequestSchema.md +22 -0
  39. data/docs/WebhookSubscriptionTypeEnum.md +15 -0
  40. data/docs/WebhookSubscriptionsListBody.md +22 -0
  41. data/lib/bandwidth-sdk/api/media_api.rb +1 -1
  42. data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +614 -0
  43. data/lib/bandwidth-sdk/configuration.rb +48 -0
  44. data/lib/bandwidth-sdk/models/additional_denial_reason.rb +254 -0
  45. data/lib/bandwidth-sdk/models/address.rb +501 -0
  46. data/lib/bandwidth-sdk/models/callback_type_enum.rb +42 -0
  47. data/lib/bandwidth-sdk/models/contact.rb +393 -0
  48. data/lib/bandwidth-sdk/models/error.rb +232 -0
  49. data/lib/bandwidth-sdk/models/failure_webhook.rb +304 -0
  50. data/lib/bandwidth-sdk/models/{transcription_metadata.rb → links_object.rb} +34 -35
  51. data/lib/bandwidth-sdk/models/{message_failed_callback.rb → message_callback.rb} +31 -13
  52. data/lib/bandwidth-sdk/models/{inbound_message_callback_message.rb → message_callback_message.rb} +6 -4
  53. data/lib/bandwidth-sdk/models/{inbound_message_callback.rb → opt_in_workflow.rb} +42 -61
  54. data/lib/bandwidth-sdk/models/telephone_number.rb +213 -0
  55. data/lib/bandwidth-sdk/models/{message_delivered_callback.rb → tfv_basic_authentication.rb} +58 -69
  56. data/lib/bandwidth-sdk/models/tfv_callback_status_enum.rb +40 -0
  57. data/lib/bandwidth-sdk/models/{message_sending_callback.rb → tfv_error.rb} +12 -64
  58. data/lib/bandwidth-sdk/models/{message_delivered_callback_message.rb → tfv_status.rb} +86 -162
  59. data/lib/bandwidth-sdk/models/tfv_status_enum.rb +43 -0
  60. data/lib/bandwidth-sdk/models/tfv_submission_info.rb +452 -0
  61. data/lib/bandwidth-sdk/models/{transcription_list.rb → tfv_submission_wrapper.rb} +12 -14
  62. data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +325 -0
  63. data/lib/bandwidth-sdk/models/verification_request.rb +547 -0
  64. data/lib/bandwidth-sdk/models/verification_update_request.rb +501 -0
  65. data/lib/bandwidth-sdk/models/verification_webhook.rb +303 -0
  66. data/lib/bandwidth-sdk/models/{message_failed_callback_message.rb → webhook_subscription.rb} +68 -158
  67. data/lib/bandwidth-sdk/models/webhook_subscription_basic_authentication.rb +274 -0
  68. data/lib/bandwidth-sdk/models/webhook_subscription_request_schema.rb +306 -0
  69. data/lib/bandwidth-sdk/models/webhook_subscription_type_enum.rb +40 -0
  70. data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +242 -0
  71. data/lib/bandwidth-sdk/version.rb +1 -1
  72. data/lib/bandwidth-sdk.rb +28 -8
  73. data/openapi-config.yml +1 -1
  74. data/spec/call_utils.rb +2 -2
  75. data/spec/smoke/toll_free_verification_api_spec.rb +69 -0
  76. data/spec/spec_helper.rb +1 -1
  77. data/spec/unit/api/mfa_api_spec.rb +1 -1
  78. data/spec/unit/api/toll_free_verification_api_spec.rb +278 -0
  79. data/spec/unit/client/api_client_spec.rb +1 -1
  80. metadata +111 -62
  81. data/lib/bandwidth-sdk/models/disconenct_callback.rb +0 -405
  82. data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +0 -418
@@ -1,418 +0,0 @@
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
- # Message Sending Callback Message Schema
18
- class MessageSendingCallbackMessage
19
- attr_accessor :id
20
-
21
- attr_accessor :owner
22
-
23
- attr_accessor :application_id
24
-
25
- attr_accessor :time
26
-
27
- attr_accessor :segment_count
28
-
29
- attr_accessor :direction
30
-
31
- attr_accessor :to
32
-
33
- attr_accessor :from
34
-
35
- attr_accessor :text
36
-
37
- attr_accessor :tag
38
-
39
- attr_accessor :media
40
-
41
- attr_accessor :priority
42
-
43
- class EnumAttributeValidator
44
- attr_reader :datatype
45
- attr_reader :allowable_values
46
-
47
- def initialize(datatype, allowable_values)
48
- @allowable_values = allowable_values.map do |value|
49
- case datatype.to_s
50
- when /Integer/i
51
- value.to_i
52
- when /Float/i
53
- value.to_f
54
- else
55
- value
56
- end
57
- end
58
- end
59
-
60
- def valid?(value)
61
- !value || allowable_values.include?(value)
62
- end
63
- end
64
-
65
- # Attribute mapping from ruby-style variable name to JSON key.
66
- def self.attribute_map
67
- {
68
- :'id' => :'id',
69
- :'owner' => :'owner',
70
- :'application_id' => :'applicationId',
71
- :'time' => :'time',
72
- :'segment_count' => :'segmentCount',
73
- :'direction' => :'direction',
74
- :'to' => :'to',
75
- :'from' => :'from',
76
- :'text' => :'text',
77
- :'tag' => :'tag',
78
- :'media' => :'media',
79
- :'priority' => :'priority'
80
- }
81
- end
82
-
83
- # Returns all the JSON keys this model knows about
84
- def self.acceptable_attributes
85
- attribute_map.values
86
- end
87
-
88
- # Attribute type mapping.
89
- def self.openapi_types
90
- {
91
- :'id' => :'String',
92
- :'owner' => :'String',
93
- :'application_id' => :'String',
94
- :'time' => :'Time',
95
- :'segment_count' => :'Integer',
96
- :'direction' => :'MessageDirectionEnum',
97
- :'to' => :'Array<String>',
98
- :'from' => :'String',
99
- :'text' => :'String',
100
- :'tag' => :'String',
101
- :'media' => :'Array<String>',
102
- :'priority' => :'PriorityEnum'
103
- }
104
- end
105
-
106
- # List of attributes with nullable: true
107
- def self.openapi_nullable
108
- Set.new([
109
- ])
110
- end
111
-
112
- # Initializes the object
113
- # @param [Hash] attributes Model attributes in the form of hash
114
- def initialize(attributes = {})
115
- if (!attributes.is_a?(Hash))
116
- fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessageSendingCallbackMessage` initialize method'
117
- end
118
-
119
- # check to see if the attribute exists and convert string to symbol for hash key
120
- attributes = attributes.each_with_object({}) { |(k, v), h|
121
- if (!self.class.attribute_map.key?(k.to_sym))
122
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageSendingCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
123
- end
124
- h[k.to_sym] = v
125
- }
126
-
127
- if attributes.key?(:'id')
128
- self.id = attributes[:'id']
129
- else
130
- self.id = nil
131
- end
132
-
133
- if attributes.key?(:'owner')
134
- self.owner = attributes[:'owner']
135
- else
136
- self.owner = nil
137
- end
138
-
139
- if attributes.key?(:'application_id')
140
- self.application_id = attributes[:'application_id']
141
- else
142
- self.application_id = nil
143
- end
144
-
145
- if attributes.key?(:'time')
146
- self.time = attributes[:'time']
147
- else
148
- self.time = nil
149
- end
150
-
151
- if attributes.key?(:'segment_count')
152
- self.segment_count = attributes[:'segment_count']
153
- else
154
- self.segment_count = nil
155
- end
156
-
157
- if attributes.key?(:'direction')
158
- self.direction = attributes[:'direction']
159
- else
160
- self.direction = nil
161
- end
162
-
163
- if attributes.key?(:'to')
164
- if (value = attributes[:'to']).is_a?(Array)
165
- self.to = value
166
- end
167
- else
168
- self.to = nil
169
- end
170
-
171
- if attributes.key?(:'from')
172
- self.from = attributes[:'from']
173
- else
174
- self.from = nil
175
- end
176
-
177
- if attributes.key?(:'text')
178
- self.text = attributes[:'text']
179
- else
180
- self.text = nil
181
- end
182
-
183
- if attributes.key?(:'tag')
184
- self.tag = attributes[:'tag']
185
- end
186
-
187
- if attributes.key?(:'media')
188
- if (value = attributes[:'media']).is_a?(Array)
189
- self.media = value
190
- end
191
- else
192
- self.media = nil
193
- end
194
-
195
- if attributes.key?(:'priority')
196
- self.priority = attributes[:'priority']
197
- end
198
- end
199
-
200
- # Show invalid properties with the reasons. Usually used together with valid?
201
- # @return Array for valid properties with the reasons
202
- def list_invalid_properties
203
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
204
- invalid_properties = Array.new
205
- if @id.nil?
206
- invalid_properties.push('invalid value for "id", id cannot be nil.')
207
- end
208
-
209
- if @owner.nil?
210
- invalid_properties.push('invalid value for "owner", owner cannot be nil.')
211
- end
212
-
213
- if @application_id.nil?
214
- invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
215
- end
216
-
217
- if @time.nil?
218
- invalid_properties.push('invalid value for "time", time cannot be nil.')
219
- end
220
-
221
- if @segment_count.nil?
222
- invalid_properties.push('invalid value for "segment_count", segment_count cannot be nil.')
223
- end
224
-
225
- if @direction.nil?
226
- invalid_properties.push('invalid value for "direction", direction cannot be nil.')
227
- end
228
-
229
- if @to.nil?
230
- invalid_properties.push('invalid value for "to", to cannot be nil.')
231
- end
232
-
233
- if @from.nil?
234
- invalid_properties.push('invalid value for "from", from cannot be nil.')
235
- end
236
-
237
- if @text.nil?
238
- invalid_properties.push('invalid value for "text", text cannot be nil.')
239
- end
240
-
241
- if @media.nil?
242
- invalid_properties.push('invalid value for "media", media cannot be nil.')
243
- end
244
-
245
- invalid_properties
246
- end
247
-
248
- # Check to see if the all the properties in the model are valid
249
- # @return true if the model is valid
250
- def valid?
251
- warn '[DEPRECATED] the `valid?` method is obsolete'
252
- return false if @id.nil?
253
- return false if @owner.nil?
254
- return false if @application_id.nil?
255
- return false if @time.nil?
256
- return false if @segment_count.nil?
257
- return false if @direction.nil?
258
- return false if @to.nil?
259
- return false if @from.nil?
260
- return false if @text.nil?
261
- return false if @media.nil?
262
- true
263
- end
264
-
265
- # Custom attribute writer method with validation
266
- # @param [Object] to Value to be assigned
267
- def to=(to)
268
- if to.nil?
269
- fail ArgumentError, 'to cannot be nil'
270
- end
271
-
272
- @to = to
273
- end
274
-
275
- # Checks equality by comparing each attribute.
276
- # @param [Object] Object to be compared
277
- def ==(o)
278
- return true if self.equal?(o)
279
- self.class == o.class &&
280
- id == o.id &&
281
- owner == o.owner &&
282
- application_id == o.application_id &&
283
- time == o.time &&
284
- segment_count == o.segment_count &&
285
- direction == o.direction &&
286
- to == o.to &&
287
- from == o.from &&
288
- text == o.text &&
289
- tag == o.tag &&
290
- media == o.media &&
291
- priority == o.priority
292
- end
293
-
294
- # @see the `==` method
295
- # @param [Object] Object to be compared
296
- def eql?(o)
297
- self == o
298
- end
299
-
300
- # Calculates hash code according to all attributes.
301
- # @return [Integer] Hash code
302
- def hash
303
- [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority].hash
304
- end
305
-
306
- # Builds the object from hash
307
- # @param [Hash] attributes Model attributes in the form of hash
308
- # @return [Object] Returns the model itself
309
- def self.build_from_hash(attributes)
310
- return nil unless attributes.is_a?(Hash)
311
- attributes = attributes.transform_keys(&:to_sym)
312
- transformed_hash = {}
313
- openapi_types.each_pair do |key, type|
314
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
315
- transformed_hash["#{key}"] = nil
316
- elsif type =~ /\AArray<(.*)>/i
317
- # check to ensure the input is an array given that the attribute
318
- # is documented as an array but the input is not
319
- if attributes[attribute_map[key]].is_a?(Array)
320
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
321
- end
322
- elsif !attributes[attribute_map[key]].nil?
323
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
324
- end
325
- end
326
- new(transformed_hash)
327
- end
328
-
329
- # Deserializes the data based on type
330
- # @param string type Data type
331
- # @param string value Value to be deserialized
332
- # @return [Object] Deserialized data
333
- def self._deserialize(type, value)
334
- case type.to_sym
335
- when :Time
336
- Time.parse(value)
337
- when :Date
338
- Date.parse(value)
339
- when :String
340
- value.to_s
341
- when :Integer
342
- value.to_i
343
- when :Float
344
- value.to_f
345
- when :Boolean
346
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
347
- true
348
- else
349
- false
350
- end
351
- when :Object
352
- # generic object (usually a Hash), return directly
353
- value
354
- when /\AArray<(?<inner_type>.+)>\z/
355
- inner_type = Regexp.last_match[:inner_type]
356
- value.map { |v| _deserialize(inner_type, v) }
357
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
358
- k_type = Regexp.last_match[:k_type]
359
- v_type = Regexp.last_match[:v_type]
360
- {}.tap do |hash|
361
- value.each do |k, v|
362
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
363
- end
364
- end
365
- else # model
366
- # models (e.g. Pet) or oneOf
367
- klass = Bandwidth.const_get(type)
368
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
369
- end
370
- end
371
-
372
- # Returns the string representation of the object
373
- # @return [String] String presentation of the object
374
- def to_s
375
- to_hash.to_s
376
- end
377
-
378
- # to_body is an alias to to_hash (backward compatibility)
379
- # @return [Hash] Returns the object in the form of hash
380
- def to_body
381
- to_hash
382
- end
383
-
384
- # Returns the object in the form of hash
385
- # @return [Hash] Returns the object in the form of hash
386
- def to_hash
387
- hash = {}
388
- self.class.attribute_map.each_pair do |attr, param|
389
- value = self.send(attr)
390
- if value.nil?
391
- is_nullable = self.class.openapi_nullable.include?(attr)
392
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
393
- end
394
-
395
- hash[param] = _to_hash(value)
396
- end
397
- hash
398
- end
399
-
400
- # Outputs non-array value in the form of hash
401
- # For object, use to_hash. Otherwise, just return the value
402
- # @param [Object] value Any valid value
403
- # @return [Hash] Returns the value in the form of hash
404
- def _to_hash(value)
405
- if value.is_a?(Array)
406
- value.compact.map { |v| _to_hash(v) }
407
- elsif value.is_a?(Hash)
408
- {}.tap do |hash|
409
- value.each { |k, v| hash[k] = _to_hash(v) }
410
- end
411
- elsif value.respond_to? :to_hash
412
- value.to_hash
413
- else
414
- value
415
- end
416
- end
417
- end
418
- end