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,405 +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
- OpenAPI Generator version: 6.3.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Bandwidth
17
- # The Disconnect event is fired when a call ends, for any reason.
18
- class DisconenctCallback
19
- # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
20
- attr_accessor :event_type
21
-
22
- # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
23
- attr_accessor :event_time
24
-
25
- # The user account associated with the call.
26
- attr_accessor :account_id
27
-
28
- # The id of the application associated with the call.
29
- attr_accessor :application_id
30
-
31
- # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
32
- attr_accessor :from
33
-
34
- # The phone number that received the call, in E.164 format (e.g. +15555555555).
35
- attr_accessor :to
36
-
37
- # The call id associated with the event.
38
- attr_accessor :call_id
39
-
40
- attr_accessor :direction
41
-
42
- # The URL of the call associated with the event.
43
- attr_accessor :call_url
44
-
45
- # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.
46
- attr_accessor :enqueued_time
47
-
48
- # Time the call was started, in ISO 8601 format.
49
- attr_accessor :start_time
50
-
51
- # Time the call was answered, in ISO 8601 format.
52
- attr_accessor :answer_time
53
-
54
- # The time that the recording ended in ISO-8601 format
55
- attr_accessor :end_time
56
-
57
- # Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.
58
- attr_accessor :cause
59
-
60
- # Text explaining the reason that caused the call to fail in case of errors.
61
- attr_accessor :error_message
62
-
63
- # Bandwidth's internal id that references the error event.
64
- attr_accessor :error_id
65
-
66
- # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
67
- attr_accessor :tag
68
-
69
- class EnumAttributeValidator
70
- attr_reader :datatype
71
- attr_reader :allowable_values
72
-
73
- def initialize(datatype, allowable_values)
74
- @allowable_values = allowable_values.map do |value|
75
- case datatype.to_s
76
- when /Integer/i
77
- value.to_i
78
- when /Float/i
79
- value.to_f
80
- else
81
- value
82
- end
83
- end
84
- end
85
-
86
- def valid?(value)
87
- !value || allowable_values.include?(value)
88
- end
89
- end
90
-
91
- # Attribute mapping from ruby-style variable name to JSON key.
92
- def self.attribute_map
93
- {
94
- :'event_type' => :'eventType',
95
- :'event_time' => :'eventTime',
96
- :'account_id' => :'accountId',
97
- :'application_id' => :'applicationId',
98
- :'from' => :'from',
99
- :'to' => :'to',
100
- :'call_id' => :'callId',
101
- :'direction' => :'direction',
102
- :'call_url' => :'callUrl',
103
- :'enqueued_time' => :'enqueuedTime',
104
- :'start_time' => :'startTime',
105
- :'answer_time' => :'answerTime',
106
- :'end_time' => :'endTime',
107
- :'cause' => :'cause',
108
- :'error_message' => :'errorMessage',
109
- :'error_id' => :'errorId',
110
- :'tag' => :'tag'
111
- }
112
- end
113
-
114
- # Returns all the JSON keys this model knows about
115
- def self.acceptable_attributes
116
- attribute_map.values
117
- end
118
-
119
- # Attribute type mapping.
120
- def self.openapi_types
121
- {
122
- :'event_type' => :'String',
123
- :'event_time' => :'String',
124
- :'account_id' => :'String',
125
- :'application_id' => :'String',
126
- :'from' => :'String',
127
- :'to' => :'String',
128
- :'call_id' => :'String',
129
- :'direction' => :'CallDirectionEnum',
130
- :'call_url' => :'String',
131
- :'enqueued_time' => :'Time',
132
- :'start_time' => :'Time',
133
- :'answer_time' => :'Time',
134
- :'end_time' => :'Time',
135
- :'cause' => :'String',
136
- :'error_message' => :'String',
137
- :'error_id' => :'String',
138
- :'tag' => :'String'
139
- }
140
- end
141
-
142
- # List of attributes with nullable: true
143
- def self.openapi_nullable
144
- Set.new([
145
- :'enqueued_time',
146
- :'answer_time',
147
- :'error_message',
148
- :'error_id',
149
- :'tag'
150
- ])
151
- end
152
-
153
- # Initializes the object
154
- # @param [Hash] attributes Model attributes in the form of hash
155
- def initialize(attributes = {})
156
- if (!attributes.is_a?(Hash))
157
- fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::DisconenctCallback` initialize method'
158
- end
159
-
160
- # check to see if the attribute exists and convert string to symbol for hash key
161
- attributes = attributes.each_with_object({}) { |(k, v), h|
162
- if (!self.class.attribute_map.key?(k.to_sym))
163
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DisconenctCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
164
- end
165
- h[k.to_sym] = v
166
- }
167
-
168
- if attributes.key?(:'event_type')
169
- self.event_type = attributes[:'event_type']
170
- end
171
-
172
- if attributes.key?(:'event_time')
173
- self.event_time = attributes[:'event_time']
174
- end
175
-
176
- if attributes.key?(:'account_id')
177
- self.account_id = attributes[:'account_id']
178
- end
179
-
180
- if attributes.key?(:'application_id')
181
- self.application_id = attributes[:'application_id']
182
- end
183
-
184
- if attributes.key?(:'from')
185
- self.from = attributes[:'from']
186
- end
187
-
188
- if attributes.key?(:'to')
189
- self.to = attributes[:'to']
190
- end
191
-
192
- if attributes.key?(:'call_id')
193
- self.call_id = attributes[:'call_id']
194
- end
195
-
196
- if attributes.key?(:'direction')
197
- self.direction = attributes[:'direction']
198
- end
199
-
200
- if attributes.key?(:'call_url')
201
- self.call_url = attributes[:'call_url']
202
- end
203
-
204
- if attributes.key?(:'enqueued_time')
205
- self.enqueued_time = attributes[:'enqueued_time']
206
- end
207
-
208
- if attributes.key?(:'start_time')
209
- self.start_time = attributes[:'start_time']
210
- end
211
-
212
- if attributes.key?(:'answer_time')
213
- self.answer_time = attributes[:'answer_time']
214
- end
215
-
216
- if attributes.key?(:'end_time')
217
- self.end_time = attributes[:'end_time']
218
- end
219
-
220
- if attributes.key?(:'cause')
221
- self.cause = attributes[:'cause']
222
- end
223
-
224
- if attributes.key?(:'error_message')
225
- self.error_message = attributes[:'error_message']
226
- end
227
-
228
- if attributes.key?(:'error_id')
229
- self.error_id = attributes[:'error_id']
230
- end
231
-
232
- if attributes.key?(:'tag')
233
- self.tag = attributes[:'tag']
234
- end
235
- end
236
-
237
- # Show invalid properties with the reasons. Usually used together with valid?
238
- # @return Array for valid properties with the reasons
239
- def list_invalid_properties
240
- invalid_properties = Array.new
241
- invalid_properties
242
- end
243
-
244
- # Check to see if the all the properties in the model are valid
245
- # @return true if the model is valid
246
- def valid?
247
- true
248
- end
249
-
250
- # Checks equality by comparing each attribute.
251
- # @param [Object] Object to be compared
252
- def ==(o)
253
- return true if self.equal?(o)
254
- self.class == o.class &&
255
- event_type == o.event_type &&
256
- event_time == o.event_time &&
257
- account_id == o.account_id &&
258
- application_id == o.application_id &&
259
- from == o.from &&
260
- to == o.to &&
261
- call_id == o.call_id &&
262
- direction == o.direction &&
263
- call_url == o.call_url &&
264
- enqueued_time == o.enqueued_time &&
265
- start_time == o.start_time &&
266
- answer_time == o.answer_time &&
267
- end_time == o.end_time &&
268
- cause == o.cause &&
269
- error_message == o.error_message &&
270
- error_id == o.error_id &&
271
- tag == o.tag
272
- end
273
-
274
- # @see the `==` method
275
- # @param [Object] Object to be compared
276
- def eql?(o)
277
- self == o
278
- end
279
-
280
- # Calculates hash code according to all attributes.
281
- # @return [Integer] Hash code
282
- def hash
283
- [event_type, event_time, account_id, application_id, from, to, call_id, direction, call_url, enqueued_time, start_time, answer_time, end_time, cause, error_message, error_id, tag].hash
284
- end
285
-
286
- # Builds the object from hash
287
- # @param [Hash] attributes Model attributes in the form of hash
288
- # @return [Object] Returns the model itself
289
- def self.build_from_hash(attributes)
290
- new.build_from_hash(attributes)
291
- end
292
-
293
- # Builds the object from hash
294
- # @param [Hash] attributes Model attributes in the form of hash
295
- # @return [Object] Returns the model itself
296
- def build_from_hash(attributes)
297
- return nil unless attributes.is_a?(Hash)
298
- attributes = attributes.transform_keys(&:to_sym)
299
- self.class.openapi_types.each_pair do |key, type|
300
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
301
- self.send("#{key}=", nil)
302
- elsif type =~ /\AArray<(.*)>/i
303
- # check to ensure the input is an array given that the attribute
304
- # is documented as an array but the input is not
305
- if attributes[self.class.attribute_map[key]].is_a?(Array)
306
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
307
- end
308
- elsif !attributes[self.class.attribute_map[key]].nil?
309
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
310
- end
311
- end
312
-
313
- self
314
- end
315
-
316
- # Deserializes the data based on type
317
- # @param string type Data type
318
- # @param string value Value to be deserialized
319
- # @return [Object] Deserialized data
320
- def _deserialize(type, value)
321
- case type.to_sym
322
- when :Time
323
- Time.parse(value)
324
- when :Date
325
- Date.parse(value)
326
- when :String
327
- value.to_s
328
- when :Integer
329
- value.to_i
330
- when :Float
331
- value.to_f
332
- when :Boolean
333
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
334
- true
335
- else
336
- false
337
- end
338
- when :Object
339
- # generic object (usually a Hash), return directly
340
- value
341
- when /\AArray<(?<inner_type>.+)>\z/
342
- inner_type = Regexp.last_match[:inner_type]
343
- value.map { |v| _deserialize(inner_type, v) }
344
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
345
- k_type = Regexp.last_match[:k_type]
346
- v_type = Regexp.last_match[:v_type]
347
- {}.tap do |hash|
348
- value.each do |k, v|
349
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
350
- end
351
- end
352
- else # model
353
- # models (e.g. Pet) or oneOf
354
- klass = Bandwidth.const_get(type)
355
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
356
- end
357
- end
358
-
359
- # Returns the string representation of the object
360
- # @return [String] String presentation of the object
361
- def to_s
362
- to_hash.to_s
363
- end
364
-
365
- # to_body is an alias to to_hash (backward compatibility)
366
- # @return [Hash] Returns the object in the form of hash
367
- def to_body
368
- to_hash
369
- end
370
-
371
- # Returns the object in the form of hash
372
- # @return [Hash] Returns the object in the form of hash
373
- def to_hash
374
- hash = {}
375
- self.class.attribute_map.each_pair do |attr, param|
376
- value = self.send(attr)
377
- if value.nil?
378
- is_nullable = self.class.openapi_nullable.include?(attr)
379
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
380
- end
381
-
382
- hash[param] = _to_hash(value)
383
- end
384
- hash
385
- end
386
-
387
- # Outputs non-array value in the form of hash
388
- # For object, use to_hash. Otherwise, just return the value
389
- # @param [Object] value Any valid value
390
- # @return [Hash] Returns the value in the form of hash
391
- def _to_hash(value)
392
- if value.is_a?(Array)
393
- value.compact.map { |v| _to_hash(v) }
394
- elsif value.is_a?(Hash)
395
- {}.tap do |hash|
396
- value.each { |k, v| hash[k] = _to_hash(v) }
397
- end
398
- elsif value.respond_to? :to_hash
399
- value.to_hash
400
- else
401
- value
402
- end
403
- end
404
- end
405
- end