bandwidth-sdk 11.0.0.pre.beta.1.1 → 11.0.0.pre.beta.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (380) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/Gemfile.lock +44 -20
  4. data/README.md +7 -3
  5. data/Rakefile +10 -2
  6. data/bandwidth-sdk.gemspec +12 -12
  7. data/bandwidth.yml +401 -352
  8. data/coverage/.last_run.json +5 -0
  9. data/coverage/.resultset.json +9792 -0
  10. data/coverage/.resultset.json.lock +0 -0
  11. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc.png +0 -0
  12. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
  13. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_both.png +0 -0
  14. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc.png +0 -0
  15. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
  16. data/coverage/assets/0.12.3/application.css +1 -0
  17. data/coverage/assets/0.12.3/application.js +7 -0
  18. data/coverage/assets/0.12.3/colorbox/border.png +0 -0
  19. data/coverage/assets/0.12.3/colorbox/controls.png +0 -0
  20. data/coverage/assets/0.12.3/colorbox/loading.gif +0 -0
  21. data/coverage/assets/0.12.3/colorbox/loading_background.png +0 -0
  22. data/coverage/assets/0.12.3/favicon_green.png +0 -0
  23. data/coverage/assets/0.12.3/favicon_red.png +0 -0
  24. data/coverage/assets/0.12.3/favicon_yellow.png +0 -0
  25. data/coverage/assets/0.12.3/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  26. data/coverage/assets/0.12.3/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  27. data/coverage/assets/0.12.3/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  28. data/coverage/assets/0.12.3/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  29. data/coverage/assets/0.12.3/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  30. data/coverage/assets/0.12.3/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  31. data/coverage/assets/0.12.3/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  32. data/coverage/assets/0.12.3/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  33. data/coverage/assets/0.12.3/images/ui-icons_222222_256x240.png +0 -0
  34. data/coverage/assets/0.12.3/images/ui-icons_2e83ff_256x240.png +0 -0
  35. data/coverage/assets/0.12.3/images/ui-icons_454545_256x240.png +0 -0
  36. data/coverage/assets/0.12.3/images/ui-icons_888888_256x240.png +0 -0
  37. data/coverage/assets/0.12.3/images/ui-icons_cd0a0a_256x240.png +0 -0
  38. data/coverage/assets/0.12.3/loading.gif +0 -0
  39. data/coverage/assets/0.12.3/magnify.png +0 -0
  40. data/coverage/index.html +108612 -0
  41. data/custom_templates/Gemfile.mustache +11 -0
  42. data/custom_templates/README.mustache +170 -0
  43. data/custom_templates/gem.mustache +99 -0
  44. data/custom_templates/gemspec.mustache +37 -0
  45. data/custom_templates/version.mustache +7 -0
  46. data/docs/AnswerCallback.md +3 -3
  47. data/docs/BridgeCompleteCallback.md +2 -2
  48. data/docs/BridgeTargetCompleteCallback.md +2 -2
  49. data/docs/CallState.md +2 -2
  50. data/docs/CallsApi.md +15 -15
  51. data/docs/Conference.md +4 -4
  52. data/docs/ConferenceCompletedCallback.md +2 -2
  53. data/docs/ConferenceCreatedCallback.md +2 -2
  54. data/docs/ConferenceMemberExitCallback.md +2 -2
  55. data/docs/ConferenceMemberJoinCallback.md +2 -2
  56. data/docs/ConferenceRecordingAvailableCallback.md +2 -2
  57. data/docs/ConferenceRedirectCallback.md +2 -2
  58. data/docs/ConferencesApi.md +42 -42
  59. data/docs/CreateCall.md +11 -11
  60. data/docs/CreateCallResponse.md +11 -11
  61. data/docs/DisconnectCallback.md +2 -2
  62. data/docs/DtmfCallback.md +2 -2
  63. data/docs/GatherCallback.md +2 -2
  64. data/docs/InitiateCallback.md +2 -2
  65. data/docs/ListMessageItem.md +5 -3
  66. data/docs/MFAApi.md +6 -6
  67. data/docs/MachineDetectionCompleteCallback.md +3 -3
  68. data/docs/MachineDetectionConfiguration.md +2 -2
  69. data/docs/MachineDetectionResult.md +20 -0
  70. data/docs/Message.md +2 -2
  71. data/docs/MessageDeliveredCallbackMessage.md +1 -1
  72. data/docs/MessageFailedCallbackMessage.md +1 -1
  73. data/docs/MessageRequest.md +1 -1
  74. data/docs/MessageSendingCallbackMessage.md +1 -1
  75. data/docs/MessagesApi.md +5 -1
  76. data/docs/MessagesList.md +1 -1
  77. data/docs/PhoneNumberLookupApi.md +4 -4
  78. data/docs/RecordingAvailableCallback.md +2 -2
  79. data/docs/RecordingCompleteCallback.md +2 -2
  80. data/docs/RecordingsApi.md +52 -52
  81. data/docs/RedirectCallback.md +2 -2
  82. data/docs/StatisticsApi.md +2 -2
  83. data/docs/TranscribeRecording.md +4 -2
  84. data/docs/TranscriptionAvailableCallback.md +2 -2
  85. data/docs/TransferAnswerCallback.md +2 -2
  86. data/docs/TransferCompleteCallback.md +2 -2
  87. data/docs/TransferDisconnectCallback.md +2 -2
  88. data/docs/UpdateCall.md +3 -3
  89. data/docs/UpdateConference.md +3 -3
  90. data/lib/bandwidth-sdk/api/calls_api.rb +18 -18
  91. data/lib/bandwidth-sdk/api/conferences_api.rb +46 -46
  92. data/lib/bandwidth-sdk/api/media_api.rb +2 -2
  93. data/lib/bandwidth-sdk/api/messages_api.rb +8 -2
  94. data/lib/bandwidth-sdk/api/mfa_api.rb +10 -10
  95. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +6 -6
  96. data/lib/bandwidth-sdk/api/recordings_api.rb +55 -55
  97. data/lib/bandwidth-sdk/api/statistics_api.rb +3 -3
  98. data/lib/bandwidth-sdk/api_client.rb +1 -1
  99. data/lib/bandwidth-sdk/api_error.rb +2 -2
  100. data/lib/bandwidth-sdk/configuration.rb +3 -3
  101. data/lib/bandwidth-sdk/models/account_statistics.rb +2 -4
  102. data/lib/bandwidth-sdk/models/answer_callback.rb +4 -7
  103. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +3 -5
  104. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +3 -5
  105. data/lib/bandwidth-sdk/models/bxml/bxml.rb +2 -4
  106. data/lib/bandwidth-sdk/models/bxml/nestable_verb.rb +3 -7
  107. data/lib/bandwidth-sdk/models/bxml/response.rb +2 -4
  108. data/lib/bandwidth-sdk/models/bxml/root.rb +3 -3
  109. data/lib/bandwidth-sdk/models/bxml/verb.rb +4 -5
  110. data/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb +2 -4
  111. data/lib/bandwidth-sdk/models/bxml/verbs/conference.rb +2 -5
  112. data/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb +16 -0
  113. data/lib/bandwidth-sdk/models/bxml/verbs/forward.rb +2 -4
  114. data/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +3 -5
  115. data/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb +2 -4
  116. data/lib/bandwidth-sdk/models/bxml/verbs/pause.rb +2 -4
  117. data/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb +2 -4
  118. data/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb +2 -4
  119. data/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb +2 -4
  120. data/lib/bandwidth-sdk/models/bxml/verbs/record.rb +2 -4
  121. data/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb +2 -4
  122. data/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb +2 -4
  123. data/lib/bandwidth-sdk/models/bxml/verbs/ring.rb +2 -4
  124. data/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb +2 -4
  125. data/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb +2 -4
  126. data/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb +3 -5
  127. data/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb +2 -4
  128. data/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb +2 -4
  129. data/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +2 -4
  130. data/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +29 -0
  131. data/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb +2 -4
  132. data/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb +2 -4
  133. data/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb +2 -4
  134. data/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb +15 -0
  135. data/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb +2 -4
  136. data/lib/bandwidth-sdk/models/bxml/verbs/tag.rb +2 -4
  137. data/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +2 -4
  138. data/lib/bandwidth-sdk/models/call_direction_enum.rb +3 -3
  139. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +2 -4
  140. data/lib/bandwidth-sdk/models/call_state.rb +4 -6
  141. data/lib/bandwidth-sdk/models/call_state_enum.rb +3 -3
  142. data/lib/bandwidth-sdk/models/callback_method_enum.rb +3 -3
  143. data/lib/bandwidth-sdk/models/code_request.rb +2 -4
  144. data/lib/bandwidth-sdk/models/conference.rb +5 -7
  145. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +3 -5
  146. data/lib/bandwidth-sdk/models/conference_created_callback.rb +3 -5
  147. data/lib/bandwidth-sdk/models/conference_member.rb +2 -4
  148. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +3 -5
  149. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +3 -5
  150. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +3 -5
  151. data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +2 -4
  152. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +3 -5
  153. data/lib/bandwidth-sdk/models/conference_state_enum.rb +3 -3
  154. data/lib/bandwidth-sdk/models/create_call.rb +14 -7
  155. data/lib/bandwidth-sdk/models/create_call_response.rb +10 -12
  156. data/lib/bandwidth-sdk/models/create_lookup_response.rb +2 -4
  157. data/lib/bandwidth-sdk/models/create_message_request_error.rb +2 -4
  158. data/lib/bandwidth-sdk/models/deferred_result.rb +2 -4
  159. data/lib/bandwidth-sdk/models/disconenct_callback.rb +1 -3
  160. data/lib/bandwidth-sdk/models/disconnect_callback.rb +3 -5
  161. data/lib/bandwidth-sdk/models/diversion.rb +2 -4
  162. data/lib/bandwidth-sdk/models/dtmf_callback.rb +3 -5
  163. data/lib/bandwidth-sdk/models/field_error.rb +2 -4
  164. data/lib/bandwidth-sdk/models/file_format_enum.rb +3 -3
  165. data/lib/bandwidth-sdk/models/gather_callback.rb +3 -5
  166. data/lib/bandwidth-sdk/models/inbound_message_callback.rb +2 -4
  167. data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +3 -4
  168. data/lib/bandwidth-sdk/models/initiate_callback.rb +3 -5
  169. data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +3 -3
  170. data/lib/bandwidth-sdk/models/list_message_item.rb +19 -10
  171. data/lib/bandwidth-sdk/models/lookup_request.rb +2 -4
  172. data/lib/bandwidth-sdk/models/lookup_result.rb +2 -4
  173. data/lib/bandwidth-sdk/models/lookup_status.rb +2 -4
  174. data/lib/bandwidth-sdk/models/lookup_status_enum.rb +5 -5
  175. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +4 -7
  176. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +2 -4
  177. data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +3 -3
  178. data/lib/bandwidth-sdk/models/machine_detection_result.rb +229 -0
  179. data/lib/bandwidth-sdk/models/media.rb +2 -4
  180. data/lib/bandwidth-sdk/models/message.rb +3 -5
  181. data/lib/bandwidth-sdk/models/message_delivered_callback.rb +2 -4
  182. data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +3 -4
  183. data/lib/bandwidth-sdk/models/message_direction_enum.rb +3 -3
  184. data/lib/bandwidth-sdk/models/message_failed_callback.rb +2 -4
  185. data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +3 -4
  186. data/lib/bandwidth-sdk/models/message_request.rb +3 -5
  187. data/lib/bandwidth-sdk/models/message_sending_callback.rb +2 -4
  188. data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +3 -4
  189. data/lib/bandwidth-sdk/models/message_status_enum.rb +9 -9
  190. data/lib/bandwidth-sdk/models/message_type_enum.rb +3 -3
  191. data/lib/bandwidth-sdk/models/messages_list.rb +3 -5
  192. data/lib/bandwidth-sdk/models/messaging_code_response.rb +2 -4
  193. data/lib/bandwidth-sdk/models/messaging_request_error.rb +2 -4
  194. data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +2 -4
  195. data/lib/bandwidth-sdk/models/mfa_request_error.rb +2 -4
  196. data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +2 -4
  197. data/lib/bandwidth-sdk/models/page_info.rb +2 -4
  198. data/lib/bandwidth-sdk/models/priority_enum.rb +3 -3
  199. data/lib/bandwidth-sdk/models/recording_available_callback.rb +3 -5
  200. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +3 -5
  201. data/lib/bandwidth-sdk/models/recording_state_enum.rb +3 -3
  202. data/lib/bandwidth-sdk/models/redirect_callback.rb +3 -5
  203. data/lib/bandwidth-sdk/models/redirect_method_enum.rb +3 -3
  204. data/lib/bandwidth-sdk/models/stir_shaken.rb +2 -4
  205. data/lib/bandwidth-sdk/models/tag.rb +2 -4
  206. data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +2 -4
  207. data/lib/bandwidth-sdk/models/transcribe_recording.rb +20 -9
  208. data/lib/bandwidth-sdk/models/transcription.rb +2 -4
  209. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +3 -5
  210. data/lib/bandwidth-sdk/models/transcription_list.rb +2 -4
  211. data/lib/bandwidth-sdk/models/transcription_metadata.rb +2 -4
  212. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +3 -5
  213. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +3 -5
  214. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +3 -5
  215. data/lib/bandwidth-sdk/models/update_call.rb +12 -5
  216. data/lib/bandwidth-sdk/models/update_call_recording.rb +2 -4
  217. data/lib/bandwidth-sdk/models/update_conference.rb +3 -5
  218. data/lib/bandwidth-sdk/models/update_conference_member.rb +2 -4
  219. data/lib/bandwidth-sdk/models/verify_code_request.rb +2 -4
  220. data/lib/bandwidth-sdk/models/verify_code_response.rb +2 -4
  221. data/lib/bandwidth-sdk/models/voice_api_error.rb +2 -4
  222. data/lib/bandwidth-sdk/models/voice_code_response.rb +2 -4
  223. data/lib/bandwidth-sdk/version.rb +2 -2
  224. data/lib/bandwidth-sdk.rb +5 -1
  225. data/openapi-config.yml +1 -0
  226. data/openapitools.json +7 -0
  227. data/spec/api/calls_api_spec.rb +228 -0
  228. data/spec/api/conferences_api_spec.rb +393 -0
  229. data/spec/api/media_api_spec.rb +129 -0
  230. data/spec/api/messages_api_spec.rb +193 -0
  231. data/spec/api/mfa_api_spec.rb +130 -0
  232. data/spec/api/phone_number_lookup_api_spec.rb +100 -0
  233. data/spec/api/recordings_api_spec.rb +395 -0
  234. data/spec/api/statistics_api_spec.rb +45 -0
  235. data/spec/api_client_spec.rb +377 -0
  236. data/spec/api_error_spec.rb +23 -0
  237. data/spec/call_utils.rb +28 -28
  238. data/spec/configuration_spec.rb +178 -0
  239. data/spec/integration/calls_api_integration_spec.rb +88 -69
  240. data/spec/integration/conferences_api_integration_spec.rb +74 -68
  241. data/spec/integration/media_api_integration_spec.rb +38 -32
  242. data/spec/integration/messages_api_integration_spec.rb +63 -50
  243. data/spec/integration/mfa_api_integration_spec.rb +41 -33
  244. data/spec/integration/phone_number_lookup_api_integration_spec.rb +26 -22
  245. data/spec/integration/recordings_api_integration_spec.rb +84 -77
  246. data/spec/integration/statistics_api_integration_spec.rb +15 -14
  247. data/spec/{unit/models → models}/bxml/bxml_spec.rb +0 -2
  248. data/spec/{unit/models → models}/bxml/nestable_verb_spec.rb +1 -3
  249. data/spec/{unit/models → models}/bxml/response_spec.rb +0 -2
  250. data/spec/{unit/models → models}/bxml/verb_spec.rb +1 -14
  251. data/spec/{unit/models → models}/bxml/verbs/bridge_spec.rb +0 -2
  252. data/spec/{unit/models → models}/bxml/verbs/conference_spec.rb +0 -2
  253. data/spec/models/bxml/verbs/custom_param_spec.rb +36 -0
  254. data/spec/{unit/models → models}/bxml/verbs/forward_spec.rb +0 -2
  255. data/spec/{unit/models → models}/bxml/verbs/gather_spec.rb +0 -2
  256. data/spec/{unit/models → models}/bxml/verbs/hangup_spec.rb +0 -2
  257. data/spec/{unit/models → models}/bxml/verbs/pause_recording_spec.rb +0 -2
  258. data/spec/{unit/models → models}/bxml/verbs/pause_spec.rb +0 -2
  259. data/spec/{unit/models → models}/bxml/verbs/phone_number_spec.rb +0 -2
  260. data/spec/{unit/models → models}/bxml/verbs/play_audio_spec.rb +0 -2
  261. data/spec/{unit/models → models}/bxml/verbs/record_spec.rb +0 -2
  262. data/spec/{unit/models → models}/bxml/verbs/redirect_spec.rb +0 -2
  263. data/spec/{unit/models → models}/bxml/verbs/resume_recording_spec.rb +0 -2
  264. data/spec/{unit/models → models}/bxml/verbs/ring_spec.rb +0 -2
  265. data/spec/{unit/models → models}/bxml/verbs/send_dtmf_spec.rb +0 -2
  266. data/spec/{unit/models → models}/bxml/verbs/sip_uri_spec.rb +0 -2
  267. data/spec/{unit/models → models}/bxml/verbs/speak_sentence_spec.rb +0 -2
  268. data/spec/{unit/models → models}/bxml/verbs/start_gather_spec.rb +0 -2
  269. data/spec/{unit/models → models}/bxml/verbs/start_recording_spec.rb +0 -2
  270. data/spec/{unit/models → models}/bxml/verbs/start_stream_spec.rb +2 -4
  271. data/spec/models/bxml/verbs/start_transcription_spec.rb +74 -0
  272. data/spec/{unit/models → models}/bxml/verbs/stop_gather_spec.rb +0 -2
  273. data/spec/{unit/models → models}/bxml/verbs/stop_recording_spec.rb +0 -2
  274. data/spec/{unit/models → models}/bxml/verbs/stop_stream_spec.rb +0 -2
  275. data/spec/models/bxml/verbs/stop_transcription_spec.rb +34 -0
  276. data/spec/{unit/models → models}/bxml/verbs/stream_param_spec.rb +0 -2
  277. data/spec/{unit/models → models}/bxml/verbs/tag_spec.rb +0 -2
  278. data/spec/{unit/models → models}/bxml/verbs/transfer_spec.rb +0 -2
  279. data/spec/models/call_state_enum_spec.rb +16 -0
  280. data/spec/models/call_state_spec.rb +181 -0
  281. data/spec/models/deferred_result_spec.rb +87 -0
  282. data/spec/models/message_spec.rb +145 -0
  283. data/spec/models/verify_code_request_spec.rb +134 -0
  284. data/spec/spec_helper.rb +48 -31
  285. metadata +148 -256
  286. data/spec/unit/api/calls_api_spec.rb +0 -89
  287. data/spec/unit/api/conferences_api_spec.rb +0 -163
  288. data/spec/unit/api/media_api_spec.rb +0 -90
  289. data/spec/unit/api/messages_api_spec.rb +0 -73
  290. data/spec/unit/api/mfa_api_spec.rb +0 -74
  291. data/spec/unit/api/phone_number_lookup_api_spec.rb +0 -61
  292. data/spec/unit/api/recordings_api_spec.rb +0 -177
  293. data/spec/unit/api/statistics_api_spec.rb +0 -47
  294. data/spec/unit/models/account_statistics_spec.rb +0 -40
  295. data/spec/unit/models/answer_callback_spec.rb +0 -112
  296. data/spec/unit/models/bridge_complete_callback_spec.rb +0 -124
  297. data/spec/unit/models/bridge_target_complete_callback_spec.rb +0 -106
  298. data/spec/unit/models/call_direction_enum_spec.rb +0 -28
  299. data/spec/unit/models/call_recording_metadata_spec.rb +0 -136
  300. data/spec/unit/models/call_state_enum_spec.rb +0 -28
  301. data/spec/unit/models/call_state_spec.rb +0 -136
  302. data/spec/unit/models/callback_method_enum_spec.rb +0 -28
  303. data/spec/unit/models/code_request_spec.rb +0 -64
  304. data/spec/unit/models/conference_completed_callback_spec.rb +0 -58
  305. data/spec/unit/models/conference_created_callback_spec.rb +0 -58
  306. data/spec/unit/models/conference_member_exit_callback_spec.rb +0 -76
  307. data/spec/unit/models/conference_member_join_callback_spec.rb +0 -76
  308. data/spec/unit/models/conference_member_spec.rb +0 -64
  309. data/spec/unit/models/conference_recording_available_callback_spec.rb +0 -112
  310. data/spec/unit/models/conference_recording_metadata_spec.rb +0 -94
  311. data/spec/unit/models/conference_redirect_callback_spec.rb +0 -58
  312. data/spec/unit/models/conference_spec.rb +0 -76
  313. data/spec/unit/models/conference_state_enum_spec.rb +0 -28
  314. data/spec/unit/models/create_call_response_spec.rb +0 -154
  315. data/spec/unit/models/create_call_spec.rb +0 -142
  316. data/spec/unit/models/create_lookup_response_spec.rb +0 -40
  317. data/spec/unit/models/create_message_request_error_spec.rb +0 -46
  318. data/spec/unit/models/deferred_result_spec.rb +0 -40
  319. data/spec/unit/models/disconnect_callback_spec.rb +0 -130
  320. data/spec/unit/models/diversion_spec.rb +0 -70
  321. data/spec/unit/models/dtmf_callback_spec.rb +0 -130
  322. data/spec/unit/models/field_error_spec.rb +0 -40
  323. data/spec/unit/models/file_format_enum_spec.rb +0 -28
  324. data/spec/unit/models/gather_callback_spec.rb +0 -136
  325. data/spec/unit/models/inbound_message_callback_message_spec.rb +0 -100
  326. data/spec/unit/models/inbound_message_callback_spec.rb +0 -58
  327. data/spec/unit/models/initiate_callback_spec.rb +0 -100
  328. data/spec/unit/models/list_message_direction_enum_spec.rb +0 -28
  329. data/spec/unit/models/list_message_item_spec.rb +0 -124
  330. data/spec/unit/models/lookup_request_spec.rb +0 -34
  331. data/spec/unit/models/lookup_result_spec.rb +0 -82
  332. data/spec/unit/models/lookup_status_enum_spec.rb +0 -28
  333. data/spec/unit/models/lookup_status_spec.rb +0 -52
  334. data/spec/unit/models/machine_detection_complete_callback_spec.rb +0 -112
  335. data/spec/unit/models/machine_detection_configuration_spec.rb +0 -118
  336. data/spec/unit/models/machine_detection_mode_enum_spec.rb +0 -28
  337. data/spec/unit/models/media_spec.rb +0 -46
  338. data/spec/unit/models/message_delivered_callback_message_spec.rb +0 -100
  339. data/spec/unit/models/message_delivered_callback_spec.rb +0 -58
  340. data/spec/unit/models/message_direction_enum_spec.rb +0 -28
  341. data/spec/unit/models/message_failed_callback_message_spec.rb +0 -100
  342. data/spec/unit/models/message_failed_callback_spec.rb +0 -64
  343. data/spec/unit/models/message_request_spec.rb +0 -76
  344. data/spec/unit/models/message_sending_callback_message_spec.rb +0 -100
  345. data/spec/unit/models/message_sending_callback_spec.rb +0 -58
  346. data/spec/unit/models/message_spec.rb +0 -106
  347. data/spec/unit/models/message_status_enum_spec.rb +0 -28
  348. data/spec/unit/models/message_type_enum_spec.rb +0 -28
  349. data/spec/unit/models/messages_list_spec.rb +0 -46
  350. data/spec/unit/models/messaging_code_response_spec.rb +0 -34
  351. data/spec/unit/models/messaging_request_error_spec.rb +0 -40
  352. data/spec/unit/models/mfa_forbidden_request_error_spec.rb +0 -34
  353. data/spec/unit/models/mfa_request_error_spec.rb +0 -40
  354. data/spec/unit/models/mfa_unauthorized_request_error_spec.rb +0 -34
  355. data/spec/unit/models/page_info_spec.rb +0 -52
  356. data/spec/unit/models/priority_enum_spec.rb +0 -28
  357. data/spec/unit/models/recording_available_callback_spec.rb +0 -160
  358. data/spec/unit/models/recording_complete_callback_spec.rb +0 -160
  359. data/spec/unit/models/recording_state_enum_spec.rb +0 -28
  360. data/spec/unit/models/redirect_callback_spec.rb +0 -124
  361. data/spec/unit/models/redirect_method_enum_spec.rb +0 -28
  362. data/spec/unit/models/stir_shaken_spec.rb +0 -46
  363. data/spec/unit/models/tag_spec.rb +0 -40
  364. data/spec/unit/models/tn_lookup_request_error_spec.rb +0 -34
  365. data/spec/unit/models/transcribe_recording_spec.rb +0 -64
  366. data/spec/unit/models/transcription_available_callback_spec.rb +0 -154
  367. data/spec/unit/models/transcription_list_spec.rb +0 -34
  368. data/spec/unit/models/transcription_metadata_spec.rb +0 -52
  369. data/spec/unit/models/transcription_spec.rb +0 -40
  370. data/spec/unit/models/transfer_answer_callback_spec.rb +0 -118
  371. data/spec/unit/models/transfer_complete_callback_spec.rb +0 -136
  372. data/spec/unit/models/transfer_disconnect_callback_spec.rb +0 -148
  373. data/spec/unit/models/update_call_recording_spec.rb +0 -34
  374. data/spec/unit/models/update_call_spec.rb +0 -88
  375. data/spec/unit/models/update_conference_member_spec.rb +0 -46
  376. data/spec/unit/models/update_conference_spec.rb +0 -82
  377. data/spec/unit/models/verify_code_request_spec.rb +0 -52
  378. data/spec/unit/models/verify_code_response_spec.rb +0 -34
  379. data/spec/unit/models/voice_api_error_spec.rb +0 -46
  380. data/spec/unit/models/voice_code_response_spec.rb +0 -34
@@ -0,0 +1,395 @@
1
+ # Unit tests for Bandwidth::RecordingsApi
2
+ describe 'RecordingsApi' do
3
+ # recording info
4
+ let(:call_id) { 'c-3f758f24-40c0bd9f-0a8e-4ab6-88d4-c88a2e961c7d' }
5
+ let(:recording_id) { 'r-fbe05094-87f9b821-e110-4bfb-ac57-82b2bf2bb3d5' }
6
+ let(:duration) { 'PT4.478S' }
7
+ let(:direction) { Bandwidth::CallDirectionEnum::OUTBOUND }
8
+ let(:channels) { 1 }
9
+ let(:start_time) { '2023-06-26T14:58:51.195Z' }
10
+ let(:end_time) { '2023-06-26T14:58:57.502Z' }
11
+ let(:file_format) { Bandwidth::FileFormatEnum::WAV }
12
+ let(:status) { 'complete' }
13
+ let(:media_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/media" }
14
+ let(:text) { 'Now a recording, a long pause.' }
15
+ let(:confidence) { 0.975 }
16
+ let(:test_id) { 'test id' }
17
+
18
+ # stubs
19
+ let(:download_call_recording_body_stub) { 'RIFFFWAVEfmtLISTINFOISFTLavf58.45.100data' }
20
+ let(:download_call_recording_headers_stub) { { 'content-type' => 'audio/vnd.wave', 'content-length' => "#{download_call_recording_body_stub.length}" } }
21
+ let(:get_call_recording_headers_stub) { { 'content-type' => 'application/json' } }
22
+ let(:get_call_recording_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"recordingId\":\"#{recording_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"duration\":\"#{duration}\",\"direction\":\"#{direction}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}" }
23
+ let(:get_call_transcription_headers_stub) { { 'content-type' => 'application/json' } }
24
+ let(:get_call_transcription_body_stub) { "{\"transcripts\":[{\"text\":\"#{text}\",\"confidence\":#{confidence}}]}" }
25
+ let(:list_account_call_recordings_headers_stub) { { 'content-type' => 'application/json' } }
26
+ let(:list_account_call_recordings_body_stub) { "[{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"recordingId\":\"#{recording_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"duration\":\"#{duration}\",\"direction\":\"#{direction}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}]" }
27
+ let(:list_call_recordings_headers_stub) { { 'content-type' => 'application/json' } }
28
+ let(:list_call_recordings_body_stub) { "[{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"recordingId\":\"#{recording_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"duration\":\"#{duration}\",\"direction\":\"#{direction}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}]" }
29
+ let(:update_call_recording_state_headers_stub) { { 'content-length' => '0' } }
30
+
31
+ before(:all) do
32
+ Bandwidth.configure do |config|
33
+ config.return_binary_data = true
34
+ config.debugging = true
35
+ end
36
+ @recordings_api_instance = Bandwidth::RecordingsApi.new
37
+ end
38
+
39
+ describe 'test an instance of RecordingsApi' do
40
+ it 'should create an instance of RecordingsApi' do
41
+ expect(@recordings_api_instance).to be_instance_of(Bandwidth::RecordingsApi)
42
+ end
43
+ end
44
+
45
+ # Delete Transcription
46
+ describe 'delete_call_transcription' do
47
+ it 'deletes the completed call recording transcription' do
48
+ stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/transcription").
49
+ to_return(status: 204)
50
+
51
+ data, status_code, headers = @recordings_api_instance.delete_call_transcription_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
52
+
53
+ expect(status_code).to eq(204)
54
+ end
55
+
56
+ it 'causes an ArgumentError for a missing account_id' do
57
+ expect {
58
+ resp = @recordings_api_instance.delete_call_transcription(nil, '', '')
59
+ }.to raise_error(ArgumentError)
60
+ end
61
+
62
+ it 'causes an ArgumentError for a missing call_id' do
63
+ expect {
64
+ @recordings_api_instance.delete_call_transcription(BW_ACCOUNT_ID, nil, '')
65
+ }.to raise_error(ArgumentError)
66
+ end
67
+
68
+ it 'causes an ArgumentError for a missing recording_id' do
69
+ expect {
70
+ @recordings_api_instance.delete_call_transcription(BW_ACCOUNT_ID, '', nil)
71
+ }.to raise_error(ArgumentError)
72
+ end
73
+ end
74
+
75
+ # Delete Recording
76
+ describe 'delete_recording' do
77
+ it 'deletes the completed call recording data' do
78
+ stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}").
79
+ to_return(status: 204)
80
+
81
+ data, status_code, headers = @recordings_api_instance.delete_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
82
+
83
+ expect(status_code).to eq(204)
84
+ end
85
+
86
+ it 'causes an ArgumentError for a missing account_id' do
87
+ expect {
88
+ resp = @recordings_api_instance.delete_recording(nil, '', '')
89
+ }.to raise_error(ArgumentError)
90
+ end
91
+
92
+ it 'causes an ArgumentError for a missing call_id' do
93
+ expect {
94
+ @recordings_api_instance.delete_recording(BW_ACCOUNT_ID, nil, '')
95
+ }.to raise_error(ArgumentError)
96
+ end
97
+
98
+ it 'causes an ArgumentError for a missing recording_id' do
99
+ expect {
100
+ @recordings_api_instance.delete_recording(BW_ACCOUNT_ID, '', nil)
101
+ }.to raise_error(ArgumentError)
102
+ end
103
+ end
104
+
105
+ # Delete Recording Media
106
+ describe 'delete_recording_media' do
107
+ it 'deletes the completed call recording media' do
108
+ stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/media").
109
+ to_return(status: 204)
110
+
111
+ data, status_code, headers = @recordings_api_instance.delete_recording_media_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
112
+
113
+ expect(status_code).to eq(204)
114
+ end
115
+
116
+ it 'causes an ArgumentError for a missing account_id' do
117
+ expect {
118
+ resp = @recordings_api_instance.delete_recording_media(nil, '', '')
119
+ }.to raise_error(ArgumentError)
120
+ end
121
+
122
+ it 'causes an ArgumentError for a missing call_id' do
123
+ expect {
124
+ @recordings_api_instance.delete_recording_media(BW_ACCOUNT_ID, nil, '')
125
+ }.to raise_error(ArgumentError)
126
+ end
127
+
128
+ it 'causes an ArgumentError for a missing recording_id' do
129
+ expect {
130
+ @recordings_api_instance.delete_recording_media(BW_ACCOUNT_ID, '', nil)
131
+ }.to raise_error(ArgumentError)
132
+ end
133
+ end
134
+
135
+ # Download Recording
136
+ describe 'download_call_recording' do
137
+ it 'downloads a call recording by id' do
138
+ stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/media").
139
+ to_return(status: 200, headers: download_call_recording_headers_stub, body: download_call_recording_body_stub)
140
+
141
+ data, status_code, headers = @recordings_api_instance.download_call_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
142
+
143
+ expect(status_code).to eq(200)
144
+ expect(headers).to eq(download_call_recording_headers_stub)
145
+ expect(data).to eq(download_call_recording_body_stub)
146
+ end
147
+
148
+ it 'causes an ArgumentError for a missing account_id' do
149
+ expect {
150
+ resp = @recordings_api_instance.download_call_recording(nil, '', '')
151
+ }.to raise_error(ArgumentError)
152
+ end
153
+
154
+ it 'causes an ArgumentError for a missing call_id' do
155
+ expect {
156
+ @recordings_api_instance.download_call_recording(BW_ACCOUNT_ID, nil, '')
157
+ }.to raise_error(ArgumentError)
158
+ end
159
+
160
+ it 'causes an ArgumentError for a missing recording_id' do
161
+ expect {
162
+ @recordings_api_instance.download_call_recording(BW_ACCOUNT_ID, '', nil)
163
+ }.to raise_error(ArgumentError)
164
+ end
165
+ end
166
+
167
+ # Get Call Recording
168
+ describe 'get_call_recording' do
169
+ it 'gets a call recording by id' do
170
+ stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}").
171
+ to_return(status: 200, headers: get_call_recording_headers_stub, body: get_call_recording_body_stub)
172
+
173
+ data, status_code, headers = @recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
174
+
175
+ expect(status_code).to eq(200)
176
+ expect(headers).to eq(get_call_recording_headers_stub)
177
+ expect(data).to be_instance_of(Bandwidth::CallRecordingMetadata)
178
+ expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
179
+ expect(data.account_id).to eq(BW_ACCOUNT_ID)
180
+ expect(data.call_id).to eq(call_id)
181
+ expect(data.recording_id).to eq(recording_id)
182
+ expect(data.to).to eq(USER_NUMBER)
183
+ expect(data.from).to eq(BW_NUMBER)
184
+ expect(data.duration).to eq(duration)
185
+ expect(data.direction).to eq(direction)
186
+ expect(data.channels).to eq(channels)
187
+ expect(data.start_time).to eq(Time.parse(start_time))
188
+ expect(data.end_time).to eq(Time.parse(end_time))
189
+ expect(data.file_format).to eq(file_format)
190
+ expect(data.status).to eq(status)
191
+ expect(data.media_url).to eq(media_url)
192
+ end
193
+
194
+ it 'causes an ArgumentError for a missing account_id' do
195
+ expect {
196
+ resp = @recordings_api_instance.get_call_recording(nil, '', '')
197
+ }.to raise_error(ArgumentError)
198
+ end
199
+
200
+ it 'causes an ArgumentError for a missing call_id' do
201
+ expect {
202
+ @recordings_api_instance.get_call_recording(BW_ACCOUNT_ID, nil, '')
203
+ }.to raise_error(ArgumentError)
204
+ end
205
+
206
+ it 'causes an ArgumentError for a missing recording_id' do
207
+ expect {
208
+ @recordings_api_instance.get_call_recording(BW_ACCOUNT_ID, '', nil)
209
+ }.to raise_error(ArgumentError)
210
+ end
211
+ end
212
+
213
+ # Get Transcription
214
+ describe 'get_call_transcription' do
215
+ it 'gets the completed call recording transcription' do
216
+ stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/transcription").
217
+ to_return(status: 200, headers: get_call_transcription_headers_stub, body: get_call_transcription_body_stub)
218
+
219
+ data, status_code, headers = @recordings_api_instance.get_call_transcription_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
220
+
221
+ expect(status_code).to eq(200)
222
+ expect(data).to be_instance_of(Bandwidth::TranscriptionList)
223
+ expect(data.transcripts).to be_instance_of(Array)
224
+ expect(data.transcripts[0]).to be_instance_of(Bandwidth::Transcription)
225
+ expect(data.transcripts[0].text).to eq(text)
226
+ expect(data.transcripts[0].confidence).to eq(confidence)
227
+ end
228
+
229
+ it 'causes an ArgumentError for a missing account_id' do
230
+ expect {
231
+ resp = @recordings_api_instance.get_call_transcription(nil, '', '')
232
+ }.to raise_error(ArgumentError)
233
+ end
234
+
235
+ it 'causes an ArgumentError for a missing call_id' do
236
+ expect {
237
+ @recordings_api_instance.get_call_transcription(BW_ACCOUNT_ID, nil, '')
238
+ }.to raise_error(ArgumentError)
239
+ end
240
+
241
+ it 'causes an ArgumentError for a missing recording_id' do
242
+ expect {
243
+ @recordings_api_instance.get_call_transcription(BW_ACCOUNT_ID, '', nil)
244
+ }.to raise_error(ArgumentError)
245
+ end
246
+ end
247
+
248
+ # Get Call Recordings
249
+ describe 'list_account_call_recordings' do
250
+ it 'lists account call recordings' do
251
+ stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/recordings").
252
+ to_return(status: 200, headers: list_account_call_recordings_headers_stub, body: list_account_call_recordings_body_stub)
253
+
254
+ data, status_code, headers = @recordings_api_instance.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID)
255
+
256
+ expect(status_code).to eq(200)
257
+ expect(data).to be_instance_of(Array)
258
+ expect(data[0]).to be_instance_of(Bandwidth::CallRecordingMetadata)
259
+ expect(data[0].application_id).to eq(BW_VOICE_APPLICATION_ID)
260
+ expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
261
+ expect(data[0].call_id).to eq(call_id)
262
+ expect(data[0].recording_id).to eq(recording_id)
263
+ expect(data[0].to).to eq(USER_NUMBER)
264
+ expect(data[0].from).to eq(BW_NUMBER)
265
+ expect(data[0].duration).to eq(duration)
266
+ expect(data[0].direction).to eq(direction)
267
+ expect(data[0].channels).to eq(channels)
268
+ expect(data[0].start_time).to eq(Time.parse(start_time))
269
+ expect(data[0].end_time).to eq(Time.parse(end_time))
270
+ expect(data[0].file_format).to eq(file_format)
271
+ expect(data[0].status).to eq(status)
272
+ expect(data[0].media_url).to eq(media_url)
273
+ end
274
+
275
+ it 'causes an ArgumentError for a missing account_id' do
276
+ expect {
277
+ resp = @recordings_api_instance.list_account_call_recordings(nil)
278
+ }.to raise_error(ArgumentError)
279
+ end
280
+ end
281
+
282
+ # List Call Recordings
283
+ describe 'list_call_recordings' do
284
+ it 'lists all recordings for a single call' do
285
+ stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings").
286
+ to_return(status: 200, headers: list_call_recordings_headers_stub, body: list_call_recordings_body_stub)
287
+
288
+ data, status_code, headers = @recordings_api_instance.list_call_recordings_with_http_info(BW_ACCOUNT_ID, call_id)
289
+
290
+ expect(status_code).to eq(200)
291
+ expect(data).to be_instance_of(Array)
292
+ expect(data[0].application_id).to eq(BW_VOICE_APPLICATION_ID)
293
+ expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
294
+ expect(data[0].call_id).to eq(call_id)
295
+ expect(data[0].recording_id).to eq(recording_id)
296
+ expect(data[0].to).to eq(USER_NUMBER)
297
+ expect(data[0].from).to eq(BW_NUMBER)
298
+ expect(data[0].duration).to eq(duration)
299
+ expect(data[0].direction).to eq(direction)
300
+ expect(data[0].channels).to eq(channels)
301
+ expect(data[0].start_time).to eq(Time.parse(start_time))
302
+ expect(data[0].end_time).to eq(Time.parse(end_time))
303
+ expect(data[0].file_format).to eq(file_format)
304
+ expect(data[0].status).to eq(status)
305
+ expect(data[0].media_url).to eq(media_url)
306
+ end
307
+
308
+ it 'causes an ArgumentError for a missing account_id' do
309
+ expect {
310
+ resp = @recordings_api_instance.list_call_recordings(nil, '')
311
+ }.to raise_error(ArgumentError)
312
+ end
313
+
314
+ it 'causes an ArgumentError for a missing call_id' do
315
+ expect {
316
+ @recordings_api_instance.list_call_recordings(BW_ACCOUNT_ID, nil)
317
+ }.to raise_error(ArgumentError)
318
+ end
319
+ end
320
+
321
+ # Create Transcription Request
322
+ describe 'transcribe_call_recording' do
323
+ it 'creates a transcription request' do
324
+ stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/transcription").
325
+ to_return(status: 204)
326
+
327
+ transcribe_recording = Bandwidth::TranscribeRecording.new(
328
+ callback_url: BASE_CALLBACK_URL + '/transcriptions',
329
+ tag: test_id
330
+ )
331
+
332
+ data, status_code, headers = @recordings_api_instance.transcribe_call_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id, transcribe_recording)
333
+
334
+ expect(status_code).to eq(204)
335
+ end
336
+
337
+ it 'causes an ArgumentError for a missing account_id' do
338
+ expect {
339
+ resp = @recordings_api_instance.transcribe_call_recording(nil, '', '', '')
340
+ }.to raise_error(ArgumentError)
341
+ end
342
+
343
+ it 'causes an ArgumentError for a missing call_id' do
344
+ expect {
345
+ @recordings_api_instance.transcribe_call_recording(BW_ACCOUNT_ID, nil, '', '')
346
+ }.to raise_error(ArgumentError)
347
+ end
348
+
349
+ it 'causes an ArgumentError for a missing recording_id' do
350
+ expect {
351
+ @recordings_api_instance.transcribe_call_recording(BW_ACCOUNT_ID, '', nil, '')
352
+ }.to raise_error(ArgumentError)
353
+ end
354
+
355
+ it 'causes an ArgumentError for a missing transcribe_recording' do
356
+ expect {
357
+ @recordings_api_instance.transcribe_call_recording(BW_ACCOUNT_ID, '', '', nil)
358
+ }.to raise_error(ArgumentError)
359
+ end
360
+ end
361
+
362
+ # Update Recording
363
+ describe 'update_call_recording_state' do
364
+ it 'updates and ends the manteca call recording' do
365
+ stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recording").
366
+ to_return(status: 200, headers: update_call_recording_state_headers_stub)
367
+
368
+ pause_recording = Bandwidth::UpdateCallRecording.new(
369
+ state: Bandwidth::RecordingStateEnum::PAUSED
370
+ )
371
+
372
+ data, status_code, headers = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, call_id, pause_recording)
373
+
374
+ expect(status_code).to eq(200)
375
+ end
376
+
377
+ it 'causes an ArgumentError for a missing account_id' do
378
+ expect {
379
+ resp = @recordings_api_instance.update_call_recording_state(nil, '', {})
380
+ }.to raise_error(ArgumentError)
381
+ end
382
+
383
+ it 'causes an ArgumentError for a missing call_id' do
384
+ expect {
385
+ @recordings_api_instance.update_call_recording_state(BW_ACCOUNT_ID, nil, {})
386
+ }.to raise_error(ArgumentError)
387
+ end
388
+
389
+ it 'causes an ArgumentError for a missing update_call_recording' do
390
+ expect {
391
+ @recordings_api_instance.update_call_recording_state(BW_ACCOUNT_ID, '', nil)
392
+ }.to raise_error(ArgumentError)
393
+ end
394
+ end
395
+ end
@@ -0,0 +1,45 @@
1
+ # Unit tests for Bandwidth::StatisticsApi
2
+ describe 'StatisticsApi' do
3
+ # statistics info
4
+ let(:current_call_queue_size) { 0 }
5
+ let(:max_call_queue_size) { 7500 }
6
+
7
+ # stubs
8
+ let(:get_statistics_headers_stub) { { 'content-type' => 'application/json' } }
9
+ let(:get_statistics_body_stub) { "{\"currentCallQueueSize\":#{current_call_queue_size},\"maxCallQueueSize\":#{max_call_queue_size}}" }
10
+
11
+ before(:all) do
12
+ Bandwidth.configure do |config|
13
+ config.debugging = true
14
+ end
15
+ @statistics_api_instance = Bandwidth::StatisticsApi.new
16
+ end
17
+
18
+ describe 'test an instance of StatisticsApi' do
19
+ it 'should create an instance of StatisticsApi' do
20
+ expect(@statistics_api_instance).to be_instance_of(Bandwidth::StatisticsApi)
21
+ end
22
+ end
23
+
24
+ # Get Account Statistics
25
+ describe 'get_statistics' do
26
+ it 'gets account statistics' do
27
+ stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/statistics").
28
+ to_return(status: 200, headers: get_statistics_headers_stub, body: get_statistics_body_stub)
29
+
30
+ data, status_code, headers = @statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID)
31
+
32
+ expect(status_code).to eq(200)
33
+ expect(headers).to eq(get_statistics_headers_stub)
34
+ expect(data).to be_instance_of(Bandwidth::AccountStatistics)
35
+ expect(data.current_call_queue_size).to eq(current_call_queue_size)
36
+ expect(data.max_call_queue_size).to eq(max_call_queue_size)
37
+ end
38
+
39
+ it 'causes an ArgumentError for a missing account_id' do
40
+ expect {
41
+ resp = @statistics_api_instance.get_statistics(nil)
42
+ }.to raise_error(ArgumentError)
43
+ end
44
+ end
45
+ end