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
@@ -0,0 +1,614 @@
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 'cgi'
14
+
15
+ module Bandwidth
16
+ class TollFreeVerificationApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Webhook Subscription
23
+ # Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time.
24
+ # @param account_id [String] Your Bandwidth Account ID.
25
+ # @param webhook_subscription_request_schema [WebhookSubscriptionRequestSchema] Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [WebhookSubscription]
28
+ def create_webhook_subscription(account_id, webhook_subscription_request_schema, opts = {})
29
+ data, _status_code, _headers = create_webhook_subscription_with_http_info(account_id, webhook_subscription_request_schema, opts)
30
+ data
31
+ end
32
+
33
+ # Create Webhook Subscription
34
+ # Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time.
35
+ # @param account_id [String] Your Bandwidth Account ID.
36
+ # @param webhook_subscription_request_schema [WebhookSubscriptionRequestSchema] Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(WebhookSubscription, Integer, Hash)>] WebhookSubscription data, response status code and response headers
39
+ def create_webhook_subscription_with_http_info(account_id, webhook_subscription_request_schema, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: TollFreeVerificationApi.create_webhook_subscription ...'
42
+ end
43
+ # verify the required parameter 'account_id' is set
44
+ if @api_client.config.client_side_validation && account_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling TollFreeVerificationApi.create_webhook_subscription"
46
+ end
47
+ # verify the required parameter 'webhook_subscription_request_schema' is set
48
+ if @api_client.config.client_side_validation && webhook_subscription_request_schema.nil?
49
+ fail ArgumentError, "Missing the required parameter 'webhook_subscription_request_schema' when calling TollFreeVerificationApi.create_webhook_subscription"
50
+ end
51
+ # resource path
52
+ local_var_path = '/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
+ # HTTP header 'Content-Type'
62
+ content_type = @api_client.select_header_content_type(['application/json'])
63
+ if !content_type.nil?
64
+ header_params['Content-Type'] = content_type
65
+ end
66
+
67
+ # form parameters
68
+ form_params = opts[:form_params] || {}
69
+
70
+ # http body (model)
71
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_subscription_request_schema)
72
+
73
+ # return_type
74
+ return_type = opts[:debug_return_type] || 'WebhookSubscription'
75
+
76
+ # auth_names
77
+ auth_names = opts[:debug_auth_names] || ['Basic']
78
+
79
+ new_options = opts.merge(
80
+ :operation => :"TollFreeVerificationApi.create_webhook_subscription",
81
+ :header_params => header_params,
82
+ :query_params => query_params,
83
+ :form_params => form_params,
84
+ :body => post_body,
85
+ :auth_names => auth_names,
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: TollFreeVerificationApi#create_webhook_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
96
+ # Delete Webhook Subscription
97
+ # Delete a webhook subscription by ID.
98
+ # @param account_id [String] Your Bandwidth Account ID.
99
+ # @param id [String] Webhook subscription ID
100
+ # @param [Hash] opts the optional parameters
101
+ # @return [nil]
102
+ def delete_webhook_subscription(account_id, id, opts = {})
103
+ delete_webhook_subscription_with_http_info(account_id, id, opts)
104
+ nil
105
+ end
106
+
107
+ # Delete Webhook Subscription
108
+ # Delete a webhook subscription by ID.
109
+ # @param account_id [String] Your Bandwidth Account ID.
110
+ # @param id [String] Webhook subscription ID
111
+ # @param [Hash] opts the optional parameters
112
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
113
+ def delete_webhook_subscription_with_http_info(account_id, id, opts = {})
114
+ if @api_client.config.debugging
115
+ @api_client.config.logger.debug 'Calling API: TollFreeVerificationApi.delete_webhook_subscription ...'
116
+ end
117
+ # verify the required parameter 'account_id' is set
118
+ if @api_client.config.client_side_validation && account_id.nil?
119
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling TollFreeVerificationApi.delete_webhook_subscription"
120
+ end
121
+ # verify the required parameter 'id' is set
122
+ if @api_client.config.client_side_validation && id.nil?
123
+ fail ArgumentError, "Missing the required parameter 'id' when calling TollFreeVerificationApi.delete_webhook_subscription"
124
+ end
125
+ # resource path
126
+ local_var_path = '/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
127
+
128
+ # query parameters
129
+ query_params = opts[:query_params] || {}
130
+
131
+ # header parameters
132
+ header_params = opts[:header_params] || {}
133
+ # HTTP header 'Accept' (if needed)
134
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
135
+
136
+ # form parameters
137
+ form_params = opts[:form_params] || {}
138
+
139
+ # http body (model)
140
+ post_body = opts[:debug_body]
141
+
142
+ # return_type
143
+ return_type = opts[:debug_return_type]
144
+
145
+ # auth_names
146
+ auth_names = opts[:debug_auth_names] || ['Basic']
147
+
148
+ new_options = opts.merge(
149
+ :operation => :"TollFreeVerificationApi.delete_webhook_subscription",
150
+ :header_params => header_params,
151
+ :query_params => query_params,
152
+ :form_params => form_params,
153
+ :body => post_body,
154
+ :auth_names => auth_names,
155
+ :return_type => return_type
156
+ )
157
+
158
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
159
+ if @api_client.config.debugging
160
+ @api_client.config.logger.debug "API called: TollFreeVerificationApi#delete_webhook_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
161
+ end
162
+ return data, status_code, headers
163
+ end
164
+
165
+ # Get Toll-Free Verification Status
166
+ # Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available.
167
+ # @param account_id [String] Your Bandwidth Account ID.
168
+ # @param phone_number [String] Valid Toll-Free telephone number in E.164 format.
169
+ # @param [Hash] opts the optional parameters
170
+ # @return [TfvStatus]
171
+ def get_toll_free_verification_status(account_id, phone_number, opts = {})
172
+ data, _status_code, _headers = get_toll_free_verification_status_with_http_info(account_id, phone_number, opts)
173
+ data
174
+ end
175
+
176
+ # Get Toll-Free Verification Status
177
+ # Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available.
178
+ # @param account_id [String] Your Bandwidth Account ID.
179
+ # @param phone_number [String] Valid Toll-Free telephone number in E.164 format.
180
+ # @param [Hash] opts the optional parameters
181
+ # @return [Array<(TfvStatus, Integer, Hash)>] TfvStatus data, response status code and response headers
182
+ def get_toll_free_verification_status_with_http_info(account_id, phone_number, opts = {})
183
+ if @api_client.config.debugging
184
+ @api_client.config.logger.debug 'Calling API: TollFreeVerificationApi.get_toll_free_verification_status ...'
185
+ end
186
+ # verify the required parameter 'account_id' is set
187
+ if @api_client.config.client_side_validation && account_id.nil?
188
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling TollFreeVerificationApi.get_toll_free_verification_status"
189
+ end
190
+ # verify the required parameter 'phone_number' is set
191
+ if @api_client.config.client_side_validation && phone_number.nil?
192
+ fail ArgumentError, "Missing the required parameter 'phone_number' when calling TollFreeVerificationApi.get_toll_free_verification_status"
193
+ end
194
+ if @api_client.config.client_side_validation && phone_number.to_s.length > 12
195
+ fail ArgumentError, 'invalid value for "phone_number" when calling TollFreeVerificationApi.get_toll_free_verification_status, the character length must be smaller than or equal to 12.'
196
+ end
197
+
198
+ if @api_client.config.client_side_validation && phone_number.to_s.length < 12
199
+ fail ArgumentError, 'invalid value for "phone_number" when calling TollFreeVerificationApi.get_toll_free_verification_status, the character length must be great than or equal to 12.'
200
+ end
201
+
202
+ pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
203
+ if @api_client.config.client_side_validation && phone_number !~ pattern
204
+ fail ArgumentError, "invalid value for 'phone_number' when calling TollFreeVerificationApi.get_toll_free_verification_status, must conform to the pattern #{pattern}."
205
+ end
206
+
207
+ # resource path
208
+ local_var_path = '/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'phoneNumber' + '}', CGI.escape(phone_number.to_s))
209
+
210
+ # query parameters
211
+ query_params = opts[:query_params] || {}
212
+
213
+ # header parameters
214
+ header_params = opts[:header_params] || {}
215
+ # HTTP header 'Accept' (if needed)
216
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
217
+
218
+ # form parameters
219
+ form_params = opts[:form_params] || {}
220
+
221
+ # http body (model)
222
+ post_body = opts[:debug_body]
223
+
224
+ # return_type
225
+ return_type = opts[:debug_return_type] || 'TfvStatus'
226
+
227
+ # auth_names
228
+ auth_names = opts[:debug_auth_names] || ['Basic']
229
+
230
+ new_options = opts.merge(
231
+ :operation => :"TollFreeVerificationApi.get_toll_free_verification_status",
232
+ :header_params => header_params,
233
+ :query_params => query_params,
234
+ :form_params => form_params,
235
+ :body => post_body,
236
+ :auth_names => auth_names,
237
+ :return_type => return_type
238
+ )
239
+
240
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
241
+ if @api_client.config.debugging
242
+ @api_client.config.logger.debug "API called: TollFreeVerificationApi#get_toll_free_verification_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
243
+ end
244
+ return data, status_code, headers
245
+ end
246
+
247
+ # List Toll-Free Use Cases
248
+ # Lists valid toll-free use cases.
249
+ # @param [Hash] opts the optional parameters
250
+ # @return [Array<String>]
251
+ def list_toll_free_use_cases(opts = {})
252
+ data, _status_code, _headers = list_toll_free_use_cases_with_http_info(opts)
253
+ data
254
+ end
255
+
256
+ # List Toll-Free Use Cases
257
+ # Lists valid toll-free use cases.
258
+ # @param [Hash] opts the optional parameters
259
+ # @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
260
+ def list_toll_free_use_cases_with_http_info(opts = {})
261
+ if @api_client.config.debugging
262
+ @api_client.config.logger.debug 'Calling API: TollFreeVerificationApi.list_toll_free_use_cases ...'
263
+ end
264
+ # resource path
265
+ local_var_path = '/tollFreeVerification/useCases'
266
+
267
+ # query parameters
268
+ query_params = opts[:query_params] || {}
269
+
270
+ # header parameters
271
+ header_params = opts[:header_params] || {}
272
+ # HTTP header 'Accept' (if needed)
273
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
274
+
275
+ # form parameters
276
+ form_params = opts[:form_params] || {}
277
+
278
+ # http body (model)
279
+ post_body = opts[:debug_body]
280
+
281
+ # return_type
282
+ return_type = opts[:debug_return_type] || 'Array<String>'
283
+
284
+ # auth_names
285
+ auth_names = opts[:debug_auth_names] || ['Basic']
286
+
287
+ new_options = opts.merge(
288
+ :operation => :"TollFreeVerificationApi.list_toll_free_use_cases",
289
+ :header_params => header_params,
290
+ :query_params => query_params,
291
+ :form_params => form_params,
292
+ :body => post_body,
293
+ :auth_names => auth_names,
294
+ :return_type => return_type
295
+ )
296
+
297
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
298
+ if @api_client.config.debugging
299
+ @api_client.config.logger.debug "API called: TollFreeVerificationApi#list_toll_free_use_cases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
300
+ end
301
+ return data, status_code, headers
302
+ end
303
+
304
+ # List Webhook Subscriptions
305
+ # Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null).
306
+ # @param account_id [String] Your Bandwidth Account ID.
307
+ # @param [Hash] opts the optional parameters
308
+ # @return [WebhookSubscriptionsListBody]
309
+ def list_webhook_subscriptions(account_id, opts = {})
310
+ data, _status_code, _headers = list_webhook_subscriptions_with_http_info(account_id, opts)
311
+ data
312
+ end
313
+
314
+ # List Webhook Subscriptions
315
+ # Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If &#x60;basicAuthentication&#x60; is defined, the &#x60;password&#x60; property of that object will be null).
316
+ # @param account_id [String] Your Bandwidth Account ID.
317
+ # @param [Hash] opts the optional parameters
318
+ # @return [Array<(WebhookSubscriptionsListBody, Integer, Hash)>] WebhookSubscriptionsListBody data, response status code and response headers
319
+ def list_webhook_subscriptions_with_http_info(account_id, opts = {})
320
+ if @api_client.config.debugging
321
+ @api_client.config.logger.debug 'Calling API: TollFreeVerificationApi.list_webhook_subscriptions ...'
322
+ end
323
+ # verify the required parameter 'account_id' is set
324
+ if @api_client.config.client_side_validation && account_id.nil?
325
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling TollFreeVerificationApi.list_webhook_subscriptions"
326
+ end
327
+ # resource path
328
+ local_var_path = '/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
329
+
330
+ # query parameters
331
+ query_params = opts[:query_params] || {}
332
+
333
+ # header parameters
334
+ header_params = opts[:header_params] || {}
335
+ # HTTP header 'Accept' (if needed)
336
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
337
+
338
+ # form parameters
339
+ form_params = opts[:form_params] || {}
340
+
341
+ # http body (model)
342
+ post_body = opts[:debug_body]
343
+
344
+ # return_type
345
+ return_type = opts[:debug_return_type] || 'WebhookSubscriptionsListBody'
346
+
347
+ # auth_names
348
+ auth_names = opts[:debug_auth_names] || ['Basic']
349
+
350
+ new_options = opts.merge(
351
+ :operation => :"TollFreeVerificationApi.list_webhook_subscriptions",
352
+ :header_params => header_params,
353
+ :query_params => query_params,
354
+ :form_params => form_params,
355
+ :body => post_body,
356
+ :auth_names => auth_names,
357
+ :return_type => return_type
358
+ )
359
+
360
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
361
+ if @api_client.config.debugging
362
+ @api_client.config.logger.debug "API called: TollFreeVerificationApi#list_webhook_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
363
+ end
364
+ return data, status_code, headers
365
+ end
366
+
367
+ # Request Toll-Free Verification
368
+ # Submit a request for verification of a toll-free phone number.
369
+ # @param account_id [String] Your Bandwidth Account ID.
370
+ # @param verification_request [VerificationRequest] Request for verification of a toll-free phone number.
371
+ # @param [Hash] opts the optional parameters
372
+ # @return [nil]
373
+ def request_toll_free_verification(account_id, verification_request, opts = {})
374
+ request_toll_free_verification_with_http_info(account_id, verification_request, opts)
375
+ nil
376
+ end
377
+
378
+ # Request Toll-Free Verification
379
+ # Submit a request for verification of a toll-free phone number.
380
+ # @param account_id [String] Your Bandwidth Account ID.
381
+ # @param verification_request [VerificationRequest] Request for verification of a toll-free phone number.
382
+ # @param [Hash] opts the optional parameters
383
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
384
+ def request_toll_free_verification_with_http_info(account_id, verification_request, opts = {})
385
+ if @api_client.config.debugging
386
+ @api_client.config.logger.debug 'Calling API: TollFreeVerificationApi.request_toll_free_verification ...'
387
+ end
388
+ # verify the required parameter 'account_id' is set
389
+ if @api_client.config.client_side_validation && account_id.nil?
390
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling TollFreeVerificationApi.request_toll_free_verification"
391
+ end
392
+ # verify the required parameter 'verification_request' is set
393
+ if @api_client.config.client_side_validation && verification_request.nil?
394
+ fail ArgumentError, "Missing the required parameter 'verification_request' when calling TollFreeVerificationApi.request_toll_free_verification"
395
+ end
396
+ # resource path
397
+ local_var_path = '/accounts/{accountId}/tollFreeVerification'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
398
+
399
+ # query parameters
400
+ query_params = opts[:query_params] || {}
401
+
402
+ # header parameters
403
+ header_params = opts[:header_params] || {}
404
+ # HTTP header 'Accept' (if needed)
405
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
406
+ # HTTP header 'Content-Type'
407
+ content_type = @api_client.select_header_content_type(['application/json'])
408
+ if !content_type.nil?
409
+ header_params['Content-Type'] = content_type
410
+ end
411
+
412
+ # form parameters
413
+ form_params = opts[:form_params] || {}
414
+
415
+ # http body (model)
416
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(verification_request)
417
+
418
+ # return_type
419
+ return_type = opts[:debug_return_type]
420
+
421
+ # auth_names
422
+ auth_names = opts[:debug_auth_names] || ['Basic']
423
+
424
+ new_options = opts.merge(
425
+ :operation => :"TollFreeVerificationApi.request_toll_free_verification",
426
+ :header_params => header_params,
427
+ :query_params => query_params,
428
+ :form_params => form_params,
429
+ :body => post_body,
430
+ :auth_names => auth_names,
431
+ :return_type => return_type
432
+ )
433
+
434
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
435
+ if @api_client.config.debugging
436
+ @api_client.config.logger.debug "API called: TollFreeVerificationApi#request_toll_free_verification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
437
+ end
438
+ return data, status_code, headers
439
+ end
440
+
441
+ # Update Toll-Free Verification Request
442
+ # Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true).
443
+ # @param account_id [String] Your Bandwidth Account ID.
444
+ # @param phone_number [String] Valid Toll-Free telephone number in E.164 format.
445
+ # @param tfv_submission_wrapper [TfvSubmissionWrapper] Update a request for verification of a toll-free phone number.
446
+ # @param [Hash] opts the optional parameters
447
+ # @return [nil]
448
+ def update_toll_free_verification_request(account_id, phone_number, tfv_submission_wrapper, opts = {})
449
+ update_toll_free_verification_request_with_http_info(account_id, phone_number, tfv_submission_wrapper, opts)
450
+ nil
451
+ end
452
+
453
+ # Update Toll-Free Verification Request
454
+ # Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true).
455
+ # @param account_id [String] Your Bandwidth Account ID.
456
+ # @param phone_number [String] Valid Toll-Free telephone number in E.164 format.
457
+ # @param tfv_submission_wrapper [TfvSubmissionWrapper] Update a request for verification of a toll-free phone number.
458
+ # @param [Hash] opts the optional parameters
459
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
460
+ def update_toll_free_verification_request_with_http_info(account_id, phone_number, tfv_submission_wrapper, opts = {})
461
+ if @api_client.config.debugging
462
+ @api_client.config.logger.debug 'Calling API: TollFreeVerificationApi.update_toll_free_verification_request ...'
463
+ end
464
+ # verify the required parameter 'account_id' is set
465
+ if @api_client.config.client_side_validation && account_id.nil?
466
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling TollFreeVerificationApi.update_toll_free_verification_request"
467
+ end
468
+ # verify the required parameter 'phone_number' is set
469
+ if @api_client.config.client_side_validation && phone_number.nil?
470
+ fail ArgumentError, "Missing the required parameter 'phone_number' when calling TollFreeVerificationApi.update_toll_free_verification_request"
471
+ end
472
+ if @api_client.config.client_side_validation && phone_number.to_s.length > 12
473
+ fail ArgumentError, 'invalid value for "phone_number" when calling TollFreeVerificationApi.update_toll_free_verification_request, the character length must be smaller than or equal to 12.'
474
+ end
475
+
476
+ if @api_client.config.client_side_validation && phone_number.to_s.length < 12
477
+ fail ArgumentError, 'invalid value for "phone_number" when calling TollFreeVerificationApi.update_toll_free_verification_request, the character length must be great than or equal to 12.'
478
+ end
479
+
480
+ pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/)
481
+ if @api_client.config.client_side_validation && phone_number !~ pattern
482
+ fail ArgumentError, "invalid value for 'phone_number' when calling TollFreeVerificationApi.update_toll_free_verification_request, must conform to the pattern #{pattern}."
483
+ end
484
+
485
+ # verify the required parameter 'tfv_submission_wrapper' is set
486
+ if @api_client.config.client_side_validation && tfv_submission_wrapper.nil?
487
+ fail ArgumentError, "Missing the required parameter 'tfv_submission_wrapper' when calling TollFreeVerificationApi.update_toll_free_verification_request"
488
+ end
489
+ # resource path
490
+ local_var_path = '/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'phoneNumber' + '}', CGI.escape(phone_number.to_s))
491
+
492
+ # query parameters
493
+ query_params = opts[:query_params] || {}
494
+
495
+ # header parameters
496
+ header_params = opts[:header_params] || {}
497
+ # HTTP header 'Accept' (if needed)
498
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
499
+ # HTTP header 'Content-Type'
500
+ content_type = @api_client.select_header_content_type(['application/json'])
501
+ if !content_type.nil?
502
+ header_params['Content-Type'] = content_type
503
+ end
504
+
505
+ # form parameters
506
+ form_params = opts[:form_params] || {}
507
+
508
+ # http body (model)
509
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(tfv_submission_wrapper)
510
+
511
+ # return_type
512
+ return_type = opts[:debug_return_type]
513
+
514
+ # auth_names
515
+ auth_names = opts[:debug_auth_names] || ['Basic']
516
+
517
+ new_options = opts.merge(
518
+ :operation => :"TollFreeVerificationApi.update_toll_free_verification_request",
519
+ :header_params => header_params,
520
+ :query_params => query_params,
521
+ :form_params => form_params,
522
+ :body => post_body,
523
+ :auth_names => auth_names,
524
+ :return_type => return_type
525
+ )
526
+
527
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
528
+ if @api_client.config.debugging
529
+ @api_client.config.logger.debug "API called: TollFreeVerificationApi#update_toll_free_verification_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
530
+ end
531
+ return data, status_code, headers
532
+ end
533
+
534
+ # Update Webhook Subscription
535
+ # Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated).
536
+ # @param account_id [String] Your Bandwidth Account ID.
537
+ # @param id [String] Webhook subscription ID
538
+ # @param webhook_subscription_request_schema [WebhookSubscriptionRequestSchema] Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
539
+ # @param [Hash] opts the optional parameters
540
+ # @return [WebhookSubscription]
541
+ def update_webhook_subscription(account_id, id, webhook_subscription_request_schema, opts = {})
542
+ data, _status_code, _headers = update_webhook_subscription_with_http_info(account_id, id, webhook_subscription_request_schema, opts)
543
+ data
544
+ end
545
+
546
+ # Update Webhook Subscription
547
+ # Update an existing webhook subscription (&#x60;callbackUrl&#x60; and &#x60;basicAuthentication&#x60; can be updated).
548
+ # @param account_id [String] Your Bandwidth Account ID.
549
+ # @param id [String] Webhook subscription ID
550
+ # @param webhook_subscription_request_schema [WebhookSubscriptionRequestSchema] Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
551
+ # @param [Hash] opts the optional parameters
552
+ # @return [Array<(WebhookSubscription, Integer, Hash)>] WebhookSubscription data, response status code and response headers
553
+ def update_webhook_subscription_with_http_info(account_id, id, webhook_subscription_request_schema, opts = {})
554
+ if @api_client.config.debugging
555
+ @api_client.config.logger.debug 'Calling API: TollFreeVerificationApi.update_webhook_subscription ...'
556
+ end
557
+ # verify the required parameter 'account_id' is set
558
+ if @api_client.config.client_side_validation && account_id.nil?
559
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling TollFreeVerificationApi.update_webhook_subscription"
560
+ end
561
+ # verify the required parameter 'id' is set
562
+ if @api_client.config.client_side_validation && id.nil?
563
+ fail ArgumentError, "Missing the required parameter 'id' when calling TollFreeVerificationApi.update_webhook_subscription"
564
+ end
565
+ # verify the required parameter 'webhook_subscription_request_schema' is set
566
+ if @api_client.config.client_side_validation && webhook_subscription_request_schema.nil?
567
+ fail ArgumentError, "Missing the required parameter 'webhook_subscription_request_schema' when calling TollFreeVerificationApi.update_webhook_subscription"
568
+ end
569
+ # resource path
570
+ local_var_path = '/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
571
+
572
+ # query parameters
573
+ query_params = opts[:query_params] || {}
574
+
575
+ # header parameters
576
+ header_params = opts[:header_params] || {}
577
+ # HTTP header 'Accept' (if needed)
578
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
579
+ # HTTP header 'Content-Type'
580
+ content_type = @api_client.select_header_content_type(['application/json'])
581
+ if !content_type.nil?
582
+ header_params['Content-Type'] = content_type
583
+ end
584
+
585
+ # form parameters
586
+ form_params = opts[:form_params] || {}
587
+
588
+ # http body (model)
589
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_subscription_request_schema)
590
+
591
+ # return_type
592
+ return_type = opts[:debug_return_type] || 'WebhookSubscription'
593
+
594
+ # auth_names
595
+ auth_names = opts[:debug_auth_names] || ['Basic']
596
+
597
+ new_options = opts.merge(
598
+ :operation => :"TollFreeVerificationApi.update_webhook_subscription",
599
+ :header_params => header_params,
600
+ :query_params => query_params,
601
+ :form_params => form_params,
602
+ :body => post_body,
603
+ :auth_names => auth_names,
604
+ :return_type => return_type
605
+ )
606
+
607
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
608
+ if @api_client.config.debugging
609
+ @api_client.config.logger.debug "API called: TollFreeVerificationApi#update_webhook_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
610
+ end
611
+ return data, status_code, headers
612
+ end
613
+ end
614
+ end
@@ -486,6 +486,54 @@ module Bandwidth
486
486
  description: "Production",
487
487
  }
488
488
  ],
489
+ "TollFreeVerificationApi.create_webhook_subscription": [
490
+ {
491
+ url: "https://api.bandwidth.com/api/v2",
492
+ description: "Production",
493
+ }
494
+ ],
495
+ "TollFreeVerificationApi.delete_webhook_subscription": [
496
+ {
497
+ url: "https://api.bandwidth.com/api/v2",
498
+ description: "Production",
499
+ }
500
+ ],
501
+ "TollFreeVerificationApi.get_toll_free_verification_status": [
502
+ {
503
+ url: "https://api.bandwidth.com/api/v2",
504
+ description: "Production",
505
+ }
506
+ ],
507
+ "TollFreeVerificationApi.list_toll_free_use_cases": [
508
+ {
509
+ url: "https://api.bandwidth.com/api/v2",
510
+ description: "Production",
511
+ }
512
+ ],
513
+ "TollFreeVerificationApi.list_webhook_subscriptions": [
514
+ {
515
+ url: "https://api.bandwidth.com/api/v2",
516
+ description: "Production",
517
+ }
518
+ ],
519
+ "TollFreeVerificationApi.request_toll_free_verification": [
520
+ {
521
+ url: "https://api.bandwidth.com/api/v2",
522
+ description: "Production",
523
+ }
524
+ ],
525
+ "TollFreeVerificationApi.update_toll_free_verification_request": [
526
+ {
527
+ url: "https://api.bandwidth.com/api/v2",
528
+ description: "Production",
529
+ }
530
+ ],
531
+ "TollFreeVerificationApi.update_webhook_subscription": [
532
+ {
533
+ url: "https://api.bandwidth.com/api/v2",
534
+ description: "Production",
535
+ }
536
+ ],
489
537
  "TranscriptionsApi.delete_real_time_transcription": [
490
538
  {
491
539
  url: "https://voice.bandwidth.com/api/v2",