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
@@ -1,29 +1,45 @@
1
- require 'spec_helper'
2
- require 'json'
3
1
  require_relative '../call_utils'
4
2
 
5
3
  # Integration Tests for Bandwidth::CallsApi
6
4
  describe 'CallsApi Integration Tests' do
5
+ # call info
6
+ let(:answer_method) { Bandwidth::CallbackMethodEnum::POST }
7
+ let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' }
8
+ let(:answer_fallback_method) { Bandwidth::CallbackMethodEnum::POST }
9
+ let(:disconnect_method) { Bandwidth::CallbackMethodEnum::GET }
10
+ let(:disconnect_url) { BASE_CALLBACK_URL + '/callbacks/disconnect' }
11
+ let(:priority) { 5 }
12
+ let(:direction) { Bandwidth::CallDirectionEnum::OUTBOUND }
13
+ let(:call_timeout) { 30.0 }
14
+ let(:callback_timeout) { 15.0 }
15
+
7
16
  before(:all) do
17
+ WebMock.allow_net_connect!
8
18
  Bandwidth.configure do |config|
9
19
  config.username = BW_USERNAME
10
20
  config.password = BW_PASSWORD
11
21
  end
12
- @api_instance_calls = Bandwidth::CallsApi.new
13
- $call_info_id = ""
22
+ @calls_api_instance = Bandwidth::CallsApi.new
23
+
24
+ # call id
25
+ $call_info_id = ''
26
+ end
27
+
28
+ after(:all) do
29
+ WebMock.disable_net_connect!
14
30
  end
15
31
 
16
32
  # Create Call
17
33
  describe 'create_call' do
18
34
  it 'creates a call with amd' do
19
35
  amd_config = Bandwidth::MachineDetectionConfiguration.new(
20
- mode: "async",
36
+ mode: 'async',
21
37
  detection_timeout: 5.0,
22
38
  silence_timeout: 5.0,
23
39
  speech_threshold: 5.0,
24
40
  speech_end_threshold: 5.0,
25
41
  delay_result: true,
26
- callback_url: BASE_CALLBACK_URL + "/machineDetection",
42
+ callback_url: BASE_CALLBACK_URL + '/machineDetection',
27
43
  callback_method: Bandwidth::CallbackMethodEnum::POST
28
44
  )
29
45
 
@@ -31,35 +47,34 @@ describe 'CallsApi Integration Tests' do
31
47
  application_id: BW_VOICE_APPLICATION_ID,
32
48
  to: USER_NUMBER,
33
49
  from: BW_NUMBER,
34
- answer_url: BASE_CALLBACK_URL + "/callbacks/answer",
35
- answer_method: "POST",
36
- disconnect_url: BASE_CALLBACK_URL + "/callbacks/disconnect",
37
- disconnect_method: "GET",
50
+ answer_url: answer_url,
51
+ answer_method: answer_method,
52
+ disconnect_url: disconnect_url,
53
+ disconnect_method: disconnect_method,
38
54
  machine_detection: amd_config,
39
- call_timeout: 30.0,
40
- callback_timeout: 15.0
55
+ call_timeout: call_timeout,
56
+ callback_timeout: callback_timeout
41
57
  )
42
58
 
43
- response = @api_instance_calls.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
44
- sleep(SLEEP_TIME_S)
45
-
46
- expect(response[CODE]).to eq(201)
47
- expect(response[DATA]).to be_instance_of(Bandwidth::CreateCallResponse)
48
- expect(response[DATA].call_id.length).to eq(47)
49
- expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID)
50
- expect(response[DATA].application_id).to eq(BW_VOICE_APPLICATION_ID)
51
- expect(response[DATA].to).to eq(USER_NUMBER)
52
- expect(response[DATA].from).to eq(BW_NUMBER)
53
- expect(response[DATA].call_id)
54
- expect(response[DATA].call_timeout).to eq(30.0)
55
- expect(response[DATA].callback_timeout).to eq(15.0)
56
- expect(response[DATA].enqueued_time).to be_instance_of(Time)
57
- expect(response[DATA].answer_method).to eq(Bandwidth::CallbackMethodEnum::POST)
58
- expect(response[DATA].disconnect_method).to eq("GET")
59
- expect(response[DATA].answer_url).to eq(BASE_CALLBACK_URL + "/callbacks/answer")
60
- expect(response[DATA].disconnect_url).to eq(BASE_CALLBACK_URL + "/callbacks/disconnect")
61
-
62
- $call_info_id = response[DATA].call_id
59
+ data, status_code, headers = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
60
+
61
+ expect(status_code).to eq(201)
62
+ expect(data).to be_instance_of(Bandwidth::CreateCallResponse)
63
+ expect(data.call_id.length).to eq(47)
64
+ expect(data.account_id).to eq(BW_ACCOUNT_ID)
65
+ expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
66
+ expect(data.to).to eq(USER_NUMBER)
67
+ expect(data.from).to eq(BW_NUMBER)
68
+ expect(data.call_timeout).to eq(call_timeout)
69
+ expect(data.callback_timeout).to eq(callback_timeout)
70
+ expect(data.enqueued_time).to be_instance_of(Time)
71
+ expect(data.answer_method).to eq(answer_method)
72
+ expect(data.answer_fallback_method).to eq(answer_fallback_method)
73
+ expect(data.disconnect_method).to eq(disconnect_method)
74
+ expect(data.answer_url).to eq(answer_url)
75
+ expect(data.disconnect_url).to eq(disconnect_url)
76
+
77
+ $call_info_id = data.call_id
63
78
  $active_calls.append($call_info_id)
64
79
  end
65
80
  end
@@ -67,17 +82,24 @@ describe 'CallsApi Integration Tests' do
67
82
  # Get Call State Information
68
83
  describe 'get_call_state' do
69
84
  it 'gets the call state' do
70
- response = @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
71
-
72
- expect(response[CODE]).to eq(200)
73
- expect(response[DATA]).to be_instance_of(Bandwidth::CallState)
74
- expect(response[DATA].call_id).to eq($call_info_id)
75
- expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID)
76
- expect(response[DATA].application_id).to eq(BW_VOICE_APPLICATION_ID)
77
- expect(response[DATA].start_time).to be_instance_of(Time)
78
- expect(response[DATA].last_update).to be_instance_of(Time)
79
- expect(response[DATA].state).to be_instance_of(String)
80
- expect(response[DATA].direction).to eq(Bandwidth::CallDirectionEnum::OUTBOUND)
85
+ begin
86
+ sleep(SLEEP_TIME_S)
87
+ data, status_code, headers = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
88
+
89
+ expect(status_code).to eq(200)
90
+ expect(data).to be_instance_of(Bandwidth::CallState)
91
+ expect(data.call_id).to eq($call_info_id)
92
+ expect(data.account_id).to eq(BW_ACCOUNT_ID)
93
+ expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
94
+ expect(data.start_time).to be_instance_of(Time)
95
+ expect(data.last_update).to be_instance_of(Time)
96
+ expect(data.state).to be_instance_of(String)
97
+ expect(data.direction).to eq(direction)
98
+ rescue Bandwidth::ApiError => e
99
+ if e.code != 404
100
+ raise e
101
+ end
102
+ end
81
103
  end
82
104
  end
83
105
 
@@ -86,34 +108,34 @@ describe 'CallsApi Integration Tests' do
86
108
  it 'creates and updates a call' do
87
109
  update_call_body = Bandwidth::UpdateCall.new(
88
110
  state: Bandwidth::CallStateEnum::ACTIVE,
89
- redirect_url: MANTECA_BASE_URL + "/bxml/pause"
111
+ redirect_url: MANTECA_BASE_URL + '/bxml/pause'
90
112
  )
91
113
 
92
- update_call_id = create_manteca_call(@api_instance_calls)
114
+ update_call_id = create_manteca_call(@calls_api_instance)
93
115
  sleep(SLEEP_TIME_S)
94
116
 
95
- update_response = @api_instance_calls.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, update_call_body)
96
- expect(update_response[CODE]).to eq(200)
117
+ update_data, update_status_code, update_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, update_call_body)
118
+ expect(update_status_code).to eq(200)
97
119
  sleep(SLEEP_TIME_S)
98
120
 
99
- complete_response = @api_instance_calls.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
100
- expect(complete_response[CODE]).to eq(200)
121
+ complete_data, complete_status_code, complete_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
122
+ expect(complete_status_code).to eq(200)
101
123
  end
102
124
  end
103
125
 
104
126
  # Update Call BXML
105
127
  describe 'update_call_bxml' do
106
128
  it 'updates a call using bxml' do
107
- update_call_id = create_manteca_call(@api_instance_calls)
129
+ update_call_id = create_manteca_call(@calls_api_instance)
108
130
  sleep(SLEEP_TIME_S)
109
131
 
110
- 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>";
111
- update_response = @api_instance_calls.update_call_bxml_with_http_info(BW_ACCOUNT_ID, update_call_id, update_bxml)
112
- expect(update_response[CODE]).to eq(204)
132
+ 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>'
133
+ update_data, update_status_code, update_headers = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, update_call_id, update_bxml)
134
+ expect(update_status_code).to eq(204)
113
135
  sleep(SLEEP_TIME_S)
114
136
 
115
- complete_response = @api_instance_calls.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
116
- expect(complete_response[CODE]).to eq(200)
137
+ complete_data, complete_status_code, complete_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
138
+ expect(complete_status_code).to eq(200)
117
139
  end
118
140
  end
119
141
 
@@ -122,16 +144,16 @@ describe 'CallsApi Integration Tests' do
122
144
  it 'causes a 400 error' do
123
145
  call_body_bad = Bandwidth::CreateCall.new(
124
146
  application_id: BW_VOICE_APPLICATION_ID,
125
- to: "+1invalid",
147
+ to: '+1invalid',
126
148
  from: BW_NUMBER,
127
- answer_url: BASE_CALLBACK_URL + "/callbacks/answer",
128
- answer_method: "POST",
129
- disconnect_url: BASE_CALLBACK_URL + "/callbacks/disconnect",
130
- disconnect_method: "GET"
149
+ answer_url: answer_url,
150
+ answer_method: answer_method,
151
+ disconnect_url: disconnect_url,
152
+ disconnect_method: disconnect_method
131
153
  )
132
154
 
133
155
  expect {
134
- @api_instance_calls.create_call_with_http_info(BW_ACCOUNT_ID, call_body_bad)
156
+ @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body_bad)
135
157
  }.to raise_error { |e|
136
158
  expect(e).to be_instance_of(Bandwidth::ApiError)
137
159
  expect(e.code).to eq(400)
@@ -139,10 +161,8 @@ describe 'CallsApi Integration Tests' do
139
161
  end
140
162
 
141
163
  it 'causes a 404 error' do
142
- dne_id = "does-not-exist"
143
-
144
164
  expect {
145
- @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, dne_id)
165
+ @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, 'does-not-exist')
146
166
  }.to raise_error { |e|
147
167
  expect(e).to be_instance_of(Bandwidth::ApiError)
148
168
  expect(e.code).to eq(404)
@@ -151,12 +171,12 @@ describe 'CallsApi Integration Tests' do
151
171
 
152
172
  it 'causes a 401 error' do
153
173
  Bandwidth.configure do |config|
154
- config.username = 'bad_username'
155
- config.password = 'bad_password'
174
+ config.username = UNAUTHORIZED_USERNAME
175
+ config.password = UNAUTHORIZED_PASSWORD
156
176
  end
157
177
 
158
178
  expect {
159
- @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
179
+ @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
160
180
  }.to raise_error { |e|
161
181
  expect(e).to be_instance_of(Bandwidth::ApiError)
162
182
  expect(e.code).to eq(401)
@@ -170,12 +190,11 @@ describe 'CallsApi Integration Tests' do
170
190
  end
171
191
 
172
192
  expect {
173
- @api_instance_calls.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
193
+ @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
174
194
  }.to raise_error { |e|
175
195
  expect(e).to be_instance_of(Bandwidth::ApiError)
176
196
  expect(e.code).to eq(403)
177
197
  }
178
198
  end
179
199
  end
180
-
181
200
  end
@@ -1,21 +1,26 @@
1
- require 'spec_helper'
2
- require 'json'
3
1
  require_relative '../call_utils'
4
2
 
5
3
  # Integration Tests for Bandwidth::ConferencesApi
6
4
  describe 'ConferencesApi Integration Tests' do
7
5
  before(:all) do
6
+ WebMock.allow_net_connect!
8
7
  Bandwidth.configure do |config|
9
8
  config.username = BW_USERNAME
10
9
  config.password = BW_PASSWORD
11
10
  config.return_binary_data = true
12
11
  end
13
- @api_instance_conferences = Bandwidth::ConferencesApi.new
14
- @api_instance_calls = Bandwidth::CallsApi.new
12
+ @conferences_api_instance = Bandwidth::ConferencesApi.new
13
+ @calls_api_instance = Bandwidth::CallsApi.new
14
+
15
+ # conference info
15
16
  $manteca_test_id = setup_manteca('conference')
16
- $manteca_call_id = create_manteca_call($manteca_test_id, "/bxml/joinConferencePause", @api_instance_calls)
17
- $conference_id = ""
18
- $recording_id = ""
17
+ $manteca_call_id = create_manteca_call($manteca_test_id, '/bxml/joinConferencePause', @calls_api_instance)
18
+ $conference_id = ''
19
+ $recording_id = ''
20
+ end
21
+
22
+ after(:all) do
23
+ WebMock.disable_net_connect!
19
24
  end
20
25
 
21
26
  # Get Conferences
@@ -26,37 +31,38 @@ describe 'ConferencesApi Integration Tests' do
26
31
  }
27
32
 
28
33
  sleep(SLEEP_TIME_S)
29
- response = @api_instance_conferences.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts)
34
+ data, status_code, headers = @conferences_api_instance.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts)
30
35
 
31
- expect(response[CODE]).to eq(200)
32
- expect(response[DATA][0]).to be_instance_of(Bandwidth::Conference)
33
- expect(response[DATA][0].id).to be_instance_of(String)
34
- $conference_id = response[DATA][0].id
36
+ expect(status_code).to eq(200)
37
+ expect(data).to be_instance_of(Array)
38
+ expect(data[0]).to be_instance_of(Bandwidth::Conference)
39
+ expect(data[0].id).to be_instance_of(String)
40
+ $conference_id = data[0].id
35
41
  end
36
42
  end
37
43
 
38
44
  # Get Conference Information
39
45
  describe 'get_conference' do
40
46
  it 'get a conference by id' do
41
- response = @api_instance_conferences.get_conference_with_http_info(BW_ACCOUNT_ID, $conference_id)
47
+ data, status_code, headers = @conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, $conference_id)
42
48
 
43
- expect(response[CODE]).to eq(200)
44
- expect(response[DATA]).to be_instance_of(Bandwidth::Conference)
45
- expect(response[DATA].id).to eq($conference_id)
46
- expect(response[DATA].name).to eq($manteca_test_id)
47
- expect(response[DATA].tag).to eq($manteca_test_id)
49
+ expect(status_code).to eq(200)
50
+ expect(data).to be_instance_of(Bandwidth::Conference)
51
+ expect(data.id).to eq($conference_id)
52
+ expect(data.name).to eq($manteca_test_id)
53
+ expect(data.tag).to eq($manteca_test_id)
48
54
  end
49
55
  end
50
56
 
51
57
  # Get Conference Member
52
58
  describe 'get_conference_member' do
53
59
  it 'gets a conference member by call id' do
54
- response = @api_instance_conferences.get_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id)
60
+ data, status_code, headers = @conferences_api_instance.get_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id)
55
61
 
56
- expect(response[CODE]).to eq(200)
57
- expect(response[DATA]).to be_instance_of(Bandwidth::ConferenceMember)
58
- expect(response[DATA].conference_id).to eq($conference_id)
59
- expect(response[DATA].call_id).to eq($manteca_call_id)
62
+ expect(status_code).to eq(200)
63
+ expect(data).to be_instance_of(Bandwidth::ConferenceMember)
64
+ expect(data.conference_id).to eq($conference_id)
65
+ expect(data.call_id).to eq($manteca_call_id)
60
66
  end
61
67
  end
62
68
 
@@ -67,8 +73,8 @@ describe 'ConferencesApi Integration Tests' do
67
73
  mute: false
68
74
  )
69
75
 
70
- response = @api_instance_conferences.update_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id, update_conference_member)
71
- expect(response[CODE]).to eq(204)
76
+ data, status_code, headers = @conferences_api_instance.update_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id, update_conference_member)
77
+ expect(status_code).to eq(204)
72
78
  end
73
79
  end
74
80
 
@@ -77,34 +83,34 @@ describe 'ConferencesApi Integration Tests' do
77
83
  it 'updates a conference' do
78
84
  update_conference_body = Bandwidth::UpdateConference.new(
79
85
  status: Bandwidth::ConferenceStateEnum::ACTIVE,
80
- redirect_url: MANTECA_BASE_URL + "/bxml/pause",
86
+ redirect_url: MANTECA_BASE_URL + '/bxml/pause',
81
87
  redirect_method: Bandwidth::RedirectMethodEnum::POST,
82
- username: "username",
83
- password: "password",
84
- redirect_fallback_url: MANTECA_BASE_URL + "/bxml/pause",
88
+ username: 'username',
89
+ password: 'password',
90
+ redirect_fallback_url: MANTECA_BASE_URL + '/bxml/pause',
85
91
  redirect_fallback_method: Bandwidth::RedirectMethodEnum::POST,
86
- fallback_username: "username",
87
- fallback_password: "password"
92
+ fallback_username: 'username',
93
+ fallback_password: 'password'
88
94
  )
89
95
 
90
- response = @api_instance_conferences.update_conference_with_http_info(BW_ACCOUNT_ID, $conference_id, update_conference_body)
91
- expect(response[CODE]).to eq(204)
96
+ data, status_code, headers = @conferences_api_instance.update_conference_with_http_info(BW_ACCOUNT_ID, $conference_id, update_conference_body)
97
+ expect(status_code).to eq(204)
92
98
  end
93
99
  end
94
100
 
95
101
  # Update Conference BXML
96
102
  describe 'update_conference_bxml' do
97
103
  it 'updates a conference using bxml' do
98
- update_bxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Bxml><StartRecording/><SpeakSentence locale=\"en_US\" gender=\"female\" voice=\"susan\">This should be a conference recording.</SpeakSentence><StopRecording/></Bxml>"
104
+ update_bxml = '<?xml version="1.0" encoding="UTF-8"?><Bxml><StartRecording/><SpeakSentence locale="en_US" gender="female" voice="susan">This should be a conference recording.</SpeakSentence><StopRecording/></Bxml>'
99
105
 
100
- response = @api_instance_conferences.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, $conference_id, update_bxml)
101
- expect(response[CODE]).to eq(204)
106
+ data, status_code, headers = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, $conference_id, update_bxml)
107
+ expect(status_code).to eq(204)
102
108
 
103
109
  retries = 0
104
110
  recording_complete = false
105
111
  begin
106
112
  while !recording_complete && retries < MAX_RETRIES
107
- recording_complete = get_manteca_test_status($manteca_test_id)["callRecorded"]
113
+ recording_complete = get_manteca_test_status($manteca_test_id)['callRecorded']
108
114
  retries += 1
109
115
  sleep(SLEEP_TIME_S)
110
116
  end
@@ -112,52 +118,52 @@ describe 'ConferencesApi Integration Tests' do
112
118
  puts e.inspect
113
119
  end
114
120
 
115
- expect(recording_complete).to be_instance_of(TrueClass)
121
+ expect(recording_complete).to be true
116
122
  end
117
123
  end
118
124
 
119
125
  # Get Conference Recordings
120
126
  describe 'list_conference_recordings' do
121
127
  it 'lists recordings for a conference' do
122
- response = @api_instance_conferences.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, $conference_id)
123
-
124
- expect(response[CODE]).to eq(200)
125
- expect(response[DATA][0]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
126
- expect(response[DATA][0].conference_id).to eq($conference_id)
127
- expect(response[DATA][0].account_id).to eq(BW_ACCOUNT_ID)
128
- expect(response[DATA][0].name).to eq($manteca_test_id)
129
- expect(response[DATA][0].status).to eq('complete').or eq('partial')
130
- expect(response[DATA][0].recording_id).to be_instance_of(String)
131
- expect(response[DATA][0].file_format).to eq(Bandwidth::FileFormatEnum::WAV)
132
-
133
- $recording_id = response[DATA][0].recording_id
128
+ data, status_code, headers = @conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, $conference_id)
129
+
130
+ expect(status_code).to eq(200)
131
+ expect(data).to be_instance_of(Array)
132
+ expect(data[0]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
133
+ expect(data[0].conference_id).to eq($conference_id)
134
+ expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
135
+ expect(data[0].name).to eq($manteca_test_id)
136
+ expect(data[0].status).to eq('complete').or eq('partial')
137
+ expect(data[0].recording_id).to be_instance_of(String)
138
+ expect(data[0].file_format).to eq(Bandwidth::FileFormatEnum::WAV)
139
+
140
+ $recording_id = data[0].recording_id
134
141
  end
135
142
  end
136
143
 
137
- # Get Conference Recording Information
138
- describe 'get_conference_recording' do
139
- it 'gets a conference recording by id' do
140
- response = @api_instance_conferences.get_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
141
-
142
- expect(response[CODE]).to eq(200)
143
- expect(response[DATA]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
144
- expect(response[DATA].conference_id).to eq($conference_id)
145
- expect(response[DATA].account_id).to eq(BW_ACCOUNT_ID)
146
- expect(response[DATA].name).to eq($manteca_test_id)
147
- expect(response[DATA].status).to eq('complete').or eq('partial')
148
- expect(response[DATA].recording_id).to be_instance_of(String)
149
- expect(response[DATA].file_format).to eq(Bandwidth::FileFormatEnum::WAV)
150
- end
144
+ # Get Conference Recording Information
145
+ describe 'get_conference_recording' do
146
+ it 'gets a conference recording by id' do
147
+ data, status_code, headers = @conferences_api_instance.get_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
148
+
149
+ expect(status_code).to eq(200)
150
+ expect(data).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
151
+ expect(data.conference_id).to eq($conference_id)
152
+ expect(data.account_id).to eq(BW_ACCOUNT_ID)
153
+ expect(data.name).to eq($manteca_test_id)
154
+ expect(data.status).to eq('complete').or eq('partial')
155
+ expect(data.recording_id).to be_instance_of(String)
156
+ expect(data.file_format).to eq(Bandwidth::FileFormatEnum::WAV)
151
157
  end
158
+ end
152
159
 
153
160
  # Download Conference Recording
154
161
  describe 'download_conference_recording test' do
155
162
  it 'should work' do
156
- response = @api_instance_conferences.download_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
163
+ data, status_code, headers = @conferences_api_instance.download_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
157
164
 
158
- expect(response[CODE]).to eq(200)
159
- expect(response[DATA]).to be_instance_of(String)
165
+ expect(status_code).to eq(200)
166
+ expect(data).to be_instance_of(String)
160
167
  end
161
168
  end
162
-
163
169
  end
@@ -1,73 +1,80 @@
1
- require 'spec_helper'
2
- require 'json'
3
-
4
1
  # Integration Tests for Bandwidth::MediaApi
5
2
  describe 'MediaApi Integration Tests' do
3
+ # media info
4
+ let(:binary_media_data) { '123456' }
5
+ let(:media_file_data) { File.open('spec/fixtures/ruby_cat.jpeg').read }
6
+ let(:media_file_md5) { Digest::MD5.hexdigest(media_file_data) }
7
+
6
8
  before(:all) do
9
+ WebMock.allow_net_connect!
7
10
  Bandwidth.configure do |config|
8
11
  config.username = BW_USERNAME
9
12
  config.password = BW_PASSWORD
10
13
  config.return_binary_data = true
11
14
  end
12
15
  @api_instance_media = Bandwidth::MediaApi.new
16
+
17
+ # media names
13
18
  @binary_media_name = 'ruby_binary_media' + SecureRandom.uuid
14
- @binary_media_data = '123456'
15
19
  @media_file_name = 'ruby_media_file' + SecureRandom.uuid
16
- @media_file_data = File.open("spec/fixtures/ruby_cat.jpeg").read
17
- @media_file_md5 = Digest::MD5.hexdigest(@media_file_data)
20
+ end
21
+
22
+ after(:all) do
23
+ WebMock.disable_net_connect!
18
24
  end
19
25
 
20
26
  # Upload Media
21
27
  describe 'upload_media' do
22
28
  it 'uploads binary media' do
23
- response = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, @binary_media_data)
24
- expect(response[CODE]).to eq(204)
29
+ data, status_code, headers = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, binary_media_data)
30
+ expect(status_code).to eq(204)
25
31
  end
26
32
 
27
33
  it 'uploads media file' do
28
- response = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @media_file_name, @media_file_data)
29
- expect(response[CODE]).to eq(204)
34
+ data, status_code, headers = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @media_file_name, media_file_data)
35
+ expect(status_code).to eq(204)
30
36
  end
31
37
  end
32
38
 
33
- # List Media
34
- describe 'list_media' do
35
- it 'lists media' do
36
- response = @api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID)
37
- expect(response[CODE]).to eq(200)
38
- expect(response[DATA][0]).to be_instance_of(Bandwidth::Media)
39
- expect(response[DATA][0].content).to be_instance_of(String)
40
- expect(response[DATA][0].content_length).to be > 0
41
- end
39
+ # List Media
40
+ describe 'list_media' do
41
+ it 'lists media' do
42
+ data, status_code, headers = @api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID)
43
+ expect(status_code).to eq(200)
44
+ expect(data).to be_instance_of(Array)
45
+ expect(data[0]).to be_instance_of(Bandwidth::Media)
46
+ expect(data[0].content).to be_instance_of(String)
47
+ expect(data[0].content_length).to be > 0
42
48
  end
49
+ end
43
50
 
44
51
  # Get Media
45
52
  describe 'get_media' do
46
53
  it 'gets uploaded binary media' do
47
- response = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, debug_return_type: 'String')
48
- expect(response[CODE]).to eq(200)
49
- expect(response[DATA]).to eq(@binary_media_data)
54
+ data, status_code, headers = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name)
55
+ expect(status_code).to eq(200)
56
+ expect(data).to eq(binary_media_data)
50
57
  end
51
58
 
52
59
  it 'gets uploaded media file' do
53
- response = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
54
- response_md5 = Digest::MD5.hexdigest(response[DATA])
60
+ data, status_code, headers = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
61
+ response_md5 = Digest::MD5.hexdigest(data)
55
62
 
56
- expect(response[CODE]).to eq(200)
57
- expect(response_md5).to eq(@media_file_md5)
63
+ expect(status_code).to eq(200)
64
+ expect(response_md5).to eq(media_file_md5)
58
65
  end
59
66
  end
60
67
 
61
68
  # Delete Media
62
69
  describe 'delete_media' do
63
70
  it 'deletes the binary media' do
64
- response = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name)
65
- expect(response[CODE]).to eq(204)
71
+ data, status_code, headers = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name)
72
+ expect(status_code).to eq(204)
66
73
  end
67
74
 
68
75
  it 'deletes the media file' do
69
- response = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
70
- expect(response[CODE]).to eq(204)
76
+ data, status_code, headers = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
77
+ expect(status_code).to eq(204)
71
78
  end
72
79
  end
73
80
 
@@ -75,12 +82,11 @@ describe 'MediaApi Integration Tests' do
75
82
  describe 'http error' do
76
83
  it 'causes a 404 error' do
77
84
  expect {
78
- response = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, "does_not_exist")
85
+ @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, 'does_not_exist')
79
86
  }.to raise_error { |e|
80
87
  expect(e).to be_instance_of(Bandwidth::ApiError)
81
88
  expect(e.code).to eq(404)
82
89
  }
83
90
  end
84
91
  end
85
-
86
92
  end