bandwidth-sdk 7.1.0 → 9.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/lib/bandwidth/api_helper.rb +20 -17
  4. data/lib/bandwidth/configuration.rb +7 -19
  5. data/lib/bandwidth/http/faraday_client.rb +1 -1
  6. data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +53 -42
  7. data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +3 -5
  8. data/lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb +5 -2
  9. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb +31 -11
  10. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb +54 -25
  11. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb +65 -32
  12. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb +23 -4
  13. data/lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb +20 -4
  14. data/lib/bandwidth/messaging_lib/messaging/models/media.rb +23 -6
  15. data/lib/bandwidth/messaging_lib/messaging/models/message_request.rb +32 -14
  16. data/lib/bandwidth/messaging_lib/messaging/models/page_info.rb +28 -8
  17. data/lib/bandwidth/messaging_lib/messaging/models/tag.rb +20 -4
  18. data/lib/bandwidth/models/base_model.rb +11 -0
  19. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/base_controller.rb +3 -5
  20. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/mfa_controller.rb +21 -16
  21. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb +5 -2
  22. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/forbidden_request_exception.rb +4 -1
  23. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/unauthorized_request_exception.rb +4 -1
  24. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb +27 -12
  25. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_messaging_response.rb +17 -2
  26. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_code_response.rb +17 -2
  27. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb +29 -10
  28. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_voice_response.rb +17 -2
  29. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb +212 -210
  30. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb +3 -5
  31. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb +4 -1
  32. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb +17 -2
  33. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb +20 -4
  34. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb +28 -7
  35. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb +43 -18
  36. data/lib/bandwidth/utilities/date_time_helper.rb +2 -2
  37. data/lib/bandwidth/utilities/file_wrapper.rb +1 -2
  38. data/lib/bandwidth/voice_lib/bxml/verbs/ring.rb +2 -1
  39. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +173 -161
  40. data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +3 -5
  41. data/lib/bandwidth/voice_lib/voice/exceptions/api_error_exception.rb +6 -3
  42. data/lib/bandwidth/voice_lib/voice/models/call_callback.rb +343 -0
  43. data/lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb +78 -37
  44. data/lib/bandwidth/voice_lib/voice/models/call_state.rb +94 -42
  45. data/lib/bandwidth/voice_lib/voice/models/conference_callback.rb +211 -0
  46. data/lib/bandwidth/voice_lib/voice/models/conference_member_state.rb +35 -12
  47. data/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb +55 -24
  48. data/lib/bandwidth/voice_lib/voice/models/conference_state.rb +54 -17
  49. data/lib/bandwidth/voice_lib/voice/models/create_call_request.rb +173 -96
  50. data/lib/bandwidth/voice_lib/voice/models/create_call_response.rb +85 -41
  51. data/lib/bandwidth/voice_lib/voice/models/diversion.rb +80 -0
  52. data/lib/bandwidth/voice_lib/voice/models/fallback_method_enum.rb +17 -0
  53. data/lib/bandwidth/voice_lib/voice/models/machine_detection_configuration.rb +218 -0
  54. data/lib/bandwidth/voice_lib/voice/models/mode_enum.rb +20 -0
  55. data/lib/bandwidth/voice_lib/voice/models/modify_call_recording_request.rb +15 -2
  56. data/lib/bandwidth/voice_lib/voice/models/modify_call_request.rb +59 -19
  57. data/lib/bandwidth/voice_lib/voice/models/modify_conference_request.rb +55 -18
  58. data/lib/bandwidth/voice_lib/voice/models/transcribe_recording_request.rb +40 -12
  59. data/lib/bandwidth/voice_lib/voice/models/transcript.rb +20 -4
  60. data/lib/bandwidth/voice_lib/voice/models/transcription.rb +80 -0
  61. data/lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb +26 -8
  62. data/lib/bandwidth/voice_lib/voice/models/transcription_response.rb +18 -1
  63. data/lib/bandwidth/voice_lib/voice.rb +7 -1
  64. data/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb +5 -4
  65. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +61 -50
  66. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +3 -5
  67. data/lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb +5 -2
  68. data/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb +20 -5
  69. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb +37 -14
  70. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb +15 -2
  71. data/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb +20 -4
  72. data/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb +20 -3
  73. data/lib/bandwidth.rb +19 -18
  74. data/test/integration/test_integration.rb +110 -62
  75. metadata +13 -6
@@ -11,7 +11,7 @@ module PhoneNumberLookup
11
11
  super(config, http_call_back: http_call_back)
12
12
  end
13
13
 
14
- # Create a TN Lookup Order
14
+ # Create a TN Lookup Order.
15
15
  # @param [String] account_id Required parameter: The ID of the Bandwidth
16
16
  # account that the user belongs to.
17
17
  # @param [OrderRequest] body Required parameter: Example:
@@ -43,13 +43,14 @@ module PhoneNumberLookup
43
43
  _response = execute_request(_request)
44
44
 
45
45
  # Validate response against endpoint and global error codes.
46
- if _response.status_code == 400
46
+ case _response.status_code
47
+ when 400
47
48
  raise AccountsTnlookup400ErrorException.new(
48
49
  'Bad Request. Ensure that your request payload is properly' \
49
50
  ' formatted and that the telephone numbers used are valid.',
50
51
  _response
51
52
  )
52
- elsif _response.status_code == 401
53
+ when 401
53
54
  raise APIException.new(
54
55
  'Unauthorized. Ensure that you are using the proper credentials' \
55
56
  ' for the environment you are accessing, your user has' \
@@ -57,712 +58,712 @@ module PhoneNumberLookup
57
58
  ' Bandwidth account is enabled for TN Lookup access.',
58
59
  _response
59
60
  )
60
- elsif _response.status_code == 415
61
+ when 415
61
62
  raise APIException.new(
62
63
  'Invalid content-type. Ensure that your content-type header is set' \
63
64
  ' to application/json.',
64
65
  _response
65
66
  )
66
- elsif _response.status_code == 429
67
+ when 429
67
68
  raise APIException.new(
68
69
  'Too Many Requests. Reduce the amount of requests that you are' \
69
70
  ' sending in order to avoid receiving this status code.',
70
71
  _response
71
72
  )
72
- elsif _response.status_code == 500
73
+ when 500
73
74
  raise APIException.new(
74
75
  'Unexpected error. Please contact Bandwidth Support if your' \
75
76
  ' requests are receiving this status code for an' \
76
77
  ' extended period of time.',
77
78
  _response
78
79
  )
79
- elsif _response.status_code == 501
80
+ when 501
80
81
  raise APIException.new(
81
82
  'Unexpected error. Please contact Bandwidth Support if your' \
82
83
  ' requests are receiving this status code for an' \
83
84
  ' extended period of time.',
84
85
  _response
85
86
  )
86
- elsif _response.status_code == 502
87
+ when 502
87
88
  raise APIException.new(
88
89
  'Unexpected error. Please contact Bandwidth Support if your' \
89
90
  ' requests are receiving this status code for an' \
90
91
  ' extended period of time.',
91
92
  _response
92
93
  )
93
- elsif _response.status_code == 503
94
+ when 503
94
95
  raise APIException.new(
95
96
  'Unexpected error. Please contact Bandwidth Support if your' \
96
97
  ' requests are receiving this status code for an' \
97
98
  ' extended period of time.',
98
99
  _response
99
100
  )
100
- elsif _response.status_code == 504
101
+ when 504
101
102
  raise APIException.new(
102
103
  'Unexpected error. Please contact Bandwidth Support if your' \
103
104
  ' requests are receiving this status code for an' \
104
105
  ' extended period of time.',
105
106
  _response
106
107
  )
107
- elsif _response.status_code == 505
108
+ when 505
108
109
  raise APIException.new(
109
110
  'Unexpected error. Please contact Bandwidth Support if your' \
110
111
  ' requests are receiving this status code for an' \
111
112
  ' extended period of time.',
112
113
  _response
113
114
  )
114
- elsif _response.status_code == 506
115
+ when 506
115
116
  raise APIException.new(
116
117
  'Unexpected error. Please contact Bandwidth Support if your' \
117
118
  ' requests are receiving this status code for an' \
118
119
  ' extended period of time.',
119
120
  _response
120
121
  )
121
- elsif _response.status_code == 507
122
+ when 507
122
123
  raise APIException.new(
123
124
  'Unexpected error. Please contact Bandwidth Support if your' \
124
125
  ' requests are receiving this status code for an' \
125
126
  ' extended period of time.',
126
127
  _response
127
128
  )
128
- elsif _response.status_code == 508
129
+ when 508
129
130
  raise APIException.new(
130
131
  'Unexpected error. Please contact Bandwidth Support if your' \
131
132
  ' requests are receiving this status code for an' \
132
133
  ' extended period of time.',
133
134
  _response
134
135
  )
135
- elsif _response.status_code == 509
136
+ when 509
136
137
  raise APIException.new(
137
138
  'Unexpected error. Please contact Bandwidth Support if your' \
138
139
  ' requests are receiving this status code for an' \
139
140
  ' extended period of time.',
140
141
  _response
141
142
  )
142
- elsif _response.status_code == 510
143
+ when 510
143
144
  raise APIException.new(
144
145
  'Unexpected error. Please contact Bandwidth Support if your' \
145
146
  ' requests are receiving this status code for an' \
146
147
  ' extended period of time.',
147
148
  _response
148
149
  )
149
- elsif _response.status_code == 511
150
+ when 511
150
151
  raise APIException.new(
151
152
  'Unexpected error. Please contact Bandwidth Support if your' \
152
153
  ' requests are receiving this status code for an' \
153
154
  ' extended period of time.',
154
155
  _response
155
156
  )
156
- elsif _response.status_code == 512
157
+ when 512
157
158
  raise APIException.new(
158
159
  'Unexpected error. Please contact Bandwidth Support if your' \
159
160
  ' requests are receiving this status code for an' \
160
161
  ' extended period of time.',
161
162
  _response
162
163
  )
163
- elsif _response.status_code == 513
164
+ when 513
164
165
  raise APIException.new(
165
166
  'Unexpected error. Please contact Bandwidth Support if your' \
166
167
  ' requests are receiving this status code for an' \
167
168
  ' extended period of time.',
168
169
  _response
169
170
  )
170
- elsif _response.status_code == 514
171
+ when 514
171
172
  raise APIException.new(
172
173
  'Unexpected error. Please contact Bandwidth Support if your' \
173
174
  ' requests are receiving this status code for an' \
174
175
  ' extended period of time.',
175
176
  _response
176
177
  )
177
- elsif _response.status_code == 515
178
+ when 515
178
179
  raise APIException.new(
179
180
  'Unexpected error. Please contact Bandwidth Support if your' \
180
181
  ' requests are receiving this status code for an' \
181
182
  ' extended period of time.',
182
183
  _response
183
184
  )
184
- elsif _response.status_code == 516
185
+ when 516
185
186
  raise APIException.new(
186
187
  'Unexpected error. Please contact Bandwidth Support if your' \
187
188
  ' requests are receiving this status code for an' \
188
189
  ' extended period of time.',
189
190
  _response
190
191
  )
191
- elsif _response.status_code == 517
192
+ when 517
192
193
  raise APIException.new(
193
194
  'Unexpected error. Please contact Bandwidth Support if your' \
194
195
  ' requests are receiving this status code for an' \
195
196
  ' extended period of time.',
196
197
  _response
197
198
  )
198
- elsif _response.status_code == 518
199
+ when 518
199
200
  raise APIException.new(
200
201
  'Unexpected error. Please contact Bandwidth Support if your' \
201
202
  ' requests are receiving this status code for an' \
202
203
  ' extended period of time.',
203
204
  _response
204
205
  )
205
- elsif _response.status_code == 519
206
+ when 519
206
207
  raise APIException.new(
207
208
  'Unexpected error. Please contact Bandwidth Support if your' \
208
209
  ' requests are receiving this status code for an' \
209
210
  ' extended period of time.',
210
211
  _response
211
212
  )
212
- elsif _response.status_code == 520
213
+ when 520
213
214
  raise APIException.new(
214
215
  'Unexpected error. Please contact Bandwidth Support if your' \
215
216
  ' requests are receiving this status code for an' \
216
217
  ' extended period of time.',
217
218
  _response
218
219
  )
219
- elsif _response.status_code == 521
220
+ when 521
220
221
  raise APIException.new(
221
222
  'Unexpected error. Please contact Bandwidth Support if your' \
222
223
  ' requests are receiving this status code for an' \
223
224
  ' extended period of time.',
224
225
  _response
225
226
  )
226
- elsif _response.status_code == 522
227
+ when 522
227
228
  raise APIException.new(
228
229
  'Unexpected error. Please contact Bandwidth Support if your' \
229
230
  ' requests are receiving this status code for an' \
230
231
  ' extended period of time.',
231
232
  _response
232
233
  )
233
- elsif _response.status_code == 523
234
+ when 523
234
235
  raise APIException.new(
235
236
  'Unexpected error. Please contact Bandwidth Support if your' \
236
237
  ' requests are receiving this status code for an' \
237
238
  ' extended period of time.',
238
239
  _response
239
240
  )
240
- elsif _response.status_code == 524
241
+ when 524
241
242
  raise APIException.new(
242
243
  'Unexpected error. Please contact Bandwidth Support if your' \
243
244
  ' requests are receiving this status code for an' \
244
245
  ' extended period of time.',
245
246
  _response
246
247
  )
247
- elsif _response.status_code == 525
248
+ when 525
248
249
  raise APIException.new(
249
250
  'Unexpected error. Please contact Bandwidth Support if your' \
250
251
  ' requests are receiving this status code for an' \
251
252
  ' extended period of time.',
252
253
  _response
253
254
  )
254
- elsif _response.status_code == 526
255
+ when 526
255
256
  raise APIException.new(
256
257
  'Unexpected error. Please contact Bandwidth Support if your' \
257
258
  ' requests are receiving this status code for an' \
258
259
  ' extended period of time.',
259
260
  _response
260
261
  )
261
- elsif _response.status_code == 527
262
+ when 527
262
263
  raise APIException.new(
263
264
  'Unexpected error. Please contact Bandwidth Support if your' \
264
265
  ' requests are receiving this status code for an' \
265
266
  ' extended period of time.',
266
267
  _response
267
268
  )
268
- elsif _response.status_code == 528
269
+ when 528
269
270
  raise APIException.new(
270
271
  'Unexpected error. Please contact Bandwidth Support if your' \
271
272
  ' requests are receiving this status code for an' \
272
273
  ' extended period of time.',
273
274
  _response
274
275
  )
275
- elsif _response.status_code == 529
276
+ when 529
276
277
  raise APIException.new(
277
278
  'Unexpected error. Please contact Bandwidth Support if your' \
278
279
  ' requests are receiving this status code for an' \
279
280
  ' extended period of time.',
280
281
  _response
281
282
  )
282
- elsif _response.status_code == 530
283
+ when 530
283
284
  raise APIException.new(
284
285
  'Unexpected error. Please contact Bandwidth Support if your' \
285
286
  ' requests are receiving this status code for an' \
286
287
  ' extended period of time.',
287
288
  _response
288
289
  )
289
- elsif _response.status_code == 531
290
+ when 531
290
291
  raise APIException.new(
291
292
  'Unexpected error. Please contact Bandwidth Support if your' \
292
293
  ' requests are receiving this status code for an' \
293
294
  ' extended period of time.',
294
295
  _response
295
296
  )
296
- elsif _response.status_code == 532
297
+ when 532
297
298
  raise APIException.new(
298
299
  'Unexpected error. Please contact Bandwidth Support if your' \
299
300
  ' requests are receiving this status code for an' \
300
301
  ' extended period of time.',
301
302
  _response
302
303
  )
303
- elsif _response.status_code == 533
304
+ when 533
304
305
  raise APIException.new(
305
306
  'Unexpected error. Please contact Bandwidth Support if your' \
306
307
  ' requests are receiving this status code for an' \
307
308
  ' extended period of time.',
308
309
  _response
309
310
  )
310
- elsif _response.status_code == 534
311
+ when 534
311
312
  raise APIException.new(
312
313
  'Unexpected error. Please contact Bandwidth Support if your' \
313
314
  ' requests are receiving this status code for an' \
314
315
  ' extended period of time.',
315
316
  _response
316
317
  )
317
- elsif _response.status_code == 535
318
+ when 535
318
319
  raise APIException.new(
319
320
  'Unexpected error. Please contact Bandwidth Support if your' \
320
321
  ' requests are receiving this status code for an' \
321
322
  ' extended period of time.',
322
323
  _response
323
324
  )
324
- elsif _response.status_code == 536
325
+ when 536
325
326
  raise APIException.new(
326
327
  'Unexpected error. Please contact Bandwidth Support if your' \
327
328
  ' requests are receiving this status code for an' \
328
329
  ' extended period of time.',
329
330
  _response
330
331
  )
331
- elsif _response.status_code == 537
332
+ when 537
332
333
  raise APIException.new(
333
334
  'Unexpected error. Please contact Bandwidth Support if your' \
334
335
  ' requests are receiving this status code for an' \
335
336
  ' extended period of time.',
336
337
  _response
337
338
  )
338
- elsif _response.status_code == 538
339
+ when 538
339
340
  raise APIException.new(
340
341
  'Unexpected error. Please contact Bandwidth Support if your' \
341
342
  ' requests are receiving this status code for an' \
342
343
  ' extended period of time.',
343
344
  _response
344
345
  )
345
- elsif _response.status_code == 539
346
+ when 539
346
347
  raise APIException.new(
347
348
  'Unexpected error. Please contact Bandwidth Support if your' \
348
349
  ' requests are receiving this status code for an' \
349
350
  ' extended period of time.',
350
351
  _response
351
352
  )
352
- elsif _response.status_code == 540
353
+ when 540
353
354
  raise APIException.new(
354
355
  'Unexpected error. Please contact Bandwidth Support if your' \
355
356
  ' requests are receiving this status code for an' \
356
357
  ' extended period of time.',
357
358
  _response
358
359
  )
359
- elsif _response.status_code == 541
360
+ when 541
360
361
  raise APIException.new(
361
362
  'Unexpected error. Please contact Bandwidth Support if your' \
362
363
  ' requests are receiving this status code for an' \
363
364
  ' extended period of time.',
364
365
  _response
365
366
  )
366
- elsif _response.status_code == 542
367
+ when 542
367
368
  raise APIException.new(
368
369
  'Unexpected error. Please contact Bandwidth Support if your' \
369
370
  ' requests are receiving this status code for an' \
370
371
  ' extended period of time.',
371
372
  _response
372
373
  )
373
- elsif _response.status_code == 543
374
+ when 543
374
375
  raise APIException.new(
375
376
  'Unexpected error. Please contact Bandwidth Support if your' \
376
377
  ' requests are receiving this status code for an' \
377
378
  ' extended period of time.',
378
379
  _response
379
380
  )
380
- elsif _response.status_code == 544
381
+ when 544
381
382
  raise APIException.new(
382
383
  'Unexpected error. Please contact Bandwidth Support if your' \
383
384
  ' requests are receiving this status code for an' \
384
385
  ' extended period of time.',
385
386
  _response
386
387
  )
387
- elsif _response.status_code == 545
388
+ when 545
388
389
  raise APIException.new(
389
390
  'Unexpected error. Please contact Bandwidth Support if your' \
390
391
  ' requests are receiving this status code for an' \
391
392
  ' extended period of time.',
392
393
  _response
393
394
  )
394
- elsif _response.status_code == 546
395
+ when 546
395
396
  raise APIException.new(
396
397
  'Unexpected error. Please contact Bandwidth Support if your' \
397
398
  ' requests are receiving this status code for an' \
398
399
  ' extended period of time.',
399
400
  _response
400
401
  )
401
- elsif _response.status_code == 547
402
+ when 547
402
403
  raise APIException.new(
403
404
  'Unexpected error. Please contact Bandwidth Support if your' \
404
405
  ' requests are receiving this status code for an' \
405
406
  ' extended period of time.',
406
407
  _response
407
408
  )
408
- elsif _response.status_code == 548
409
+ when 548
409
410
  raise APIException.new(
410
411
  'Unexpected error. Please contact Bandwidth Support if your' \
411
412
  ' requests are receiving this status code for an' \
412
413
  ' extended period of time.',
413
414
  _response
414
415
  )
415
- elsif _response.status_code == 549
416
+ when 549
416
417
  raise APIException.new(
417
418
  'Unexpected error. Please contact Bandwidth Support if your' \
418
419
  ' requests are receiving this status code for an' \
419
420
  ' extended period of time.',
420
421
  _response
421
422
  )
422
- elsif _response.status_code == 550
423
+ when 550
423
424
  raise APIException.new(
424
425
  'Unexpected error. Please contact Bandwidth Support if your' \
425
426
  ' requests are receiving this status code for an' \
426
427
  ' extended period of time.',
427
428
  _response
428
429
  )
429
- elsif _response.status_code == 551
430
+ when 551
430
431
  raise APIException.new(
431
432
  'Unexpected error. Please contact Bandwidth Support if your' \
432
433
  ' requests are receiving this status code for an' \
433
434
  ' extended period of time.',
434
435
  _response
435
436
  )
436
- elsif _response.status_code == 552
437
+ when 552
437
438
  raise APIException.new(
438
439
  'Unexpected error. Please contact Bandwidth Support if your' \
439
440
  ' requests are receiving this status code for an' \
440
441
  ' extended period of time.',
441
442
  _response
442
443
  )
443
- elsif _response.status_code == 553
444
+ when 553
444
445
  raise APIException.new(
445
446
  'Unexpected error. Please contact Bandwidth Support if your' \
446
447
  ' requests are receiving this status code for an' \
447
448
  ' extended period of time.',
448
449
  _response
449
450
  )
450
- elsif _response.status_code == 554
451
+ when 554
451
452
  raise APIException.new(
452
453
  'Unexpected error. Please contact Bandwidth Support if your' \
453
454
  ' requests are receiving this status code for an' \
454
455
  ' extended period of time.',
455
456
  _response
456
457
  )
457
- elsif _response.status_code == 555
458
+ when 555
458
459
  raise APIException.new(
459
460
  'Unexpected error. Please contact Bandwidth Support if your' \
460
461
  ' requests are receiving this status code for an' \
461
462
  ' extended period of time.',
462
463
  _response
463
464
  )
464
- elsif _response.status_code == 556
465
+ when 556
465
466
  raise APIException.new(
466
467
  'Unexpected error. Please contact Bandwidth Support if your' \
467
468
  ' requests are receiving this status code for an' \
468
469
  ' extended period of time.',
469
470
  _response
470
471
  )
471
- elsif _response.status_code == 557
472
+ when 557
472
473
  raise APIException.new(
473
474
  'Unexpected error. Please contact Bandwidth Support if your' \
474
475
  ' requests are receiving this status code for an' \
475
476
  ' extended period of time.',
476
477
  _response
477
478
  )
478
- elsif _response.status_code == 558
479
+ when 558
479
480
  raise APIException.new(
480
481
  'Unexpected error. Please contact Bandwidth Support if your' \
481
482
  ' requests are receiving this status code for an' \
482
483
  ' extended period of time.',
483
484
  _response
484
485
  )
485
- elsif _response.status_code == 559
486
+ when 559
486
487
  raise APIException.new(
487
488
  'Unexpected error. Please contact Bandwidth Support if your' \
488
489
  ' requests are receiving this status code for an' \
489
490
  ' extended period of time.',
490
491
  _response
491
492
  )
492
- elsif _response.status_code == 560
493
+ when 560
493
494
  raise APIException.new(
494
495
  'Unexpected error. Please contact Bandwidth Support if your' \
495
496
  ' requests are receiving this status code for an' \
496
497
  ' extended period of time.',
497
498
  _response
498
499
  )
499
- elsif _response.status_code == 561
500
+ when 561
500
501
  raise APIException.new(
501
502
  'Unexpected error. Please contact Bandwidth Support if your' \
502
503
  ' requests are receiving this status code for an' \
503
504
  ' extended period of time.',
504
505
  _response
505
506
  )
506
- elsif _response.status_code == 562
507
+ when 562
507
508
  raise APIException.new(
508
509
  'Unexpected error. Please contact Bandwidth Support if your' \
509
510
  ' requests are receiving this status code for an' \
510
511
  ' extended period of time.',
511
512
  _response
512
513
  )
513
- elsif _response.status_code == 563
514
+ when 563
514
515
  raise APIException.new(
515
516
  'Unexpected error. Please contact Bandwidth Support if your' \
516
517
  ' requests are receiving this status code for an' \
517
518
  ' extended period of time.',
518
519
  _response
519
520
  )
520
- elsif _response.status_code == 564
521
+ when 564
521
522
  raise APIException.new(
522
523
  'Unexpected error. Please contact Bandwidth Support if your' \
523
524
  ' requests are receiving this status code for an' \
524
525
  ' extended period of time.',
525
526
  _response
526
527
  )
527
- elsif _response.status_code == 565
528
+ when 565
528
529
  raise APIException.new(
529
530
  'Unexpected error. Please contact Bandwidth Support if your' \
530
531
  ' requests are receiving this status code for an' \
531
532
  ' extended period of time.',
532
533
  _response
533
534
  )
534
- elsif _response.status_code == 566
535
+ when 566
535
536
  raise APIException.new(
536
537
  'Unexpected error. Please contact Bandwidth Support if your' \
537
538
  ' requests are receiving this status code for an' \
538
539
  ' extended period of time.',
539
540
  _response
540
541
  )
541
- elsif _response.status_code == 567
542
+ when 567
542
543
  raise APIException.new(
543
544
  'Unexpected error. Please contact Bandwidth Support if your' \
544
545
  ' requests are receiving this status code for an' \
545
546
  ' extended period of time.',
546
547
  _response
547
548
  )
548
- elsif _response.status_code == 568
549
+ when 568
549
550
  raise APIException.new(
550
551
  'Unexpected error. Please contact Bandwidth Support if your' \
551
552
  ' requests are receiving this status code for an' \
552
553
  ' extended period of time.',
553
554
  _response
554
555
  )
555
- elsif _response.status_code == 569
556
+ when 569
556
557
  raise APIException.new(
557
558
  'Unexpected error. Please contact Bandwidth Support if your' \
558
559
  ' requests are receiving this status code for an' \
559
560
  ' extended period of time.',
560
561
  _response
561
562
  )
562
- elsif _response.status_code == 570
563
+ when 570
563
564
  raise APIException.new(
564
565
  'Unexpected error. Please contact Bandwidth Support if your' \
565
566
  ' requests are receiving this status code for an' \
566
567
  ' extended period of time.',
567
568
  _response
568
569
  )
569
- elsif _response.status_code == 571
570
+ when 571
570
571
  raise APIException.new(
571
572
  'Unexpected error. Please contact Bandwidth Support if your' \
572
573
  ' requests are receiving this status code for an' \
573
574
  ' extended period of time.',
574
575
  _response
575
576
  )
576
- elsif _response.status_code == 572
577
+ when 572
577
578
  raise APIException.new(
578
579
  'Unexpected error. Please contact Bandwidth Support if your' \
579
580
  ' requests are receiving this status code for an' \
580
581
  ' extended period of time.',
581
582
  _response
582
583
  )
583
- elsif _response.status_code == 573
584
+ when 573
584
585
  raise APIException.new(
585
586
  'Unexpected error. Please contact Bandwidth Support if your' \
586
587
  ' requests are receiving this status code for an' \
587
588
  ' extended period of time.',
588
589
  _response
589
590
  )
590
- elsif _response.status_code == 574
591
+ when 574
591
592
  raise APIException.new(
592
593
  'Unexpected error. Please contact Bandwidth Support if your' \
593
594
  ' requests are receiving this status code for an' \
594
595
  ' extended period of time.',
595
596
  _response
596
597
  )
597
- elsif _response.status_code == 575
598
+ when 575
598
599
  raise APIException.new(
599
600
  'Unexpected error. Please contact Bandwidth Support if your' \
600
601
  ' requests are receiving this status code for an' \
601
602
  ' extended period of time.',
602
603
  _response
603
604
  )
604
- elsif _response.status_code == 576
605
+ when 576
605
606
  raise APIException.new(
606
607
  'Unexpected error. Please contact Bandwidth Support if your' \
607
608
  ' requests are receiving this status code for an' \
608
609
  ' extended period of time.',
609
610
  _response
610
611
  )
611
- elsif _response.status_code == 577
612
+ when 577
612
613
  raise APIException.new(
613
614
  'Unexpected error. Please contact Bandwidth Support if your' \
614
615
  ' requests are receiving this status code for an' \
615
616
  ' extended period of time.',
616
617
  _response
617
618
  )
618
- elsif _response.status_code == 578
619
+ when 578
619
620
  raise APIException.new(
620
621
  'Unexpected error. Please contact Bandwidth Support if your' \
621
622
  ' requests are receiving this status code for an' \
622
623
  ' extended period of time.',
623
624
  _response
624
625
  )
625
- elsif _response.status_code == 579
626
+ when 579
626
627
  raise APIException.new(
627
628
  'Unexpected error. Please contact Bandwidth Support if your' \
628
629
  ' requests are receiving this status code for an' \
629
630
  ' extended period of time.',
630
631
  _response
631
632
  )
632
- elsif _response.status_code == 580
633
+ when 580
633
634
  raise APIException.new(
634
635
  'Unexpected error. Please contact Bandwidth Support if your' \
635
636
  ' requests are receiving this status code for an' \
636
637
  ' extended period of time.',
637
638
  _response
638
639
  )
639
- elsif _response.status_code == 581
640
+ when 581
640
641
  raise APIException.new(
641
642
  'Unexpected error. Please contact Bandwidth Support if your' \
642
643
  ' requests are receiving this status code for an' \
643
644
  ' extended period of time.',
644
645
  _response
645
646
  )
646
- elsif _response.status_code == 582
647
+ when 582
647
648
  raise APIException.new(
648
649
  'Unexpected error. Please contact Bandwidth Support if your' \
649
650
  ' requests are receiving this status code for an' \
650
651
  ' extended period of time.',
651
652
  _response
652
653
  )
653
- elsif _response.status_code == 583
654
+ when 583
654
655
  raise APIException.new(
655
656
  'Unexpected error. Please contact Bandwidth Support if your' \
656
657
  ' requests are receiving this status code for an' \
657
658
  ' extended period of time.',
658
659
  _response
659
660
  )
660
- elsif _response.status_code == 584
661
+ when 584
661
662
  raise APIException.new(
662
663
  'Unexpected error. Please contact Bandwidth Support if your' \
663
664
  ' requests are receiving this status code for an' \
664
665
  ' extended period of time.',
665
666
  _response
666
667
  )
667
- elsif _response.status_code == 585
668
+ when 585
668
669
  raise APIException.new(
669
670
  'Unexpected error. Please contact Bandwidth Support if your' \
670
671
  ' requests are receiving this status code for an' \
671
672
  ' extended period of time.',
672
673
  _response
673
674
  )
674
- elsif _response.status_code == 586
675
+ when 586
675
676
  raise APIException.new(
676
677
  'Unexpected error. Please contact Bandwidth Support if your' \
677
678
  ' requests are receiving this status code for an' \
678
679
  ' extended period of time.',
679
680
  _response
680
681
  )
681
- elsif _response.status_code == 587
682
+ when 587
682
683
  raise APIException.new(
683
684
  'Unexpected error. Please contact Bandwidth Support if your' \
684
685
  ' requests are receiving this status code for an' \
685
686
  ' extended period of time.',
686
687
  _response
687
688
  )
688
- elsif _response.status_code == 588
689
+ when 588
689
690
  raise APIException.new(
690
691
  'Unexpected error. Please contact Bandwidth Support if your' \
691
692
  ' requests are receiving this status code for an' \
692
693
  ' extended period of time.',
693
694
  _response
694
695
  )
695
- elsif _response.status_code == 589
696
+ when 589
696
697
  raise APIException.new(
697
698
  'Unexpected error. Please contact Bandwidth Support if your' \
698
699
  ' requests are receiving this status code for an' \
699
700
  ' extended period of time.',
700
701
  _response
701
702
  )
702
- elsif _response.status_code == 590
703
+ when 590
703
704
  raise APIException.new(
704
705
  'Unexpected error. Please contact Bandwidth Support if your' \
705
706
  ' requests are receiving this status code for an' \
706
707
  ' extended period of time.',
707
708
  _response
708
709
  )
709
- elsif _response.status_code == 591
710
+ when 591
710
711
  raise APIException.new(
711
712
  'Unexpected error. Please contact Bandwidth Support if your' \
712
713
  ' requests are receiving this status code for an' \
713
714
  ' extended period of time.',
714
715
  _response
715
716
  )
716
- elsif _response.status_code == 592
717
+ when 592
717
718
  raise APIException.new(
718
719
  'Unexpected error. Please contact Bandwidth Support if your' \
719
720
  ' requests are receiving this status code for an' \
720
721
  ' extended period of time.',
721
722
  _response
722
723
  )
723
- elsif _response.status_code == 593
724
+ when 593
724
725
  raise APIException.new(
725
726
  'Unexpected error. Please contact Bandwidth Support if your' \
726
727
  ' requests are receiving this status code for an' \
727
728
  ' extended period of time.',
728
729
  _response
729
730
  )
730
- elsif _response.status_code == 594
731
+ when 594
731
732
  raise APIException.new(
732
733
  'Unexpected error. Please contact Bandwidth Support if your' \
733
734
  ' requests are receiving this status code for an' \
734
735
  ' extended period of time.',
735
736
  _response
736
737
  )
737
- elsif _response.status_code == 595
738
+ when 595
738
739
  raise APIException.new(
739
740
  'Unexpected error. Please contact Bandwidth Support if your' \
740
741
  ' requests are receiving this status code for an' \
741
742
  ' extended period of time.',
742
743
  _response
743
744
  )
744
- elsif _response.status_code == 596
745
+ when 596
745
746
  raise APIException.new(
746
747
  'Unexpected error. Please contact Bandwidth Support if your' \
747
748
  ' requests are receiving this status code for an' \
748
749
  ' extended period of time.',
749
750
  _response
750
751
  )
751
- elsif _response.status_code == 597
752
+ when 597
752
753
  raise APIException.new(
753
754
  'Unexpected error. Please contact Bandwidth Support if your' \
754
755
  ' requests are receiving this status code for an' \
755
756
  ' extended period of time.',
756
757
  _response
757
758
  )
758
- elsif _response.status_code == 598
759
+ when 598
759
760
  raise APIException.new(
760
761
  'Unexpected error. Please contact Bandwidth Support if your' \
761
762
  ' requests are receiving this status code for an' \
762
763
  ' extended period of time.',
763
764
  _response
764
765
  )
765
- elsif _response.status_code == 599
766
+ when 599
766
767
  raise APIException.new(
767
768
  'Unexpected error. Please contact Bandwidth Support if your' \
768
769
  ' requests are receiving this status code for an' \
@@ -779,7 +780,7 @@ module PhoneNumberLookup
779
780
  )
780
781
  end
781
782
 
782
- # Query an existing TN Lookup Order
783
+ # Query an existing TN Lookup Order.
783
784
  # @param [String] account_id Required parameter: The ID of the Bandwidth
784
785
  # account that the user belongs to.
785
786
  # @param [String] request_id Required parameter: Example:
@@ -810,13 +811,14 @@ module PhoneNumberLookup
810
811
  _response = execute_request(_request)
811
812
 
812
813
  # Validate response against endpoint and global error codes.
813
- if _response.status_code == 400
814
+ case _response.status_code
815
+ when 400
814
816
  raise APIException.new(
815
817
  'Bad Request. Ensure that you have set the requestId as a URL path' \
816
818
  ' parameter.',
817
819
  _response
818
820
  )
819
- elsif _response.status_code == 401
821
+ when 401
820
822
  raise APIException.new(
821
823
  'Unauthorized. Ensure that you are using the proper credentials' \
822
824
  ' for the environment you are accessing, your user has' \
@@ -824,713 +826,713 @@ module PhoneNumberLookup
824
826
  ' Bandwidth account is enabled for TN Lookup access.',
825
827
  _response
826
828
  )
827
- elsif _response.status_code == 404
829
+ when 404
828
830
  raise APIException.new(
829
831
  'RequestId not found. Ensure that the requestId used in the URL' \
830
832
  ' path is valid and maps to a previous request that was' \
831
833
  ' submitted.',
832
834
  _response
833
835
  )
834
- elsif _response.status_code == 429
836
+ when 429
835
837
  raise APIException.new(
836
838
  'Too Many Requests. Reduce the amount of requests that you are' \
837
839
  ' sending in order to avoid receiving this status code.',
838
840
  _response
839
841
  )
840
- elsif _response.status_code == 500
842
+ when 500
841
843
  raise APIException.new(
842
844
  'Unexpected error. Please contact Bandwidth Support if your' \
843
845
  ' requests are receiving this status code for an' \
844
846
  ' extended period of time.',
845
847
  _response
846
848
  )
847
- elsif _response.status_code == 501
849
+ when 501
848
850
  raise APIException.new(
849
851
  'Unexpected error. Please contact Bandwidth Support if your' \
850
852
  ' requests are receiving this status code for an' \
851
853
  ' extended period of time.',
852
854
  _response
853
855
  )
854
- elsif _response.status_code == 502
856
+ when 502
855
857
  raise APIException.new(
856
858
  'Unexpected error. Please contact Bandwidth Support if your' \
857
859
  ' requests are receiving this status code for an' \
858
860
  ' extended period of time.',
859
861
  _response
860
862
  )
861
- elsif _response.status_code == 503
863
+ when 503
862
864
  raise APIException.new(
863
865
  'Unexpected error. Please contact Bandwidth Support if your' \
864
866
  ' requests are receiving this status code for an' \
865
867
  ' extended period of time.',
866
868
  _response
867
869
  )
868
- elsif _response.status_code == 504
870
+ when 504
869
871
  raise APIException.new(
870
872
  'Unexpected error. Please contact Bandwidth Support if your' \
871
873
  ' requests are receiving this status code for an' \
872
874
  ' extended period of time.',
873
875
  _response
874
876
  )
875
- elsif _response.status_code == 505
877
+ when 505
876
878
  raise APIException.new(
877
879
  'Unexpected error. Please contact Bandwidth Support if your' \
878
880
  ' requests are receiving this status code for an' \
879
881
  ' extended period of time.',
880
882
  _response
881
883
  )
882
- elsif _response.status_code == 506
884
+ when 506
883
885
  raise APIException.new(
884
886
  'Unexpected error. Please contact Bandwidth Support if your' \
885
887
  ' requests are receiving this status code for an' \
886
888
  ' extended period of time.',
887
889
  _response
888
890
  )
889
- elsif _response.status_code == 507
891
+ when 507
890
892
  raise APIException.new(
891
893
  'Unexpected error. Please contact Bandwidth Support if your' \
892
894
  ' requests are receiving this status code for an' \
893
895
  ' extended period of time.',
894
896
  _response
895
897
  )
896
- elsif _response.status_code == 508
898
+ when 508
897
899
  raise APIException.new(
898
900
  'Unexpected error. Please contact Bandwidth Support if your' \
899
901
  ' requests are receiving this status code for an' \
900
902
  ' extended period of time.',
901
903
  _response
902
904
  )
903
- elsif _response.status_code == 509
905
+ when 509
904
906
  raise APIException.new(
905
907
  'Unexpected error. Please contact Bandwidth Support if your' \
906
908
  ' requests are receiving this status code for an' \
907
909
  ' extended period of time.',
908
910
  _response
909
911
  )
910
- elsif _response.status_code == 510
912
+ when 510
911
913
  raise APIException.new(
912
914
  'Unexpected error. Please contact Bandwidth Support if your' \
913
915
  ' requests are receiving this status code for an' \
914
916
  ' extended period of time.',
915
917
  _response
916
918
  )
917
- elsif _response.status_code == 511
919
+ when 511
918
920
  raise APIException.new(
919
921
  'Unexpected error. Please contact Bandwidth Support if your' \
920
922
  ' requests are receiving this status code for an' \
921
923
  ' extended period of time.',
922
924
  _response
923
925
  )
924
- elsif _response.status_code == 512
926
+ when 512
925
927
  raise APIException.new(
926
928
  'Unexpected error. Please contact Bandwidth Support if your' \
927
929
  ' requests are receiving this status code for an' \
928
930
  ' extended period of time.',
929
931
  _response
930
932
  )
931
- elsif _response.status_code == 513
933
+ when 513
932
934
  raise APIException.new(
933
935
  'Unexpected error. Please contact Bandwidth Support if your' \
934
936
  ' requests are receiving this status code for an' \
935
937
  ' extended period of time.',
936
938
  _response
937
939
  )
938
- elsif _response.status_code == 514
940
+ when 514
939
941
  raise APIException.new(
940
942
  'Unexpected error. Please contact Bandwidth Support if your' \
941
943
  ' requests are receiving this status code for an' \
942
944
  ' extended period of time.',
943
945
  _response
944
946
  )
945
- elsif _response.status_code == 515
947
+ when 515
946
948
  raise APIException.new(
947
949
  'Unexpected error. Please contact Bandwidth Support if your' \
948
950
  ' requests are receiving this status code for an' \
949
951
  ' extended period of time.',
950
952
  _response
951
953
  )
952
- elsif _response.status_code == 516
954
+ when 516
953
955
  raise APIException.new(
954
956
  'Unexpected error. Please contact Bandwidth Support if your' \
955
957
  ' requests are receiving this status code for an' \
956
958
  ' extended period of time.',
957
959
  _response
958
960
  )
959
- elsif _response.status_code == 517
961
+ when 517
960
962
  raise APIException.new(
961
963
  'Unexpected error. Please contact Bandwidth Support if your' \
962
964
  ' requests are receiving this status code for an' \
963
965
  ' extended period of time.',
964
966
  _response
965
967
  )
966
- elsif _response.status_code == 518
968
+ when 518
967
969
  raise APIException.new(
968
970
  'Unexpected error. Please contact Bandwidth Support if your' \
969
971
  ' requests are receiving this status code for an' \
970
972
  ' extended period of time.',
971
973
  _response
972
974
  )
973
- elsif _response.status_code == 519
975
+ when 519
974
976
  raise APIException.new(
975
977
  'Unexpected error. Please contact Bandwidth Support if your' \
976
978
  ' requests are receiving this status code for an' \
977
979
  ' extended period of time.',
978
980
  _response
979
981
  )
980
- elsif _response.status_code == 520
982
+ when 520
981
983
  raise APIException.new(
982
984
  'Unexpected error. Please contact Bandwidth Support if your' \
983
985
  ' requests are receiving this status code for an' \
984
986
  ' extended period of time.',
985
987
  _response
986
988
  )
987
- elsif _response.status_code == 521
989
+ when 521
988
990
  raise APIException.new(
989
991
  'Unexpected error. Please contact Bandwidth Support if your' \
990
992
  ' requests are receiving this status code for an' \
991
993
  ' extended period of time.',
992
994
  _response
993
995
  )
994
- elsif _response.status_code == 522
996
+ when 522
995
997
  raise APIException.new(
996
998
  'Unexpected error. Please contact Bandwidth Support if your' \
997
999
  ' requests are receiving this status code for an' \
998
1000
  ' extended period of time.',
999
1001
  _response
1000
1002
  )
1001
- elsif _response.status_code == 523
1003
+ when 523
1002
1004
  raise APIException.new(
1003
1005
  'Unexpected error. Please contact Bandwidth Support if your' \
1004
1006
  ' requests are receiving this status code for an' \
1005
1007
  ' extended period of time.',
1006
1008
  _response
1007
1009
  )
1008
- elsif _response.status_code == 524
1010
+ when 524
1009
1011
  raise APIException.new(
1010
1012
  'Unexpected error. Please contact Bandwidth Support if your' \
1011
1013
  ' requests are receiving this status code for an' \
1012
1014
  ' extended period of time.',
1013
1015
  _response
1014
1016
  )
1015
- elsif _response.status_code == 525
1017
+ when 525
1016
1018
  raise APIException.new(
1017
1019
  'Unexpected error. Please contact Bandwidth Support if your' \
1018
1020
  ' requests are receiving this status code for an' \
1019
1021
  ' extended period of time.',
1020
1022
  _response
1021
1023
  )
1022
- elsif _response.status_code == 526
1024
+ when 526
1023
1025
  raise APIException.new(
1024
1026
  'Unexpected error. Please contact Bandwidth Support if your' \
1025
1027
  ' requests are receiving this status code for an' \
1026
1028
  ' extended period of time.',
1027
1029
  _response
1028
1030
  )
1029
- elsif _response.status_code == 527
1031
+ when 527
1030
1032
  raise APIException.new(
1031
1033
  'Unexpected error. Please contact Bandwidth Support if your' \
1032
1034
  ' requests are receiving this status code for an' \
1033
1035
  ' extended period of time.',
1034
1036
  _response
1035
1037
  )
1036
- elsif _response.status_code == 528
1038
+ when 528
1037
1039
  raise APIException.new(
1038
1040
  'Unexpected error. Please contact Bandwidth Support if your' \
1039
1041
  ' requests are receiving this status code for an' \
1040
1042
  ' extended period of time.',
1041
1043
  _response
1042
1044
  )
1043
- elsif _response.status_code == 529
1045
+ when 529
1044
1046
  raise APIException.new(
1045
1047
  'Unexpected error. Please contact Bandwidth Support if your' \
1046
1048
  ' requests are receiving this status code for an' \
1047
1049
  ' extended period of time.',
1048
1050
  _response
1049
1051
  )
1050
- elsif _response.status_code == 530
1052
+ when 530
1051
1053
  raise APIException.new(
1052
1054
  'Unexpected error. Please contact Bandwidth Support if your' \
1053
1055
  ' requests are receiving this status code for an' \
1054
1056
  ' extended period of time.',
1055
1057
  _response
1056
1058
  )
1057
- elsif _response.status_code == 531
1059
+ when 531
1058
1060
  raise APIException.new(
1059
1061
  'Unexpected error. Please contact Bandwidth Support if your' \
1060
1062
  ' requests are receiving this status code for an' \
1061
1063
  ' extended period of time.',
1062
1064
  _response
1063
1065
  )
1064
- elsif _response.status_code == 532
1066
+ when 532
1065
1067
  raise APIException.new(
1066
1068
  'Unexpected error. Please contact Bandwidth Support if your' \
1067
1069
  ' requests are receiving this status code for an' \
1068
1070
  ' extended period of time.',
1069
1071
  _response
1070
1072
  )
1071
- elsif _response.status_code == 533
1073
+ when 533
1072
1074
  raise APIException.new(
1073
1075
  'Unexpected error. Please contact Bandwidth Support if your' \
1074
1076
  ' requests are receiving this status code for an' \
1075
1077
  ' extended period of time.',
1076
1078
  _response
1077
1079
  )
1078
- elsif _response.status_code == 534
1080
+ when 534
1079
1081
  raise APIException.new(
1080
1082
  'Unexpected error. Please contact Bandwidth Support if your' \
1081
1083
  ' requests are receiving this status code for an' \
1082
1084
  ' extended period of time.',
1083
1085
  _response
1084
1086
  )
1085
- elsif _response.status_code == 535
1087
+ when 535
1086
1088
  raise APIException.new(
1087
1089
  'Unexpected error. Please contact Bandwidth Support if your' \
1088
1090
  ' requests are receiving this status code for an' \
1089
1091
  ' extended period of time.',
1090
1092
  _response
1091
1093
  )
1092
- elsif _response.status_code == 536
1094
+ when 536
1093
1095
  raise APIException.new(
1094
1096
  'Unexpected error. Please contact Bandwidth Support if your' \
1095
1097
  ' requests are receiving this status code for an' \
1096
1098
  ' extended period of time.',
1097
1099
  _response
1098
1100
  )
1099
- elsif _response.status_code == 537
1101
+ when 537
1100
1102
  raise APIException.new(
1101
1103
  'Unexpected error. Please contact Bandwidth Support if your' \
1102
1104
  ' requests are receiving this status code for an' \
1103
1105
  ' extended period of time.',
1104
1106
  _response
1105
1107
  )
1106
- elsif _response.status_code == 538
1108
+ when 538
1107
1109
  raise APIException.new(
1108
1110
  'Unexpected error. Please contact Bandwidth Support if your' \
1109
1111
  ' requests are receiving this status code for an' \
1110
1112
  ' extended period of time.',
1111
1113
  _response
1112
1114
  )
1113
- elsif _response.status_code == 539
1115
+ when 539
1114
1116
  raise APIException.new(
1115
1117
  'Unexpected error. Please contact Bandwidth Support if your' \
1116
1118
  ' requests are receiving this status code for an' \
1117
1119
  ' extended period of time.',
1118
1120
  _response
1119
1121
  )
1120
- elsif _response.status_code == 540
1122
+ when 540
1121
1123
  raise APIException.new(
1122
1124
  'Unexpected error. Please contact Bandwidth Support if your' \
1123
1125
  ' requests are receiving this status code for an' \
1124
1126
  ' extended period of time.',
1125
1127
  _response
1126
1128
  )
1127
- elsif _response.status_code == 541
1129
+ when 541
1128
1130
  raise APIException.new(
1129
1131
  'Unexpected error. Please contact Bandwidth Support if your' \
1130
1132
  ' requests are receiving this status code for an' \
1131
1133
  ' extended period of time.',
1132
1134
  _response
1133
1135
  )
1134
- elsif _response.status_code == 542
1136
+ when 542
1135
1137
  raise APIException.new(
1136
1138
  'Unexpected error. Please contact Bandwidth Support if your' \
1137
1139
  ' requests are receiving this status code for an' \
1138
1140
  ' extended period of time.',
1139
1141
  _response
1140
1142
  )
1141
- elsif _response.status_code == 543
1143
+ when 543
1142
1144
  raise APIException.new(
1143
1145
  'Unexpected error. Please contact Bandwidth Support if your' \
1144
1146
  ' requests are receiving this status code for an' \
1145
1147
  ' extended period of time.',
1146
1148
  _response
1147
1149
  )
1148
- elsif _response.status_code == 544
1150
+ when 544
1149
1151
  raise APIException.new(
1150
1152
  'Unexpected error. Please contact Bandwidth Support if your' \
1151
1153
  ' requests are receiving this status code for an' \
1152
1154
  ' extended period of time.',
1153
1155
  _response
1154
1156
  )
1155
- elsif _response.status_code == 545
1157
+ when 545
1156
1158
  raise APIException.new(
1157
1159
  'Unexpected error. Please contact Bandwidth Support if your' \
1158
1160
  ' requests are receiving this status code for an' \
1159
1161
  ' extended period of time.',
1160
1162
  _response
1161
1163
  )
1162
- elsif _response.status_code == 546
1164
+ when 546
1163
1165
  raise APIException.new(
1164
1166
  'Unexpected error. Please contact Bandwidth Support if your' \
1165
1167
  ' requests are receiving this status code for an' \
1166
1168
  ' extended period of time.',
1167
1169
  _response
1168
1170
  )
1169
- elsif _response.status_code == 547
1171
+ when 547
1170
1172
  raise APIException.new(
1171
1173
  'Unexpected error. Please contact Bandwidth Support if your' \
1172
1174
  ' requests are receiving this status code for an' \
1173
1175
  ' extended period of time.',
1174
1176
  _response
1175
1177
  )
1176
- elsif _response.status_code == 548
1178
+ when 548
1177
1179
  raise APIException.new(
1178
1180
  'Unexpected error. Please contact Bandwidth Support if your' \
1179
1181
  ' requests are receiving this status code for an' \
1180
1182
  ' extended period of time.',
1181
1183
  _response
1182
1184
  )
1183
- elsif _response.status_code == 549
1185
+ when 549
1184
1186
  raise APIException.new(
1185
1187
  'Unexpected error. Please contact Bandwidth Support if your' \
1186
1188
  ' requests are receiving this status code for an' \
1187
1189
  ' extended period of time.',
1188
1190
  _response
1189
1191
  )
1190
- elsif _response.status_code == 550
1192
+ when 550
1191
1193
  raise APIException.new(
1192
1194
  'Unexpected error. Please contact Bandwidth Support if your' \
1193
1195
  ' requests are receiving this status code for an' \
1194
1196
  ' extended period of time.',
1195
1197
  _response
1196
1198
  )
1197
- elsif _response.status_code == 551
1199
+ when 551
1198
1200
  raise APIException.new(
1199
1201
  'Unexpected error. Please contact Bandwidth Support if your' \
1200
1202
  ' requests are receiving this status code for an' \
1201
1203
  ' extended period of time.',
1202
1204
  _response
1203
1205
  )
1204
- elsif _response.status_code == 552
1206
+ when 552
1205
1207
  raise APIException.new(
1206
1208
  'Unexpected error. Please contact Bandwidth Support if your' \
1207
1209
  ' requests are receiving this status code for an' \
1208
1210
  ' extended period of time.',
1209
1211
  _response
1210
1212
  )
1211
- elsif _response.status_code == 553
1213
+ when 553
1212
1214
  raise APIException.new(
1213
1215
  'Unexpected error. Please contact Bandwidth Support if your' \
1214
1216
  ' requests are receiving this status code for an' \
1215
1217
  ' extended period of time.',
1216
1218
  _response
1217
1219
  )
1218
- elsif _response.status_code == 554
1220
+ when 554
1219
1221
  raise APIException.new(
1220
1222
  'Unexpected error. Please contact Bandwidth Support if your' \
1221
1223
  ' requests are receiving this status code for an' \
1222
1224
  ' extended period of time.',
1223
1225
  _response
1224
1226
  )
1225
- elsif _response.status_code == 555
1227
+ when 555
1226
1228
  raise APIException.new(
1227
1229
  'Unexpected error. Please contact Bandwidth Support if your' \
1228
1230
  ' requests are receiving this status code for an' \
1229
1231
  ' extended period of time.',
1230
1232
  _response
1231
1233
  )
1232
- elsif _response.status_code == 556
1234
+ when 556
1233
1235
  raise APIException.new(
1234
1236
  'Unexpected error. Please contact Bandwidth Support if your' \
1235
1237
  ' requests are receiving this status code for an' \
1236
1238
  ' extended period of time.',
1237
1239
  _response
1238
1240
  )
1239
- elsif _response.status_code == 557
1241
+ when 557
1240
1242
  raise APIException.new(
1241
1243
  'Unexpected error. Please contact Bandwidth Support if your' \
1242
1244
  ' requests are receiving this status code for an' \
1243
1245
  ' extended period of time.',
1244
1246
  _response
1245
1247
  )
1246
- elsif _response.status_code == 558
1248
+ when 558
1247
1249
  raise APIException.new(
1248
1250
  'Unexpected error. Please contact Bandwidth Support if your' \
1249
1251
  ' requests are receiving this status code for an' \
1250
1252
  ' extended period of time.',
1251
1253
  _response
1252
1254
  )
1253
- elsif _response.status_code == 559
1255
+ when 559
1254
1256
  raise APIException.new(
1255
1257
  'Unexpected error. Please contact Bandwidth Support if your' \
1256
1258
  ' requests are receiving this status code for an' \
1257
1259
  ' extended period of time.',
1258
1260
  _response
1259
1261
  )
1260
- elsif _response.status_code == 560
1262
+ when 560
1261
1263
  raise APIException.new(
1262
1264
  'Unexpected error. Please contact Bandwidth Support if your' \
1263
1265
  ' requests are receiving this status code for an' \
1264
1266
  ' extended period of time.',
1265
1267
  _response
1266
1268
  )
1267
- elsif _response.status_code == 561
1269
+ when 561
1268
1270
  raise APIException.new(
1269
1271
  'Unexpected error. Please contact Bandwidth Support if your' \
1270
1272
  ' requests are receiving this status code for an' \
1271
1273
  ' extended period of time.',
1272
1274
  _response
1273
1275
  )
1274
- elsif _response.status_code == 562
1276
+ when 562
1275
1277
  raise APIException.new(
1276
1278
  'Unexpected error. Please contact Bandwidth Support if your' \
1277
1279
  ' requests are receiving this status code for an' \
1278
1280
  ' extended period of time.',
1279
1281
  _response
1280
1282
  )
1281
- elsif _response.status_code == 563
1283
+ when 563
1282
1284
  raise APIException.new(
1283
1285
  'Unexpected error. Please contact Bandwidth Support if your' \
1284
1286
  ' requests are receiving this status code for an' \
1285
1287
  ' extended period of time.',
1286
1288
  _response
1287
1289
  )
1288
- elsif _response.status_code == 564
1290
+ when 564
1289
1291
  raise APIException.new(
1290
1292
  'Unexpected error. Please contact Bandwidth Support if your' \
1291
1293
  ' requests are receiving this status code for an' \
1292
1294
  ' extended period of time.',
1293
1295
  _response
1294
1296
  )
1295
- elsif _response.status_code == 565
1297
+ when 565
1296
1298
  raise APIException.new(
1297
1299
  'Unexpected error. Please contact Bandwidth Support if your' \
1298
1300
  ' requests are receiving this status code for an' \
1299
1301
  ' extended period of time.',
1300
1302
  _response
1301
1303
  )
1302
- elsif _response.status_code == 566
1304
+ when 566
1303
1305
  raise APIException.new(
1304
1306
  'Unexpected error. Please contact Bandwidth Support if your' \
1305
1307
  ' requests are receiving this status code for an' \
1306
1308
  ' extended period of time.',
1307
1309
  _response
1308
1310
  )
1309
- elsif _response.status_code == 567
1311
+ when 567
1310
1312
  raise APIException.new(
1311
1313
  'Unexpected error. Please contact Bandwidth Support if your' \
1312
1314
  ' requests are receiving this status code for an' \
1313
1315
  ' extended period of time.',
1314
1316
  _response
1315
1317
  )
1316
- elsif _response.status_code == 568
1318
+ when 568
1317
1319
  raise APIException.new(
1318
1320
  'Unexpected error. Please contact Bandwidth Support if your' \
1319
1321
  ' requests are receiving this status code for an' \
1320
1322
  ' extended period of time.',
1321
1323
  _response
1322
1324
  )
1323
- elsif _response.status_code == 569
1325
+ when 569
1324
1326
  raise APIException.new(
1325
1327
  'Unexpected error. Please contact Bandwidth Support if your' \
1326
1328
  ' requests are receiving this status code for an' \
1327
1329
  ' extended period of time.',
1328
1330
  _response
1329
1331
  )
1330
- elsif _response.status_code == 570
1332
+ when 570
1331
1333
  raise APIException.new(
1332
1334
  'Unexpected error. Please contact Bandwidth Support if your' \
1333
1335
  ' requests are receiving this status code for an' \
1334
1336
  ' extended period of time.',
1335
1337
  _response
1336
1338
  )
1337
- elsif _response.status_code == 571
1339
+ when 571
1338
1340
  raise APIException.new(
1339
1341
  'Unexpected error. Please contact Bandwidth Support if your' \
1340
1342
  ' requests are receiving this status code for an' \
1341
1343
  ' extended period of time.',
1342
1344
  _response
1343
1345
  )
1344
- elsif _response.status_code == 572
1346
+ when 572
1345
1347
  raise APIException.new(
1346
1348
  'Unexpected error. Please contact Bandwidth Support if your' \
1347
1349
  ' requests are receiving this status code for an' \
1348
1350
  ' extended period of time.',
1349
1351
  _response
1350
1352
  )
1351
- elsif _response.status_code == 573
1353
+ when 573
1352
1354
  raise APIException.new(
1353
1355
  'Unexpected error. Please contact Bandwidth Support if your' \
1354
1356
  ' requests are receiving this status code for an' \
1355
1357
  ' extended period of time.',
1356
1358
  _response
1357
1359
  )
1358
- elsif _response.status_code == 574
1360
+ when 574
1359
1361
  raise APIException.new(
1360
1362
  'Unexpected error. Please contact Bandwidth Support if your' \
1361
1363
  ' requests are receiving this status code for an' \
1362
1364
  ' extended period of time.',
1363
1365
  _response
1364
1366
  )
1365
- elsif _response.status_code == 575
1367
+ when 575
1366
1368
  raise APIException.new(
1367
1369
  'Unexpected error. Please contact Bandwidth Support if your' \
1368
1370
  ' requests are receiving this status code for an' \
1369
1371
  ' extended period of time.',
1370
1372
  _response
1371
1373
  )
1372
- elsif _response.status_code == 576
1374
+ when 576
1373
1375
  raise APIException.new(
1374
1376
  'Unexpected error. Please contact Bandwidth Support if your' \
1375
1377
  ' requests are receiving this status code for an' \
1376
1378
  ' extended period of time.',
1377
1379
  _response
1378
1380
  )
1379
- elsif _response.status_code == 577
1381
+ when 577
1380
1382
  raise APIException.new(
1381
1383
  'Unexpected error. Please contact Bandwidth Support if your' \
1382
1384
  ' requests are receiving this status code for an' \
1383
1385
  ' extended period of time.',
1384
1386
  _response
1385
1387
  )
1386
- elsif _response.status_code == 578
1388
+ when 578
1387
1389
  raise APIException.new(
1388
1390
  'Unexpected error. Please contact Bandwidth Support if your' \
1389
1391
  ' requests are receiving this status code for an' \
1390
1392
  ' extended period of time.',
1391
1393
  _response
1392
1394
  )
1393
- elsif _response.status_code == 579
1395
+ when 579
1394
1396
  raise APIException.new(
1395
1397
  'Unexpected error. Please contact Bandwidth Support if your' \
1396
1398
  ' requests are receiving this status code for an' \
1397
1399
  ' extended period of time.',
1398
1400
  _response
1399
1401
  )
1400
- elsif _response.status_code == 580
1402
+ when 580
1401
1403
  raise APIException.new(
1402
1404
  'Unexpected error. Please contact Bandwidth Support if your' \
1403
1405
  ' requests are receiving this status code for an' \
1404
1406
  ' extended period of time.',
1405
1407
  _response
1406
1408
  )
1407
- elsif _response.status_code == 581
1409
+ when 581
1408
1410
  raise APIException.new(
1409
1411
  'Unexpected error. Please contact Bandwidth Support if your' \
1410
1412
  ' requests are receiving this status code for an' \
1411
1413
  ' extended period of time.',
1412
1414
  _response
1413
1415
  )
1414
- elsif _response.status_code == 582
1416
+ when 582
1415
1417
  raise APIException.new(
1416
1418
  'Unexpected error. Please contact Bandwidth Support if your' \
1417
1419
  ' requests are receiving this status code for an' \
1418
1420
  ' extended period of time.',
1419
1421
  _response
1420
1422
  )
1421
- elsif _response.status_code == 583
1423
+ when 583
1422
1424
  raise APIException.new(
1423
1425
  'Unexpected error. Please contact Bandwidth Support if your' \
1424
1426
  ' requests are receiving this status code for an' \
1425
1427
  ' extended period of time.',
1426
1428
  _response
1427
1429
  )
1428
- elsif _response.status_code == 584
1430
+ when 584
1429
1431
  raise APIException.new(
1430
1432
  'Unexpected error. Please contact Bandwidth Support if your' \
1431
1433
  ' requests are receiving this status code for an' \
1432
1434
  ' extended period of time.',
1433
1435
  _response
1434
1436
  )
1435
- elsif _response.status_code == 585
1437
+ when 585
1436
1438
  raise APIException.new(
1437
1439
  'Unexpected error. Please contact Bandwidth Support if your' \
1438
1440
  ' requests are receiving this status code for an' \
1439
1441
  ' extended period of time.',
1440
1442
  _response
1441
1443
  )
1442
- elsif _response.status_code == 586
1444
+ when 586
1443
1445
  raise APIException.new(
1444
1446
  'Unexpected error. Please contact Bandwidth Support if your' \
1445
1447
  ' requests are receiving this status code for an' \
1446
1448
  ' extended period of time.',
1447
1449
  _response
1448
1450
  )
1449
- elsif _response.status_code == 587
1451
+ when 587
1450
1452
  raise APIException.new(
1451
1453
  'Unexpected error. Please contact Bandwidth Support if your' \
1452
1454
  ' requests are receiving this status code for an' \
1453
1455
  ' extended period of time.',
1454
1456
  _response
1455
1457
  )
1456
- elsif _response.status_code == 588
1458
+ when 588
1457
1459
  raise APIException.new(
1458
1460
  'Unexpected error. Please contact Bandwidth Support if your' \
1459
1461
  ' requests are receiving this status code for an' \
1460
1462
  ' extended period of time.',
1461
1463
  _response
1462
1464
  )
1463
- elsif _response.status_code == 589
1465
+ when 589
1464
1466
  raise APIException.new(
1465
1467
  'Unexpected error. Please contact Bandwidth Support if your' \
1466
1468
  ' requests are receiving this status code for an' \
1467
1469
  ' extended period of time.',
1468
1470
  _response
1469
1471
  )
1470
- elsif _response.status_code == 590
1472
+ when 590
1471
1473
  raise APIException.new(
1472
1474
  'Unexpected error. Please contact Bandwidth Support if your' \
1473
1475
  ' requests are receiving this status code for an' \
1474
1476
  ' extended period of time.',
1475
1477
  _response
1476
1478
  )
1477
- elsif _response.status_code == 591
1479
+ when 591
1478
1480
  raise APIException.new(
1479
1481
  'Unexpected error. Please contact Bandwidth Support if your' \
1480
1482
  ' requests are receiving this status code for an' \
1481
1483
  ' extended period of time.',
1482
1484
  _response
1483
1485
  )
1484
- elsif _response.status_code == 592
1486
+ when 592
1485
1487
  raise APIException.new(
1486
1488
  'Unexpected error. Please contact Bandwidth Support if your' \
1487
1489
  ' requests are receiving this status code for an' \
1488
1490
  ' extended period of time.',
1489
1491
  _response
1490
1492
  )
1491
- elsif _response.status_code == 593
1493
+ when 593
1492
1494
  raise APIException.new(
1493
1495
  'Unexpected error. Please contact Bandwidth Support if your' \
1494
1496
  ' requests are receiving this status code for an' \
1495
1497
  ' extended period of time.',
1496
1498
  _response
1497
1499
  )
1498
- elsif _response.status_code == 594
1500
+ when 594
1499
1501
  raise APIException.new(
1500
1502
  'Unexpected error. Please contact Bandwidth Support if your' \
1501
1503
  ' requests are receiving this status code for an' \
1502
1504
  ' extended period of time.',
1503
1505
  _response
1504
1506
  )
1505
- elsif _response.status_code == 595
1507
+ when 595
1506
1508
  raise APIException.new(
1507
1509
  'Unexpected error. Please contact Bandwidth Support if your' \
1508
1510
  ' requests are receiving this status code for an' \
1509
1511
  ' extended period of time.',
1510
1512
  _response
1511
1513
  )
1512
- elsif _response.status_code == 596
1514
+ when 596
1513
1515
  raise APIException.new(
1514
1516
  'Unexpected error. Please contact Bandwidth Support if your' \
1515
1517
  ' requests are receiving this status code for an' \
1516
1518
  ' extended period of time.',
1517
1519
  _response
1518
1520
  )
1519
- elsif _response.status_code == 597
1521
+ when 597
1520
1522
  raise APIException.new(
1521
1523
  'Unexpected error. Please contact Bandwidth Support if your' \
1522
1524
  ' requests are receiving this status code for an' \
1523
1525
  ' extended period of time.',
1524
1526
  _response
1525
1527
  )
1526
- elsif _response.status_code == 598
1528
+ when 598
1527
1529
  raise APIException.new(
1528
1530
  'Unexpected error. Please contact Bandwidth Support if your' \
1529
1531
  ' requests are receiving this status code for an' \
1530
1532
  ' extended period of time.',
1531
1533
  _response
1532
1534
  )
1533
- elsif _response.status_code == 599
1535
+ when 599
1534
1536
  raise APIException.new(
1535
1537
  'Unexpected error. Please contact Bandwidth Support if your' \
1536
1538
  ' requests are receiving this status code for an' \