bandwidth-sdk 12.0.0 → 13.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -2
  3. data/Gemfile.lock +13 -22
  4. data/README.md +3 -1
  5. data/Rakefile +4 -12
  6. data/bandwidth-sdk.gemspec +3 -1
  7. data/bandwidth.yml +48 -33
  8. data/coverage/.last_run.json +1 -1
  9. data/coverage/.resultset.json +1333 -1598
  10. data/coverage/index.html +6890 -9805
  11. data/custom_templates/Gemfile.mustache +1 -2
  12. data/custom_templates/gemspec.mustache +2 -0
  13. data/docs/AnswerCallback.md +2 -2
  14. data/docs/BridgeCompleteCallback.md +2 -2
  15. data/docs/BridgeTargetCompleteCallback.md +2 -2
  16. data/docs/CallRecordingMetadata.md +4 -4
  17. data/docs/CallState.md +1 -1
  18. data/docs/CallTranscription.md +6 -6
  19. data/docs/CallTranscriptionDetectedLanguageEnum.md +15 -0
  20. data/docs/CallTranscriptionResponse.md +2 -2
  21. data/docs/CallTranscriptionTrackEnum.md +15 -0
  22. data/docs/CallsApi.md +1 -1
  23. data/docs/ConferenceMemberExitCallback.md +1 -1
  24. data/docs/ConferenceMemberJoinCallback.md +1 -1
  25. data/docs/ConferenceRecordingAvailableCallback.md +1 -1
  26. data/docs/ConferenceRecordingMetadata.md +1 -1
  27. data/docs/CreateCall.md +5 -3
  28. data/docs/DisconnectCallback.md +2 -2
  29. data/docs/DtmfCallback.md +4 -4
  30. data/docs/GatherCallback.md +4 -4
  31. data/docs/InitiateCallback.md +2 -2
  32. data/docs/MachineDetectionCompleteCallback.md +2 -2
  33. data/docs/MessagingCodeResponse.md +1 -1
  34. data/docs/RecordingAvailableCallback.md +4 -4
  35. data/docs/RecordingCompleteCallback.md +4 -4
  36. data/docs/RecordingTranscriptionMetadata.md +1 -1
  37. data/docs/RedirectCallback.md +4 -4
  38. data/docs/TranscriptionAvailableCallback.md +4 -4
  39. data/docs/TranscriptionsApi.md +1 -1
  40. data/docs/TransferAnswerCallback.md +4 -4
  41. data/docs/TransferCompleteCallback.md +4 -4
  42. data/docs/TransferDisconnectCallback.md +4 -4
  43. data/lib/bandwidth-sdk/api/calls_api.rb +1 -1
  44. data/lib/bandwidth-sdk/api/conferences_api.rb +1 -1
  45. data/lib/bandwidth-sdk/api/media_api.rb +1 -1
  46. data/lib/bandwidth-sdk/api/messages_api.rb +1 -1
  47. data/lib/bandwidth-sdk/api/mfa_api.rb +1 -1
  48. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +1 -1
  49. data/lib/bandwidth-sdk/api/recordings_api.rb +1 -1
  50. data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
  51. data/lib/bandwidth-sdk/api/transcriptions_api.rb +3 -3
  52. data/lib/bandwidth-sdk/api_client.rb +44 -41
  53. data/lib/bandwidth-sdk/api_error.rb +1 -1
  54. data/lib/bandwidth-sdk/configuration.rb +11 -1
  55. data/lib/bandwidth-sdk/models/account_statistics.rb +2 -2
  56. data/lib/bandwidth-sdk/models/answer_callback.rb +3 -3
  57. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +3 -3
  58. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +3 -3
  59. data/lib/bandwidth-sdk/models/bxml/root.rb +0 -6
  60. data/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +0 -6
  61. data/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +0 -6
  62. data/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +0 -6
  63. data/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +0 -6
  64. data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
  65. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +4 -4
  66. data/lib/bandwidth-sdk/models/call_state.rb +2 -2
  67. data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
  68. data/lib/bandwidth-sdk/models/call_transcription.rb +11 -37
  69. data/lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb +41 -0
  70. data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +2 -2
  71. data/lib/bandwidth-sdk/models/call_transcription_response.rb +2 -2
  72. data/lib/bandwidth-sdk/models/call_transcription_track_enum.rb +40 -0
  73. data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
  74. data/lib/bandwidth-sdk/models/code_request.rb +2 -2
  75. data/lib/bandwidth-sdk/models/conference.rb +2 -2
  76. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +2 -2
  77. data/lib/bandwidth-sdk/models/conference_created_callback.rb +2 -2
  78. data/lib/bandwidth-sdk/models/conference_member.rb +2 -2
  79. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +3 -3
  80. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +3 -3
  81. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +2 -2
  82. data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +2 -2
  83. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +2 -2
  84. data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
  85. data/lib/bandwidth-sdk/models/create_call.rb +16 -5
  86. data/lib/bandwidth-sdk/models/create_call_response.rb +2 -2
  87. data/lib/bandwidth-sdk/models/create_lookup_response.rb +2 -2
  88. data/lib/bandwidth-sdk/models/create_message_request_error.rb +2 -2
  89. data/lib/bandwidth-sdk/models/deferred_result.rb +2 -2
  90. data/lib/bandwidth-sdk/models/disconnect_callback.rb +3 -3
  91. data/lib/bandwidth-sdk/models/diversion.rb +2 -2
  92. data/lib/bandwidth-sdk/models/dtmf_callback.rb +4 -4
  93. data/lib/bandwidth-sdk/models/field_error.rb +2 -2
  94. data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
  95. data/lib/bandwidth-sdk/models/gather_callback.rb +4 -4
  96. data/lib/bandwidth-sdk/models/inbound_message_callback.rb +2 -2
  97. data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +2 -2
  98. data/lib/bandwidth-sdk/models/initiate_callback.rb +3 -3
  99. data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
  100. data/lib/bandwidth-sdk/models/list_message_item.rb +2 -2
  101. data/lib/bandwidth-sdk/models/lookup_request.rb +2 -2
  102. data/lib/bandwidth-sdk/models/lookup_result.rb +2 -2
  103. data/lib/bandwidth-sdk/models/lookup_status.rb +2 -2
  104. data/lib/bandwidth-sdk/models/lookup_status_enum.rb +1 -1
  105. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +3 -3
  106. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +3 -3
  107. data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
  108. data/lib/bandwidth-sdk/models/machine_detection_result.rb +2 -2
  109. data/lib/bandwidth-sdk/models/media.rb +2 -2
  110. data/lib/bandwidth-sdk/models/message.rb +2 -2
  111. data/lib/bandwidth-sdk/models/message_delivered_callback.rb +2 -2
  112. data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +2 -2
  113. data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
  114. data/lib/bandwidth-sdk/models/message_failed_callback.rb +2 -2
  115. data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +2 -2
  116. data/lib/bandwidth-sdk/models/message_request.rb +2 -2
  117. data/lib/bandwidth-sdk/models/message_sending_callback.rb +2 -2
  118. data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +2 -2
  119. data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
  120. data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
  121. data/lib/bandwidth-sdk/models/messages_list.rb +2 -2
  122. data/lib/bandwidth-sdk/models/messaging_code_response.rb +2 -2
  123. data/lib/bandwidth-sdk/models/messaging_request_error.rb +2 -2
  124. data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +2 -2
  125. data/lib/bandwidth-sdk/models/mfa_request_error.rb +2 -2
  126. data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +2 -2
  127. data/lib/bandwidth-sdk/models/page_info.rb +2 -2
  128. data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
  129. data/lib/bandwidth-sdk/models/recording_available_callback.rb +4 -4
  130. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +4 -4
  131. data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
  132. data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +3 -3
  133. data/lib/bandwidth-sdk/models/recording_transcriptions.rb +2 -2
  134. data/lib/bandwidth-sdk/models/redirect_callback.rb +4 -4
  135. data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
  136. data/lib/bandwidth-sdk/models/stir_shaken.rb +2 -2
  137. data/lib/bandwidth-sdk/models/tag.rb +2 -2
  138. data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +2 -2
  139. data/lib/bandwidth-sdk/models/transcribe_recording.rb +2 -2
  140. data/lib/bandwidth-sdk/models/transcription.rb +2 -2
  141. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +4 -4
  142. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +4 -4
  143. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +4 -4
  144. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +4 -4
  145. data/lib/bandwidth-sdk/models/update_call.rb +2 -2
  146. data/lib/bandwidth-sdk/models/update_call_recording.rb +2 -2
  147. data/lib/bandwidth-sdk/models/update_conference.rb +2 -2
  148. data/lib/bandwidth-sdk/models/update_conference_member.rb +2 -2
  149. data/lib/bandwidth-sdk/models/verify_code_request.rb +2 -2
  150. data/lib/bandwidth-sdk/models/verify_code_response.rb +2 -2
  151. data/lib/bandwidth-sdk/models/voice_api_error.rb +2 -2
  152. data/lib/bandwidth-sdk/models/voice_code_response.rb +2 -2
  153. data/lib/bandwidth-sdk/version.rb +2 -2
  154. data/lib/bandwidth-sdk.rb +3 -1
  155. data/openapitools.json +1 -1
  156. data/spec/call_utils.rb +1 -1
  157. data/spec/{integration/calls_api_integration_spec.rb → smoke/calls_api_spec.rb} +3 -6
  158. data/spec/{integration/conferences_api_integration_spec.rb → smoke/conferences_api_spec.rb} +0 -5
  159. data/spec/{integration/media_api_integration_spec.rb → smoke/media_api_spec.rb} +0 -5
  160. data/spec/{integration/messages_api_integration_spec.rb → smoke/messages_api_spec.rb} +0 -5
  161. data/spec/{integration/mfa_api_integration_spec.rb → smoke/mfa_api_spec.rb} +0 -5
  162. data/spec/{integration/phone_number_lookup_api_integration_spec.rb → smoke/phone_number_lookup_api_spec.rb} +0 -5
  163. data/spec/{integration/recordings_api_integration_spec.rb → smoke/recordings_api_spec.rb} +0 -5
  164. data/spec/{integration/statistics_api_integration_spec.rb → smoke/statistics_api_spec.rb} +0 -5
  165. data/spec/{integration/transcriptions_api_integration_spec.rb → smoke/transcriptions_api_spec.rb} +0 -5
  166. data/spec/spec_helper.rb +13 -6
  167. data/spec/unit/api/calls_api_spec.rb +233 -0
  168. data/spec/unit/api/conferences_api_spec.rb +330 -0
  169. data/spec/{api → unit/api}/media_api_spec.rb +17 -32
  170. data/spec/unit/api/messages_api_spec.rb +103 -0
  171. data/spec/{api → unit/api}/mfa_api_spec.rb +8 -24
  172. data/spec/unit/api/phone_number_lookup_api_spec.rb +86 -0
  173. data/spec/{api → unit/api}/recordings_api_spec.rb +83 -110
  174. data/spec/unit/api/statistics_api_spec.rb +37 -0
  175. data/spec/{api → unit/api}/transcriptions_api_spec.rb +18 -37
  176. data/spec/{api_client_spec.rb → unit/client/api_client_spec.rb} +4 -4
  177. metadata +136 -118
  178. data/spec/api/calls_api_spec.rb +0 -261
  179. data/spec/api/conferences_api_spec.rb +0 -393
  180. data/spec/api/messages_api_spec.rb +0 -193
  181. data/spec/api/phone_number_lookup_api_spec.rb +0 -100
  182. data/spec/api/statistics_api_spec.rb +0 -45
  183. /data/spec/{api_error_spec.rb → unit/client/api_error_spec.rb} +0 -0
  184. /data/spec/{configuration_spec.rb → unit/client/configuration_spec.rb} +0 -0
  185. /data/spec/{models → unit/models}/bxml/bxml_spec.rb +0 -0
  186. /data/spec/{models → unit/models}/bxml/nestable_verb_spec.rb +0 -0
  187. /data/spec/{models → unit/models}/bxml/response_spec.rb +0 -0
  188. /data/spec/{models → unit/models}/bxml/verb_spec.rb +0 -0
  189. /data/spec/{models → unit/models}/bxml/verbs/bridge_spec.rb +0 -0
  190. /data/spec/{models → unit/models}/bxml/verbs/conference_spec.rb +0 -0
  191. /data/spec/{models → unit/models}/bxml/verbs/custom_param_spec.rb +0 -0
  192. /data/spec/{models → unit/models}/bxml/verbs/forward_spec.rb +0 -0
  193. /data/spec/{models → unit/models}/bxml/verbs/gather_spec.rb +0 -0
  194. /data/spec/{models → unit/models}/bxml/verbs/hangup_spec.rb +0 -0
  195. /data/spec/{models → unit/models}/bxml/verbs/pause_recording_spec.rb +0 -0
  196. /data/spec/{models → unit/models}/bxml/verbs/pause_spec.rb +0 -0
  197. /data/spec/{models → unit/models}/bxml/verbs/phone_number_spec.rb +0 -0
  198. /data/spec/{models → unit/models}/bxml/verbs/play_audio_spec.rb +0 -0
  199. /data/spec/{models → unit/models}/bxml/verbs/record_spec.rb +0 -0
  200. /data/spec/{models → unit/models}/bxml/verbs/redirect_spec.rb +0 -0
  201. /data/spec/{models → unit/models}/bxml/verbs/resume_recording_spec.rb +0 -0
  202. /data/spec/{models → unit/models}/bxml/verbs/ring_spec.rb +0 -0
  203. /data/spec/{models → unit/models}/bxml/verbs/send_dtmf_spec.rb +0 -0
  204. /data/spec/{models → unit/models}/bxml/verbs/sip_uri_spec.rb +0 -0
  205. /data/spec/{models → unit/models}/bxml/verbs/speak_sentence_spec.rb +0 -0
  206. /data/spec/{models → unit/models}/bxml/verbs/start_gather_spec.rb +0 -0
  207. /data/spec/{models → unit/models}/bxml/verbs/start_recording_spec.rb +0 -0
  208. /data/spec/{models → unit/models}/bxml/verbs/start_stream_spec.rb +0 -0
  209. /data/spec/{models → unit/models}/bxml/verbs/start_transcription_spec.rb +0 -0
  210. /data/spec/{models → unit/models}/bxml/verbs/stop_gather_spec.rb +0 -0
  211. /data/spec/{models → unit/models}/bxml/verbs/stop_recording_spec.rb +0 -0
  212. /data/spec/{models → unit/models}/bxml/verbs/stop_stream_spec.rb +0 -0
  213. /data/spec/{models → unit/models}/bxml/verbs/stop_transcription_spec.rb +0 -0
  214. /data/spec/{models → unit/models}/bxml/verbs/stream_param_spec.rb +0 -0
  215. /data/spec/{models → unit/models}/bxml/verbs/tag_spec.rb +0 -0
  216. /data/spec/{models → unit/models}/bxml/verbs/transfer_spec.rb +0 -0
  217. /data/spec/{models → unit/models}/call_state_enum_spec.rb +0 -0
  218. /data/spec/{models → unit/models}/call_state_spec.rb +0 -0
  219. /data/spec/{models → unit/models}/deferred_result_spec.rb +0 -0
  220. /data/spec/{models → unit/models}/message_spec.rb +0 -0
  221. /data/spec/{models → unit/models}/verify_code_request_spec.rb +0 -0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bandwidth-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.0
4
+ version: 13.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bandwidth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-21 00:00:00.000000000 Z
11
+ date: 2024-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -58,6 +58,20 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '2.4'
61
+ - !ruby/object:Gem::Dependency
62
+ name: marcel
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
61
75
  - !ruby/object:Gem::Dependency
62
76
  name: rspec
63
77
  requirement: !ruby/object:Gem::Requirement
@@ -138,8 +152,10 @@ files:
138
152
  - docs/CallState.md
139
153
  - docs/CallStateEnum.md
140
154
  - docs/CallTranscription.md
155
+ - docs/CallTranscriptionDetectedLanguageEnum.md
141
156
  - docs/CallTranscriptionMetadata.md
142
157
  - docs/CallTranscriptionResponse.md
158
+ - docs/CallTranscriptionTrackEnum.md
143
159
  - docs/CallbackMethodEnum.md
144
160
  - docs/CallsApi.md
145
161
  - docs/CodeRequest.md
@@ -301,8 +317,10 @@ files:
301
317
  - lib/bandwidth-sdk/models/call_state.rb
302
318
  - lib/bandwidth-sdk/models/call_state_enum.rb
303
319
  - lib/bandwidth-sdk/models/call_transcription.rb
320
+ - lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb
304
321
  - lib/bandwidth-sdk/models/call_transcription_metadata.rb
305
322
  - lib/bandwidth-sdk/models/call_transcription_response.rb
323
+ - lib/bandwidth-sdk/models/call_transcription_track_enum.rb
306
324
  - lib/bandwidth-sdk/models/callback_method_enum.rb
307
325
  - lib/bandwidth-sdk/models/code_request.rb
308
326
  - lib/bandwidth-sdk/models/conference.rb
@@ -389,67 +407,67 @@ files:
389
407
  - lib/bandwidth-sdk/version.rb
390
408
  - openapi-config.yml
391
409
  - openapitools.json
392
- - spec/api/calls_api_spec.rb
393
- - spec/api/conferences_api_spec.rb
394
- - spec/api/media_api_spec.rb
395
- - spec/api/messages_api_spec.rb
396
- - spec/api/mfa_api_spec.rb
397
- - spec/api/phone_number_lookup_api_spec.rb
398
- - spec/api/recordings_api_spec.rb
399
- - spec/api/statistics_api_spec.rb
400
- - spec/api/transcriptions_api_spec.rb
401
- - spec/api_client_spec.rb
402
- - spec/api_error_spec.rb
403
410
  - spec/call_utils.rb
404
- - spec/configuration_spec.rb
405
411
  - spec/fixtures/ruby_cat.jpeg
406
- - spec/integration/calls_api_integration_spec.rb
407
- - spec/integration/conferences_api_integration_spec.rb
408
- - spec/integration/media_api_integration_spec.rb
409
- - spec/integration/messages_api_integration_spec.rb
410
- - spec/integration/mfa_api_integration_spec.rb
411
- - spec/integration/phone_number_lookup_api_integration_spec.rb
412
- - spec/integration/recordings_api_integration_spec.rb
413
- - spec/integration/statistics_api_integration_spec.rb
414
- - spec/integration/transcriptions_api_integration_spec.rb
415
- - spec/models/bxml/bxml_spec.rb
416
- - spec/models/bxml/nestable_verb_spec.rb
417
- - spec/models/bxml/response_spec.rb
418
- - spec/models/bxml/verb_spec.rb
419
- - spec/models/bxml/verbs/bridge_spec.rb
420
- - spec/models/bxml/verbs/conference_spec.rb
421
- - spec/models/bxml/verbs/custom_param_spec.rb
422
- - spec/models/bxml/verbs/forward_spec.rb
423
- - spec/models/bxml/verbs/gather_spec.rb
424
- - spec/models/bxml/verbs/hangup_spec.rb
425
- - spec/models/bxml/verbs/pause_recording_spec.rb
426
- - spec/models/bxml/verbs/pause_spec.rb
427
- - spec/models/bxml/verbs/phone_number_spec.rb
428
- - spec/models/bxml/verbs/play_audio_spec.rb
429
- - spec/models/bxml/verbs/record_spec.rb
430
- - spec/models/bxml/verbs/redirect_spec.rb
431
- - spec/models/bxml/verbs/resume_recording_spec.rb
432
- - spec/models/bxml/verbs/ring_spec.rb
433
- - spec/models/bxml/verbs/send_dtmf_spec.rb
434
- - spec/models/bxml/verbs/sip_uri_spec.rb
435
- - spec/models/bxml/verbs/speak_sentence_spec.rb
436
- - spec/models/bxml/verbs/start_gather_spec.rb
437
- - spec/models/bxml/verbs/start_recording_spec.rb
438
- - spec/models/bxml/verbs/start_stream_spec.rb
439
- - spec/models/bxml/verbs/start_transcription_spec.rb
440
- - spec/models/bxml/verbs/stop_gather_spec.rb
441
- - spec/models/bxml/verbs/stop_recording_spec.rb
442
- - spec/models/bxml/verbs/stop_stream_spec.rb
443
- - spec/models/bxml/verbs/stop_transcription_spec.rb
444
- - spec/models/bxml/verbs/stream_param_spec.rb
445
- - spec/models/bxml/verbs/tag_spec.rb
446
- - spec/models/bxml/verbs/transfer_spec.rb
447
- - spec/models/call_state_enum_spec.rb
448
- - spec/models/call_state_spec.rb
449
- - spec/models/deferred_result_spec.rb
450
- - spec/models/message_spec.rb
451
- - spec/models/verify_code_request_spec.rb
412
+ - spec/smoke/calls_api_spec.rb
413
+ - spec/smoke/conferences_api_spec.rb
414
+ - spec/smoke/media_api_spec.rb
415
+ - spec/smoke/messages_api_spec.rb
416
+ - spec/smoke/mfa_api_spec.rb
417
+ - spec/smoke/phone_number_lookup_api_spec.rb
418
+ - spec/smoke/recordings_api_spec.rb
419
+ - spec/smoke/statistics_api_spec.rb
420
+ - spec/smoke/transcriptions_api_spec.rb
452
421
  - spec/spec_helper.rb
422
+ - spec/unit/api/calls_api_spec.rb
423
+ - spec/unit/api/conferences_api_spec.rb
424
+ - spec/unit/api/media_api_spec.rb
425
+ - spec/unit/api/messages_api_spec.rb
426
+ - spec/unit/api/mfa_api_spec.rb
427
+ - spec/unit/api/phone_number_lookup_api_spec.rb
428
+ - spec/unit/api/recordings_api_spec.rb
429
+ - spec/unit/api/statistics_api_spec.rb
430
+ - spec/unit/api/transcriptions_api_spec.rb
431
+ - spec/unit/client/api_client_spec.rb
432
+ - spec/unit/client/api_error_spec.rb
433
+ - spec/unit/client/configuration_spec.rb
434
+ - spec/unit/models/bxml/bxml_spec.rb
435
+ - spec/unit/models/bxml/nestable_verb_spec.rb
436
+ - spec/unit/models/bxml/response_spec.rb
437
+ - spec/unit/models/bxml/verb_spec.rb
438
+ - spec/unit/models/bxml/verbs/bridge_spec.rb
439
+ - spec/unit/models/bxml/verbs/conference_spec.rb
440
+ - spec/unit/models/bxml/verbs/custom_param_spec.rb
441
+ - spec/unit/models/bxml/verbs/forward_spec.rb
442
+ - spec/unit/models/bxml/verbs/gather_spec.rb
443
+ - spec/unit/models/bxml/verbs/hangup_spec.rb
444
+ - spec/unit/models/bxml/verbs/pause_recording_spec.rb
445
+ - spec/unit/models/bxml/verbs/pause_spec.rb
446
+ - spec/unit/models/bxml/verbs/phone_number_spec.rb
447
+ - spec/unit/models/bxml/verbs/play_audio_spec.rb
448
+ - spec/unit/models/bxml/verbs/record_spec.rb
449
+ - spec/unit/models/bxml/verbs/redirect_spec.rb
450
+ - spec/unit/models/bxml/verbs/resume_recording_spec.rb
451
+ - spec/unit/models/bxml/verbs/ring_spec.rb
452
+ - spec/unit/models/bxml/verbs/send_dtmf_spec.rb
453
+ - spec/unit/models/bxml/verbs/sip_uri_spec.rb
454
+ - spec/unit/models/bxml/verbs/speak_sentence_spec.rb
455
+ - spec/unit/models/bxml/verbs/start_gather_spec.rb
456
+ - spec/unit/models/bxml/verbs/start_recording_spec.rb
457
+ - spec/unit/models/bxml/verbs/start_stream_spec.rb
458
+ - spec/unit/models/bxml/verbs/start_transcription_spec.rb
459
+ - spec/unit/models/bxml/verbs/stop_gather_spec.rb
460
+ - spec/unit/models/bxml/verbs/stop_recording_spec.rb
461
+ - spec/unit/models/bxml/verbs/stop_stream_spec.rb
462
+ - spec/unit/models/bxml/verbs/stop_transcription_spec.rb
463
+ - spec/unit/models/bxml/verbs/stream_param_spec.rb
464
+ - spec/unit/models/bxml/verbs/tag_spec.rb
465
+ - spec/unit/models/bxml/verbs/transfer_spec.rb
466
+ - spec/unit/models/call_state_enum_spec.rb
467
+ - spec/unit/models/call_state_spec.rb
468
+ - spec/unit/models/deferred_result_spec.rb
469
+ - spec/unit/models/message_spec.rb
470
+ - spec/unit/models/verify_code_request_spec.rb
453
471
  homepage: https://github.com/Bandwidth/ruby-sdk
454
472
  licenses:
455
473
  - MIT
@@ -474,64 +492,64 @@ signing_key:
474
492
  specification_version: 4
475
493
  summary: Bandwidth Ruby SDK
476
494
  test_files:
477
- - spec/api/mfa_api_spec.rb
478
- - spec/api/statistics_api_spec.rb
479
- - spec/api/calls_api_spec.rb
480
- - spec/api/media_api_spec.rb
481
- - spec/api/messages_api_spec.rb
482
- - spec/api/recordings_api_spec.rb
483
- - spec/api/transcriptions_api_spec.rb
484
- - spec/api/phone_number_lookup_api_spec.rb
485
- - spec/api/conferences_api_spec.rb
486
- - spec/api_client_spec.rb
487
- - spec/api_error_spec.rb
488
495
  - spec/call_utils.rb
489
- - spec/configuration_spec.rb
490
496
  - spec/fixtures/ruby_cat.jpeg
491
- - spec/integration/recordings_api_integration_spec.rb
492
- - spec/integration/messages_api_integration_spec.rb
493
- - spec/integration/conferences_api_integration_spec.rb
494
- - spec/integration/mfa_api_integration_spec.rb
495
- - spec/integration/phone_number_lookup_api_integration_spec.rb
496
- - spec/integration/calls_api_integration_spec.rb
497
- - spec/integration/transcriptions_api_integration_spec.rb
498
- - spec/integration/media_api_integration_spec.rb
499
- - spec/integration/statistics_api_integration_spec.rb
500
- - spec/models/message_spec.rb
501
- - spec/models/call_state_enum_spec.rb
502
- - spec/models/verify_code_request_spec.rb
503
- - spec/models/deferred_result_spec.rb
504
- - spec/models/call_state_spec.rb
505
- - spec/models/bxml/bxml_spec.rb
506
- - spec/models/bxml/nestable_verb_spec.rb
507
- - spec/models/bxml/verb_spec.rb
508
- - spec/models/bxml/verbs/conference_spec.rb
509
- - spec/models/bxml/verbs/stream_param_spec.rb
510
- - spec/models/bxml/verbs/speak_sentence_spec.rb
511
- - spec/models/bxml/verbs/stop_recording_spec.rb
512
- - spec/models/bxml/verbs/resume_recording_spec.rb
513
- - spec/models/bxml/verbs/start_stream_spec.rb
514
- - spec/models/bxml/verbs/start_gather_spec.rb
515
- - spec/models/bxml/verbs/redirect_spec.rb
516
- - spec/models/bxml/verbs/sip_uri_spec.rb
517
- - spec/models/bxml/verbs/ring_spec.rb
518
- - spec/models/bxml/verbs/custom_param_spec.rb
519
- - spec/models/bxml/verbs/send_dtmf_spec.rb
520
- - spec/models/bxml/verbs/start_transcription_spec.rb
521
- - spec/models/bxml/verbs/gather_spec.rb
522
- - spec/models/bxml/verbs/phone_number_spec.rb
523
- - spec/models/bxml/verbs/bridge_spec.rb
524
- - spec/models/bxml/verbs/transfer_spec.rb
525
- - spec/models/bxml/verbs/pause_spec.rb
526
- - spec/models/bxml/verbs/start_recording_spec.rb
527
- - spec/models/bxml/verbs/stop_gather_spec.rb
528
- - spec/models/bxml/verbs/stop_transcription_spec.rb
529
- - spec/models/bxml/verbs/play_audio_spec.rb
530
- - spec/models/bxml/verbs/tag_spec.rb
531
- - spec/models/bxml/verbs/hangup_spec.rb
532
- - spec/models/bxml/verbs/forward_spec.rb
533
- - spec/models/bxml/verbs/pause_recording_spec.rb
534
- - spec/models/bxml/verbs/stop_stream_spec.rb
535
- - spec/models/bxml/verbs/record_spec.rb
536
- - spec/models/bxml/response_spec.rb
497
+ - spec/smoke/conferences_api_spec.rb
498
+ - spec/smoke/mfa_api_spec.rb
499
+ - spec/smoke/recordings_api_spec.rb
500
+ - spec/smoke/media_api_spec.rb
501
+ - spec/smoke/calls_api_spec.rb
502
+ - spec/smoke/transcriptions_api_spec.rb
503
+ - spec/smoke/messages_api_spec.rb
504
+ - spec/smoke/phone_number_lookup_api_spec.rb
505
+ - spec/smoke/statistics_api_spec.rb
537
506
  - spec/spec_helper.rb
507
+ - spec/unit/models/message_spec.rb
508
+ - spec/unit/models/bxml/verbs/redirect_spec.rb
509
+ - spec/unit/models/bxml/verbs/stop_gather_spec.rb
510
+ - spec/unit/models/bxml/verbs/tag_spec.rb
511
+ - spec/unit/models/bxml/verbs/start_transcription_spec.rb
512
+ - spec/unit/models/bxml/verbs/stream_param_spec.rb
513
+ - spec/unit/models/bxml/verbs/pause_spec.rb
514
+ - spec/unit/models/bxml/verbs/send_dtmf_spec.rb
515
+ - spec/unit/models/bxml/verbs/transfer_spec.rb
516
+ - spec/unit/models/bxml/verbs/stop_recording_spec.rb
517
+ - spec/unit/models/bxml/verbs/conference_spec.rb
518
+ - spec/unit/models/bxml/verbs/stop_transcription_spec.rb
519
+ - spec/unit/models/bxml/verbs/play_audio_spec.rb
520
+ - spec/unit/models/bxml/verbs/custom_param_spec.rb
521
+ - spec/unit/models/bxml/verbs/forward_spec.rb
522
+ - spec/unit/models/bxml/verbs/gather_spec.rb
523
+ - spec/unit/models/bxml/verbs/sip_uri_spec.rb
524
+ - spec/unit/models/bxml/verbs/phone_number_spec.rb
525
+ - spec/unit/models/bxml/verbs/stop_stream_spec.rb
526
+ - spec/unit/models/bxml/verbs/start_recording_spec.rb
527
+ - spec/unit/models/bxml/verbs/bridge_spec.rb
528
+ - spec/unit/models/bxml/verbs/record_spec.rb
529
+ - spec/unit/models/bxml/verbs/start_stream_spec.rb
530
+ - spec/unit/models/bxml/verbs/hangup_spec.rb
531
+ - spec/unit/models/bxml/verbs/ring_spec.rb
532
+ - spec/unit/models/bxml/verbs/pause_recording_spec.rb
533
+ - spec/unit/models/bxml/verbs/speak_sentence_spec.rb
534
+ - spec/unit/models/bxml/verbs/resume_recording_spec.rb
535
+ - spec/unit/models/bxml/verbs/start_gather_spec.rb
536
+ - spec/unit/models/bxml/bxml_spec.rb
537
+ - spec/unit/models/bxml/nestable_verb_spec.rb
538
+ - spec/unit/models/bxml/response_spec.rb
539
+ - spec/unit/models/bxml/verb_spec.rb
540
+ - spec/unit/models/call_state_enum_spec.rb
541
+ - spec/unit/models/verify_code_request_spec.rb
542
+ - spec/unit/models/call_state_spec.rb
543
+ - spec/unit/models/deferred_result_spec.rb
544
+ - spec/unit/api/conferences_api_spec.rb
545
+ - spec/unit/api/mfa_api_spec.rb
546
+ - spec/unit/api/recordings_api_spec.rb
547
+ - spec/unit/api/media_api_spec.rb
548
+ - spec/unit/api/calls_api_spec.rb
549
+ - spec/unit/api/transcriptions_api_spec.rb
550
+ - spec/unit/api/messages_api_spec.rb
551
+ - spec/unit/api/phone_number_lookup_api_spec.rb
552
+ - spec/unit/api/statistics_api_spec.rb
553
+ - spec/unit/client/api_client_spec.rb
554
+ - spec/unit/client/api_error_spec.rb
555
+ - spec/unit/client/configuration_spec.rb
@@ -1,261 +0,0 @@
1
- # Unit tests for Bandwidth::CallsApi
2
- describe 'CallsApi' do
3
- # call info
4
- let(:call_id) { 'c-15ac29a2-006c67ad-060f-4b98-b148-b753d6e5e2ce' }
5
- let(:enqueued_time) { '2023-06-23T18:43:51.248Z' }
6
- let(:call_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}" }
7
- let(:call_timeout) { 30.0 }
8
- let(:callback_timeout) { 15.0 }
9
- let(:display_name) { 'Ruby SDK' }
10
- let(:answer_method) { Bandwidth::CallbackMethodEnum::POST }
11
- let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' }
12
- let(:answer_fallback_url) { BASE_CALLBACK_URL + '/callbacks/answer' }
13
- let(:answer_fallback_method) { Bandwidth::CallbackMethodEnum::POST }
14
- let(:disconnect_method) { Bandwidth::CallbackMethodEnum::GET }
15
- let(:disconnect_url) { BASE_CALLBACK_URL + '/callbacks/disconnect' }
16
- let(:priority) { 5 }
17
- let(:direction) { Bandwidth::CallDirectionEnum::OUTBOUND }
18
- let(:state) { 'disconnected' }
19
- let(:stir_shaken) { {} }
20
- let(:start_time) { '2023-06-23T19:11:06.049Z' }
21
- let(:end_time) { '2023-06-23T19:11:06.175Z' }
22
- let(:disconnect_cause) { 'rejected' }
23
- let(:error_message) { 'Destination not found' }
24
- let(:error_id) { '779941c4-6482-461d-b370-177b4ad0b5a7' }
25
- let(:last_update) { '2023-06-23T19:11:06.175Z' }
26
- let(:tag) { 'test tag' }
27
-
28
- # stubs
29
- let(:create_call_headers_stub) { { 'content-type' => 'application/json' } }
30
- let(:create_call_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"enqueuedTime\":\"#{enqueued_time}\",\"callUrl\":\"#{call_url}\",\"callTimeout\":#{call_timeout},\"callbackTimeout\":#{callback_timeout},\"tag\":\"#{tag}\",\"answerMethod\":\"#{answer_method}\",\"answerUrl\":\"#{answer_url}\",\"answerFallbackUrl\":\"#{answer_fallback_url}\",\"answerFallbackMethod\":\"#{answer_fallback_method}\",\"disconnectMethod\":\"#{disconnect_method}\",\"disconnectUrl\":\"#{disconnect_url}\",\"priority\":#{priority}}" }
31
- let(:create_call_bad_request_stub) { '{"type":"validation","description":"Invalid to: must be a valid SIP URI or an E164 TN"}' }
32
- let(:get_calls_headers_stub) { { 'content-type' => 'application/json' } }
33
- let(:get_calls_body_stub) { "[{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"direction\":\"#{direction}\",\"state\":\"#{state}\",\"stirShaken\":#{stir_shaken},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"disconnectCause\":\"#{disconnect_cause}\",\"errorMessage\":\"#{error_message}\",\"errorId\":\"#{error_id}\",\"lastUpdate\":\"#{last_update}\"}]" }
34
- let(:get_call_state_headers_stub) { { 'content-type' => 'application/json' } }
35
- let(:get_call_state_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"direction\":\"#{direction}\",\"state\":\"#{state}\",\"stirShaken\":#{stir_shaken},\"enqueuedTime\":\"#{enqueued_time}\",\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"disconnectCause\":\"#{disconnect_cause}\",\"errorMessage\":\"#{error_message}\",\"errorId\":\"#{error_id}\",\"lastUpdate\":\"#{last_update}\"}" }
36
- let(:get_call_state_not_found_stub) { '{"type":"validation","description":"Call does-not-exist was not found."}' }
37
- let(:get_call_state_unauthorized_stub) { '{"type":"authentication-error","description":"The credentials provided were invalid"}' }
38
- let(:get_call_state_forbidden_stub) { '{"type":"authorization-error","description":"Access is denied"}' }
39
- let(:update_call_headers_stub) { { 'content-length' => '0' } }
40
-
41
- before(:all) do
42
- Bandwidth.configure do |config|
43
- config.debugging = true
44
- end
45
- @calls_api_instance = Bandwidth::CallsApi.new
46
- end
47
-
48
- describe 'test an instance of CallsApi' do
49
- it 'should create an instance of CallsApi' do
50
- expect(@calls_api_instance).to be_instance_of(Bandwidth::CallsApi)
51
- end
52
- end
53
-
54
- # Create Call
55
- describe '#create_call' do
56
- it 'creates a call with amd' do
57
- stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls").
58
- to_return(status: 201, headers: create_call_headers_stub, body: create_call_body_stub)
59
-
60
- amd_config = Bandwidth::MachineDetectionConfiguration.new(
61
- mode: 'async',
62
- detection_timeout: 5.0,
63
- silence_timeout: 5.0,
64
- speech_threshold: 5.0,
65
- speech_end_threshold: 5.0,
66
- delay_result: true,
67
- callback_url: BASE_CALLBACK_URL + '/machineDetection',
68
- callback_method: Bandwidth::CallbackMethodEnum::POST
69
- )
70
-
71
- call_body = Bandwidth::CreateCall.new(
72
- application_id: BW_VOICE_APPLICATION_ID,
73
- to: USER_NUMBER,
74
- from: BW_NUMBER,
75
- display_name: display_name,
76
- answer_url: answer_url,
77
- answer_fallback_url: answer_fallback_url,
78
- answer_method: answer_method,
79
- disconnect_url: disconnect_url,
80
- disconnect_method: disconnect_method,
81
- machine_detection: amd_config,
82
- call_timeout: call_timeout,
83
- callback_timeout: callback_timeout,
84
- tag: tag
85
- )
86
-
87
- data, status_code, headers = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
88
-
89
- expect(status_code).to eq(201)
90
- expect(headers).to eq(create_call_headers_stub)
91
- expect(data).to be_instance_of(Bandwidth::CreateCallResponse)
92
- expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
93
- expect(data.account_id).to eq(BW_ACCOUNT_ID)
94
- expect(data.call_id).to eq(call_id)
95
- expect(data.to).to eq(USER_NUMBER)
96
- expect(data.from).to eq(BW_NUMBER)
97
- expect(data.enqueued_time).to eq(Time.parse(enqueued_time))
98
- expect(data.call_url).to eq(call_url)
99
- expect(data.call_timeout).to eq(call_timeout)
100
- expect(data.callback_timeout).to eq(callback_timeout)
101
- expect(data.tag).to eq(tag)
102
- expect(data.answer_method).to eq(answer_method)
103
- expect(data.answer_url).to eq(answer_url)
104
- expect(data.answer_fallback_method).to eq(answer_fallback_method)
105
- expect(data.answer_fallback_url).to eq(answer_fallback_url)
106
- expect(data.disconnect_method).to eq(disconnect_method)
107
- expect(data.disconnect_url).to eq(disconnect_url)
108
- expect(data.priority).to eq(priority)
109
- end
110
-
111
- it 'causes an ArgumentError for a missing account_id' do
112
- expect {
113
- @calls_api_instance.create_call(nil, {})
114
- }.to raise_error(ArgumentError)
115
- end
116
-
117
- it 'causes an ArgumentError for a missing create_call' do
118
- expect {
119
- @calls_api_instance.create_call(BW_ACCOUNT_ID, nil)
120
- }.to raise_error(ArgumentError)
121
- end
122
- end
123
-
124
- # Get Calls
125
- describe '#list_calls' do
126
- it 'gets a list of calls' do
127
- stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls").
128
- to_return(status: 200, headers: get_calls_headers_stub, body: get_calls_body_stub)
129
-
130
- data, status_code, headers = @calls_api_instance.list_calls_with_http_info(BW_ACCOUNT_ID)
131
-
132
- expect(status_code).to eq(200)
133
- expect(headers).to eq(get_calls_headers_stub)
134
- expect(data).to be_instance_of(Array)
135
- expect(data[0]).to be_instance_of(Bandwidth::CallState)
136
- expect(data[0].application_id).to eq(BW_VOICE_APPLICATION_ID)
137
- expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
138
- expect(data[0].call_id).to eq(call_id)
139
- expect(data[0].to).to eq(USER_NUMBER)
140
- expect(data[0].from).to eq(BW_NUMBER)
141
- expect(data[0].direction).to eq(direction)
142
- expect(data[0].stir_shaken).to eq(stir_shaken)
143
- expect(data[0].state).to eq(state)
144
- expect(data[0].start_time).to eq(Time.parse(start_time))
145
- expect(data[0].end_time).to eq(Time.parse(end_time))
146
- expect(data[0].disconnect_cause).to eq(disconnect_cause)
147
- expect(data[0].error_message).to eq(error_message)
148
- expect(data[0].error_id).to eq(error_id)
149
- expect(data[0].last_update).to eq(Time.parse(last_update))
150
- end
151
- end
152
-
153
- # Get Call State Information
154
- describe '#get_call_state' do
155
- it 'gets the call state' do
156
- stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}").
157
- to_return(status: 200, headers: get_call_state_headers_stub, body: get_call_state_body_stub)
158
-
159
- data, status_code, headers = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, call_id)
160
-
161
- expect(status_code).to eq(200)
162
- expect(headers).to eq(get_call_state_headers_stub)
163
- expect(data).to be_instance_of(Bandwidth::CallState)
164
- expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
165
- expect(data.account_id).to eq(BW_ACCOUNT_ID)
166
- expect(data.call_id).to eq(call_id)
167
- expect(data.to).to eq(USER_NUMBER)
168
- expect(data.from).to eq(BW_NUMBER)
169
- expect(data.direction).to eq(direction)
170
- expect(data.stir_shaken).to eq(stir_shaken)
171
- expect(data.state).to eq(state)
172
- expect(data.enqueued_time).to eq(Time.parse(enqueued_time))
173
- expect(data.start_time).to eq(Time.parse(start_time))
174
- expect(data.end_time).to eq(Time.parse(end_time))
175
- expect(data.disconnect_cause).to eq(disconnect_cause)
176
- expect(data.error_message).to eq(error_message)
177
- expect(data.error_id).to eq(error_id)
178
- expect(data.last_update).to eq(Time.parse(last_update))
179
- end
180
-
181
- it 'causes an ArgumentError for a missing account_id' do
182
- expect {
183
- @calls_api_instance.get_call_state(nil, '')
184
- }.to raise_error(ArgumentError)
185
- end
186
-
187
- it 'causes an ArgumentError for a missing call_id' do
188
- expect {
189
- @calls_api_instance.get_call_state(BW_ACCOUNT_ID, nil)
190
- }.to raise_error(ArgumentError)
191
- end
192
- end
193
-
194
- # Update Call
195
- describe '#update_call' do
196
- it 'creates and updates a call' do
197
- stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}").
198
- to_return(status: 200, headers: update_call_headers_stub)
199
-
200
- update_call_body = Bandwidth::UpdateCall.new(
201
- state: Bandwidth::CallStateEnum::ACTIVE,
202
- redirect_url: MANTECA_BASE_URL + '/bxml/pause'
203
- )
204
-
205
- _data, status_code, headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, update_call_body)
206
-
207
- expect(status_code).to eq(200)
208
- expect(headers).to eq(update_call_headers_stub)
209
- end
210
-
211
- it 'causes an ArgumentError for a missing account_id' do
212
- expect {
213
- @calls_api_instance.update_call(nil, '', {})
214
- }.to raise_error(ArgumentError)
215
- end
216
-
217
- it 'causes an ArgumentError for a missing call_id' do
218
- expect {
219
- @calls_api_instance.update_call(BW_ACCOUNT_ID, nil, {})
220
- }.to raise_error(ArgumentError)
221
- end
222
-
223
- it 'causes an ArgumentError for a missing update_call' do
224
- expect {
225
- @calls_api_instance.update_call(BW_ACCOUNT_ID, '', nil)
226
- }.to raise_error(ArgumentError)
227
- end
228
- end
229
-
230
- # Update Call BXML
231
- describe '#update_call_bxml' do
232
- it 'updates a call using bxml' do
233
- stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/bxml").
234
- to_return(status: 204)
235
-
236
- update_bxml = '<?xml version="1.0" encoding="UTF-8"?><Bxml><SpeakSentence locale="en_US" gender="female" voice="susan">This is a test bxml response</SpeakSentence><Pause duration="3"/></Bxml>'
237
-
238
- _data, status_code = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, update_bxml)
239
-
240
- expect(status_code).to eq(204)
241
- end
242
-
243
- it 'causes an ArgumentError for a missing account_id' do
244
- expect {
245
- @calls_api_instance.update_call_bxml(nil, '', {})
246
- }.to raise_error(ArgumentError)
247
- end
248
-
249
- it 'causes an ArgumentError for a missing call_id' do
250
- expect {
251
- @calls_api_instance.update_call_bxml(BW_ACCOUNT_ID, nil, {})
252
- }.to raise_error(ArgumentError)
253
- end
254
-
255
- it 'causes an ArgumentError for a missing body' do
256
- expect {
257
- @calls_api_instance.update_call_bxml(BW_ACCOUNT_ID, '', nil)
258
- }.to raise_error(ArgumentError)
259
- end
260
- end
261
- end