bandwidth-sdk 10.0.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +11 -0
  3. data/Gemfile.lock +102 -0
  4. data/README.md +204 -139
  5. data/Rakefile +30 -0
  6. data/bandwidth-sdk.gemspec +40 -0
  7. data/bandwidth.yml +5626 -0
  8. data/coverage/.last_run.json +5 -0
  9. data/coverage/.resultset.json +9761 -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 +108271 -0
  41. data/custom_templates/Gemfile.mustache +11 -0
  42. data/custom_templates/README.mustache +173 -0
  43. data/custom_templates/gem.mustache +99 -0
  44. data/custom_templates/gemspec.mustache +37 -0
  45. data/docs/AccountStatistics.md +20 -0
  46. data/docs/AnswerCallback.md +44 -0
  47. data/docs/BridgeCompleteCallback.md +48 -0
  48. data/docs/BridgeTargetCompleteCallback.md +42 -0
  49. data/docs/CallDirectionEnum.md +15 -0
  50. data/docs/CallRecordingMetadata.md +52 -0
  51. data/docs/CallState.md +52 -0
  52. data/docs/CallStateEnum.md +15 -0
  53. data/docs/CallbackMethodEnum.md +15 -0
  54. data/docs/CallsApi.md +304 -0
  55. data/docs/CodeRequest.md +28 -0
  56. data/docs/Conference.md +32 -0
  57. data/docs/ConferenceCompletedCallback.md +26 -0
  58. data/docs/ConferenceCreatedCallback.md +26 -0
  59. data/docs/ConferenceMember.md +28 -0
  60. data/docs/ConferenceMemberExitCallback.md +32 -0
  61. data/docs/ConferenceMemberJoinCallback.md +32 -0
  62. data/docs/ConferenceRecordingAvailableCallback.md +44 -0
  63. data/docs/ConferenceRecordingMetadata.md +38 -0
  64. data/docs/ConferenceRedirectCallback.md +26 -0
  65. data/docs/ConferenceStateEnum.md +15 -0
  66. data/docs/ConferencesApi.md +688 -0
  67. data/docs/CreateCall.md +56 -0
  68. data/docs/CreateCallResponse.md +58 -0
  69. data/docs/CreateLookupResponse.md +20 -0
  70. data/docs/CreateMessageRequestError.md +22 -0
  71. data/docs/CreateParticipantRequest.md +24 -0
  72. data/docs/CreateParticipantResponse.md +20 -0
  73. data/docs/DeferredResult.md +20 -0
  74. data/docs/DeviceApiVersionEnum.md +15 -0
  75. data/docs/DisconenctCallback.md +50 -0
  76. data/docs/DisconnectCallback.md +50 -0
  77. data/docs/Diversion.md +30 -0
  78. data/docs/DtmfCallback.md +50 -0
  79. data/docs/FieldError.md +20 -0
  80. data/docs/FileFormatEnum.md +15 -0
  81. data/docs/ForbiddenRequest.md +18 -0
  82. data/docs/GatherCallback.md +52 -0
  83. data/docs/InboundMessageCallback.md +26 -0
  84. data/docs/InboundMessageCallbackMessage.md +40 -0
  85. data/docs/InitiateCallback.md +40 -0
  86. data/docs/ListMessageDirectionEnum.md +15 -0
  87. data/docs/ListMessageItem.md +50 -0
  88. data/docs/LookupRequest.md +18 -0
  89. data/docs/LookupResult.md +34 -0
  90. data/docs/LookupStatus.md +24 -0
  91. data/docs/LookupStatusEnum.md +15 -0
  92. data/docs/MFAApi.md +226 -0
  93. data/docs/MachineDetectionCompleteCallback.md +44 -0
  94. data/docs/MachineDetectionConfiguration.md +46 -0
  95. data/docs/MachineDetectionModeEnum.md +15 -0
  96. data/docs/MachineDetectionResult.md +20 -0
  97. data/docs/Media.md +22 -0
  98. data/docs/MediaApi.md +307 -0
  99. data/docs/Message.md +42 -0
  100. data/docs/MessageDeliveredCallback.md +26 -0
  101. data/docs/MessageDeliveredCallbackMessage.md +40 -0
  102. data/docs/MessageDirectionEnum.md +15 -0
  103. data/docs/MessageFailedCallback.md +28 -0
  104. data/docs/MessageFailedCallbackMessage.md +40 -0
  105. data/docs/MessageRequest.md +32 -0
  106. data/docs/MessageSendingCallback.md +26 -0
  107. data/docs/MessageSendingCallbackMessage.md +40 -0
  108. data/docs/MessageStatusEnum.md +15 -0
  109. data/docs/MessageTypeEnum.md +15 -0
  110. data/docs/MessagesApi.md +183 -0
  111. data/docs/MessagesList.md +22 -0
  112. data/docs/MessagingCodeResponse.md +18 -0
  113. data/docs/MessagingRequestError.md +20 -0
  114. data/docs/MfaForbiddenRequestError.md +18 -0
  115. data/docs/MfaRequestError.md +20 -0
  116. data/docs/MfaUnauthorizedRequestError.md +18 -0
  117. data/docs/PageInfo.md +24 -0
  118. data/docs/Participant.md +30 -0
  119. data/docs/ParticipantSubscription.md +20 -0
  120. data/docs/ParticipantsApi.md +227 -0
  121. data/docs/PhoneNumberLookupApi.md +153 -0
  122. data/docs/PriorityEnum.md +15 -0
  123. data/docs/PublishPermissionsEnum.md +15 -0
  124. data/docs/RecordingAvailableCallback.md +60 -0
  125. data/docs/RecordingCompleteCallback.md +60 -0
  126. data/docs/RecordingStateEnum.md +15 -0
  127. data/docs/RecordingsApi.md +758 -0
  128. data/docs/RedirectCallback.md +48 -0
  129. data/docs/RedirectMethodEnum.md +15 -0
  130. data/docs/RequestError.md +20 -0
  131. data/docs/Session.md +20 -0
  132. data/docs/SessionsApi.md +605 -0
  133. data/docs/StatisticsApi.md +78 -0
  134. data/docs/StirShaken.md +22 -0
  135. data/docs/Subscriptions.md +20 -0
  136. data/docs/Tag.md +20 -0
  137. data/docs/TnLookupRequestError.md +18 -0
  138. data/docs/TranscribeRecording.md +30 -0
  139. data/docs/Transcription.md +20 -0
  140. data/docs/TranscriptionAvailableCallback.md +58 -0
  141. data/docs/TranscriptionList.md +18 -0
  142. data/docs/TranscriptionMetadata.md +24 -0
  143. data/docs/TransferAnswerCallback.md +46 -0
  144. data/docs/TransferCompleteCallback.md +52 -0
  145. data/docs/TransferDisconnectCallback.md +56 -0
  146. data/docs/UnauthorizedRequest.md +18 -0
  147. data/docs/UpdateCall.md +36 -0
  148. data/docs/UpdateCallRecording.md +18 -0
  149. data/docs/UpdateConference.md +34 -0
  150. data/docs/UpdateConferenceMember.md +22 -0
  151. data/docs/VerifyCodeRequest.md +24 -0
  152. data/docs/VerifyCodeResponse.md +18 -0
  153. data/docs/VoiceApiError.md +22 -0
  154. data/docs/VoiceCodeResponse.md +18 -0
  155. data/git_push.sh +57 -0
  156. data/lib/bandwidth-sdk/api/calls_api.rb +325 -0
  157. data/lib/bandwidth-sdk/api/conferences_api.rb +717 -0
  158. data/lib/bandwidth-sdk/api/media_api.rb +312 -0
  159. data/lib/bandwidth-sdk/api/messages_api.rb +204 -0
  160. data/lib/bandwidth-sdk/api/mfa_api.rb +244 -0
  161. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +165 -0
  162. data/lib/bandwidth-sdk/api/recordings_api.rb +782 -0
  163. data/lib/bandwidth-sdk/api/statistics_api.rb +85 -0
  164. data/lib/bandwidth-sdk/api_client.rb +428 -0
  165. data/lib/bandwidth-sdk/api_error.rb +58 -0
  166. data/lib/bandwidth-sdk/configuration.rb +591 -0
  167. data/lib/bandwidth-sdk/models/account_statistics.rb +223 -0
  168. data/lib/bandwidth-sdk/models/answer_callback.rb +368 -0
  169. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +390 -0
  170. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +358 -0
  171. data/lib/bandwidth-sdk/models/bxml/bxml.rb +11 -0
  172. data/lib/bandwidth-sdk/models/bxml/nestable_verb.rb +46 -0
  173. data/lib/bandwidth-sdk/models/bxml/response.rb +11 -0
  174. data/lib/bandwidth-sdk/models/bxml/root.rb +47 -0
  175. data/lib/bandwidth-sdk/models/bxml/verb.rb +50 -0
  176. data/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb +28 -0
  177. data/lib/bandwidth-sdk/models/bxml/verbs/conference.rb +28 -0
  178. data/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb +16 -0
  179. data/lib/bandwidth-sdk/models/bxml/verbs/forward.rb +20 -0
  180. data/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +42 -0
  181. data/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb +10 -0
  182. data/lib/bandwidth-sdk/models/bxml/verbs/pause.rb +15 -0
  183. data/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb +10 -0
  184. data/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb +26 -0
  185. data/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb +17 -0
  186. data/lib/bandwidth-sdk/models/bxml/verbs/record.rb +32 -0
  187. data/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb +23 -0
  188. data/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb +10 -0
  189. data/lib/bandwidth-sdk/models/bxml/verbs/ring.rb +16 -0
  190. data/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb +17 -0
  191. data/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb +27 -0
  192. data/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb +25 -0
  193. data/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb +19 -0
  194. data/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb +24 -0
  195. data/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +28 -0
  196. data/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +29 -0
  197. data/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb +10 -0
  198. data/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb +10 -0
  199. data/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb +15 -0
  200. data/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb +15 -0
  201. data/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb +16 -0
  202. data/lib/bandwidth-sdk/models/bxml/verbs/tag.rb +11 -0
  203. data/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +34 -0
  204. data/lib/bandwidth-sdk/models/call_direction_enum.rb +40 -0
  205. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +404 -0
  206. data/lib/bandwidth-sdk/models/call_state.rb +416 -0
  207. data/lib/bandwidth-sdk/models/call_state_enum.rb +40 -0
  208. data/lib/bandwidth-sdk/models/callback_method_enum.rb +40 -0
  209. data/lib/bandwidth-sdk/models/code_request.rb +434 -0
  210. data/lib/bandwidth-sdk/models/conference.rb +313 -0
  211. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +255 -0
  212. data/lib/bandwidth-sdk/models/conference_created_callback.rb +255 -0
  213. data/lib/bandwidth-sdk/models/conference_member.rb +266 -0
  214. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +285 -0
  215. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +285 -0
  216. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +367 -0
  217. data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +335 -0
  218. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +255 -0
  219. data/lib/bandwidth-sdk/models/conference_state_enum.rb +40 -0
  220. data/lib/bandwidth-sdk/models/create_call.rb +687 -0
  221. data/lib/bandwidth-sdk/models/create_call_response.rb +559 -0
  222. data/lib/bandwidth-sdk/models/create_lookup_response.rb +245 -0
  223. data/lib/bandwidth-sdk/models/create_message_request_error.rb +246 -0
  224. data/lib/bandwidth-sdk/models/deferred_result.rb +221 -0
  225. data/lib/bandwidth-sdk/models/disconenct_callback.rb +405 -0
  226. data/lib/bandwidth-sdk/models/disconnect_callback.rb +400 -0
  227. data/lib/bandwidth-sdk/models/diversion.rb +273 -0
  228. data/lib/bandwidth-sdk/models/dtmf_callback.rb +398 -0
  229. data/lib/bandwidth-sdk/models/field_error.rb +223 -0
  230. data/lib/bandwidth-sdk/models/file_format_enum.rb +40 -0
  231. data/lib/bandwidth-sdk/models/gather_callback.rb +408 -0
  232. data/lib/bandwidth-sdk/models/inbound_message_callback.rb +284 -0
  233. data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +411 -0
  234. data/lib/bandwidth-sdk/models/initiate_callback.rb +343 -0
  235. data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +40 -0
  236. data/lib/bandwidth-sdk/models/list_message_item.rb +398 -0
  237. data/lib/bandwidth-sdk/models/lookup_request.rb +222 -0
  238. data/lib/bandwidth-sdk/models/lookup_result.rb +294 -0
  239. data/lib/bandwidth-sdk/models/lookup_status.rb +269 -0
  240. data/lib/bandwidth-sdk/models/lookup_status_enum.rb +42 -0
  241. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +368 -0
  242. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +493 -0
  243. data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +40 -0
  244. data/lib/bandwidth-sdk/models/machine_detection_result.rb +224 -0
  245. data/lib/bandwidth-sdk/models/media.rb +230 -0
  246. data/lib/bandwidth-sdk/models/message.rb +377 -0
  247. data/lib/bandwidth-sdk/models/message_delivered_callback.rb +284 -0
  248. data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +418 -0
  249. data/lib/bandwidth-sdk/models/message_direction_enum.rb +40 -0
  250. data/lib/bandwidth-sdk/models/message_failed_callback.rb +300 -0
  251. data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +425 -0
  252. data/lib/bandwidth-sdk/models/message_request.rb +358 -0
  253. data/lib/bandwidth-sdk/models/message_sending_callback.rb +284 -0
  254. data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +425 -0
  255. data/lib/bandwidth-sdk/models/message_status_enum.rb +46 -0
  256. data/lib/bandwidth-sdk/models/message_type_enum.rb +40 -0
  257. data/lib/bandwidth-sdk/models/messages_list.rb +233 -0
  258. data/lib/bandwidth-sdk/models/messaging_code_response.rb +213 -0
  259. data/lib/bandwidth-sdk/models/messaging_request_error.rb +235 -0
  260. data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +213 -0
  261. data/lib/bandwidth-sdk/models/mfa_request_error.rb +223 -0
  262. data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +213 -0
  263. data/lib/bandwidth-sdk/models/page_info.rb +243 -0
  264. data/lib/bandwidth-sdk/models/priority_enum.rb +40 -0
  265. data/lib/bandwidth-sdk/models/recording_available_callback.rb +447 -0
  266. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +448 -0
  267. data/lib/bandwidth-sdk/models/recording_state_enum.rb +40 -0
  268. data/lib/bandwidth-sdk/models/redirect_callback.rb +388 -0
  269. data/lib/bandwidth-sdk/models/redirect_method_enum.rb +40 -0
  270. data/lib/bandwidth-sdk/models/stir_shaken.rb +233 -0
  271. data/lib/bandwidth-sdk/models/tag.rb +221 -0
  272. data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +213 -0
  273. data/lib/bandwidth-sdk/models/transcribe_recording.rb +360 -0
  274. data/lib/bandwidth-sdk/models/transcription.rb +223 -0
  275. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +436 -0
  276. data/lib/bandwidth-sdk/models/transcription_list.rb +214 -0
  277. data/lib/bandwidth-sdk/models/transcription_metadata.rb +244 -0
  278. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +378 -0
  279. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +410 -0
  280. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +430 -0
  281. data/lib/bandwidth-sdk/models/update_call.rb +413 -0
  282. data/lib/bandwidth-sdk/models/update_call_recording.rb +241 -0
  283. data/lib/bandwidth-sdk/models/update_conference.rb +387 -0
  284. data/lib/bandwidth-sdk/models/update_conference_member.rb +236 -0
  285. data/lib/bandwidth-sdk/models/verify_code_request.rb +341 -0
  286. data/lib/bandwidth-sdk/models/verify_code_response.rb +213 -0
  287. data/lib/bandwidth-sdk/models/voice_api_error.rb +231 -0
  288. data/lib/bandwidth-sdk/models/voice_code_response.rb +213 -0
  289. data/lib/bandwidth-sdk/version.rb +15 -0
  290. data/lib/bandwidth-sdk.rb +170 -0
  291. data/openapi-config.yml +12 -0
  292. data/openapitools.json +7 -0
  293. data/spec/api/calls_api_spec.rb +230 -0
  294. data/spec/api/conferences_api_spec.rb +393 -0
  295. data/spec/api/media_api_spec.rb +129 -0
  296. data/spec/api/messages_api_spec.rb +193 -0
  297. data/spec/api/mfa_api_spec.rb +130 -0
  298. data/spec/api/phone_number_lookup_api_spec.rb +100 -0
  299. data/spec/api/recordings_api_spec.rb +395 -0
  300. data/spec/api/statistics_api_spec.rb +45 -0
  301. data/spec/api_client_spec.rb +377 -0
  302. data/spec/api_error_spec.rb +23 -0
  303. data/spec/call_utils.rb +74 -0
  304. data/spec/configuration_spec.rb +190 -0
  305. data/spec/fixtures/ruby_cat.jpeg +0 -0
  306. data/spec/integration/calls_api_integration_spec.rb +202 -0
  307. data/spec/integration/conferences_api_integration_spec.rb +169 -0
  308. data/spec/integration/media_api_integration_spec.rb +92 -0
  309. data/spec/integration/messages_api_integration_spec.rb +138 -0
  310. data/spec/integration/mfa_api_integration_spec.rb +117 -0
  311. data/spec/integration/phone_number_lookup_api_integration_spec.rb +96 -0
  312. data/spec/integration/recordings_api_integration_spec.rb +226 -0
  313. data/spec/integration/statistics_api_integration_spec.rb +58 -0
  314. data/spec/models/bxml/bxml_spec.rb +16 -0
  315. data/spec/models/bxml/nestable_verb_spec.rb +11 -0
  316. data/spec/models/bxml/response_spec.rb +16 -0
  317. data/spec/models/bxml/verb_spec.rb +15 -0
  318. data/spec/models/bxml/verbs/bridge_spec.rb +58 -0
  319. data/spec/models/bxml/verbs/conference_spec.rb +58 -0
  320. data/spec/models/bxml/verbs/custom_param_spec.rb +36 -0
  321. data/spec/models/bxml/verbs/forward_spec.rb +44 -0
  322. data/spec/models/bxml/verbs/gather_spec.rb +86 -0
  323. data/spec/models/bxml/verbs/hangup_spec.rb +16 -0
  324. data/spec/models/bxml/verbs/pause_recording_spec.rb +16 -0
  325. data/spec/models/bxml/verbs/pause_spec.rb +34 -0
  326. data/spec/models/bxml/verbs/phone_number_spec.rb +54 -0
  327. data/spec/models/bxml/verbs/play_audio_spec.rb +36 -0
  328. data/spec/models/bxml/verbs/record_spec.rb +68 -0
  329. data/spec/models/bxml/verbs/redirect_spec.rb +50 -0
  330. data/spec/models/bxml/verbs/resume_recording_spec.rb +16 -0
  331. data/spec/models/bxml/verbs/ring_spec.rb +36 -0
  332. data/spec/models/bxml/verbs/send_dtmf_spec.rb +36 -0
  333. data/spec/models/bxml/verbs/sip_uri_spec.rb +56 -0
  334. data/spec/models/bxml/verbs/speak_sentence_spec.rb +38 -0
  335. data/spec/models/bxml/verbs/start_gather_spec.rb +42 -0
  336. data/spec/models/bxml/verbs/start_recording_spec.rb +52 -0
  337. data/spec/models/bxml/verbs/start_stream_spec.rb +72 -0
  338. data/spec/models/bxml/verbs/start_transcription_spec.rb +74 -0
  339. data/spec/models/bxml/verbs/stop_gather_spec.rb +16 -0
  340. data/spec/models/bxml/verbs/stop_recording_spec.rb +16 -0
  341. data/spec/models/bxml/verbs/stop_stream_spec.rb +34 -0
  342. data/spec/models/bxml/verbs/stop_transcription_spec.rb +34 -0
  343. data/spec/models/bxml/verbs/stream_param_spec.rb +36 -0
  344. data/spec/models/bxml/verbs/tag_spec.rb +16 -0
  345. data/spec/models/bxml/verbs/transfer_spec.rb +84 -0
  346. data/spec/models/call_state_enum_spec.rb +16 -0
  347. data/spec/models/call_state_spec.rb +168 -0
  348. data/spec/models/deferred_result_spec.rb +74 -0
  349. data/spec/models/message_spec.rb +138 -0
  350. data/spec/models/verify_code_request_spec.rb +126 -0
  351. data/spec/spec_helper.rb +171 -0
  352. metadata +430 -276
  353. data/LICENSE +0 -28
  354. data/lib/bandwidth/api_helper.rb +0 -280
  355. data/lib/bandwidth/client.rb +0 -75
  356. data/lib/bandwidth/configuration.rb +0 -209
  357. data/lib/bandwidth/exceptions/api_exception.rb +0 -20
  358. data/lib/bandwidth/http/api_response.rb +0 -38
  359. data/lib/bandwidth/http/auth/messaging_basic_auth.rb +0 -22
  360. data/lib/bandwidth/http/auth/multi_factor_auth_basic_auth.rb +0 -22
  361. data/lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb +0 -22
  362. data/lib/bandwidth/http/auth/voice_basic_auth.rb +0 -22
  363. data/lib/bandwidth/http/auth/web_rtc_basic_auth.rb +0 -22
  364. data/lib/bandwidth/http/faraday_client.rb +0 -73
  365. data/lib/bandwidth/http/http_call_back.rb +0 -24
  366. data/lib/bandwidth/http/http_client.rb +0 -104
  367. data/lib/bandwidth/http/http_method_enum.rb +0 -13
  368. data/lib/bandwidth/http/http_request.rb +0 -50
  369. data/lib/bandwidth/http/http_response.rb +0 -29
  370. data/lib/bandwidth/messaging_lib/messaging/client.rb +0 -60
  371. data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +0 -491
  372. data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +0 -47
  373. data/lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb +0 -37
  374. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb +0 -100
  375. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb +0 -164
  376. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb +0 -203
  377. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb +0 -79
  378. data/lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb +0 -60
  379. data/lib/bandwidth/messaging_lib/messaging/models/media.rb +0 -70
  380. data/lib/bandwidth/messaging_lib/messaging/models/message_request.rb +0 -111
  381. data/lib/bandwidth/messaging_lib/messaging/models/page_info.rb +0 -82
  382. data/lib/bandwidth/messaging_lib/messaging/models/priority_enum.rb +0 -19
  383. data/lib/bandwidth/messaging_lib/messaging/models/tag.rb +0 -60
  384. data/lib/bandwidth/messaging_lib/messaging.rb +0 -25
  385. data/lib/bandwidth/models/base_model.rb +0 -58
  386. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/client.rb +0 -60
  387. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/base_controller.rb +0 -47
  388. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/mfa_controller.rb +0 -214
  389. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb +0 -37
  390. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/forbidden_request_exception.rb +0 -32
  391. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/unauthorized_request_exception.rb +0 -32
  392. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb +0 -103
  393. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_messaging_response.rb +0 -50
  394. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_code_response.rb +0 -50
  395. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb +0 -94
  396. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_voice_response.rb +0 -50
  397. data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth.rb +0 -23
  398. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/client.rb +0 -60
  399. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb +0 -1553
  400. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb +0 -47
  401. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb +0 -32
  402. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb +0 -50
  403. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb +0 -61
  404. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb +0 -95
  405. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb +0 -132
  406. data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup.rb +0 -20
  407. data/lib/bandwidth/utilities/date_time_helper.rb +0 -156
  408. data/lib/bandwidth/utilities/file_wrapper.rb +0 -16
  409. data/lib/bandwidth/voice_lib/bxml/bxml.rb +0 -36
  410. data/lib/bandwidth/voice_lib/bxml/response.rb +0 -39
  411. data/lib/bandwidth/voice_lib/bxml/verbs/bridge.rb +0 -28
  412. data/lib/bandwidth/voice_lib/bxml/verbs/conference.rb +0 -32
  413. data/lib/bandwidth/voice_lib/bxml/verbs/forward.rb +0 -18
  414. data/lib/bandwidth/voice_lib/bxml/verbs/gather.rb +0 -49
  415. data/lib/bandwidth/voice_lib/bxml/verbs/hangup.rb +0 -14
  416. data/lib/bandwidth/voice_lib/bxml/verbs/pause.rb +0 -15
  417. data/lib/bandwidth/voice_lib/bxml/verbs/pause_recording.rb +0 -14
  418. data/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb +0 -24
  419. data/lib/bandwidth/voice_lib/bxml/verbs/play_audio.rb +0 -17
  420. data/lib/bandwidth/voice_lib/bxml/verbs/record.rb +0 -33
  421. data/lib/bandwidth/voice_lib/bxml/verbs/redirect.rb +0 -24
  422. data/lib/bandwidth/voice_lib/bxml/verbs/resume_recording.rb +0 -14
  423. data/lib/bandwidth/voice_lib/bxml/verbs/ring.rb +0 -16
  424. data/lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb +0 -16
  425. data/lib/bandwidth/voice_lib/bxml/verbs/sip_uri.rb +0 -25
  426. data/lib/bandwidth/voice_lib/bxml/verbs/speak_sentence.rb +0 -18
  427. data/lib/bandwidth/voice_lib/bxml/verbs/start_gather.rb +0 -20
  428. data/lib/bandwidth/voice_lib/bxml/verbs/start_recording.rb +0 -25
  429. data/lib/bandwidth/voice_lib/bxml/verbs/stop_gather.rb +0 -14
  430. data/lib/bandwidth/voice_lib/bxml/verbs/stop_recording.rb +0 -14
  431. data/lib/bandwidth/voice_lib/bxml/verbs/tag.rb +0 -13
  432. data/lib/bandwidth/voice_lib/bxml/verbs/transfer.rb +0 -48
  433. data/lib/bandwidth/voice_lib/bxml/verbs/xml_verb.rb +0 -26
  434. data/lib/bandwidth/voice_lib/voice/client.rb +0 -60
  435. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +0 -1820
  436. data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +0 -47
  437. data/lib/bandwidth/voice_lib/voice/exceptions/api_error_exception.rb +0 -42
  438. data/lib/bandwidth/voice_lib/voice/models/answer_fallback_method_enum.rb +0 -17
  439. data/lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb +0 -17
  440. data/lib/bandwidth/voice_lib/voice/models/call_callback.rb +0 -343
  441. data/lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb +0 -250
  442. data/lib/bandwidth/voice_lib/voice/models/call_state.rb +0 -301
  443. data/lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb +0 -17
  444. data/lib/bandwidth/voice_lib/voice/models/conference_callback.rb +0 -211
  445. data/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb +0 -17
  446. data/lib/bandwidth/voice_lib/voice/models/conference_member_state.rb +0 -103
  447. data/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb +0 -173
  448. data/lib/bandwidth/voice_lib/voice/models/conference_state.rb +0 -153
  449. data/lib/bandwidth/voice_lib/voice/models/create_call_request.rb +0 -236
  450. data/lib/bandwidth/voice_lib/voice/models/create_call_response.rb +0 -266
  451. data/lib/bandwidth/voice_lib/voice/models/direction_enum.rb +0 -17
  452. data/lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb +0 -17
  453. data/lib/bandwidth/voice_lib/voice/models/diversion.rb +0 -80
  454. data/lib/bandwidth/voice_lib/voice/models/fallback_method_enum.rb +0 -17
  455. data/lib/bandwidth/voice_lib/voice/models/file_format_enum.rb +0 -17
  456. data/lib/bandwidth/voice_lib/voice/models/machine_detection_configuration.rb +0 -231
  457. data/lib/bandwidth/voice_lib/voice/models/mode_enum.rb +0 -20
  458. data/lib/bandwidth/voice_lib/voice/models/modify_call_recording_request.rb +0 -48
  459. data/lib/bandwidth/voice_lib/voice/models/modify_call_request.rb +0 -156
  460. data/lib/bandwidth/voice_lib/voice/models/modify_conference_request.rb +0 -144
  461. data/lib/bandwidth/voice_lib/voice/models/redirect_fallback_method_enum.rb +0 -17
  462. data/lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb +0 -17
  463. data/lib/bandwidth/voice_lib/voice/models/state1_enum.rb +0 -20
  464. data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +0 -17
  465. data/lib/bandwidth/voice_lib/voice/models/status_enum.rb +0 -17
  466. data/lib/bandwidth/voice_lib/voice/models/transcribe_recording_request.rb +0 -108
  467. data/lib/bandwidth/voice_lib/voice/models/transcript.rb +0 -60
  468. data/lib/bandwidth/voice_lib/voice/models/transcription.rb +0 -80
  469. data/lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb +0 -89
  470. data/lib/bandwidth/voice_lib/voice/models/transcription_response.rb +0 -59
  471. data/lib/bandwidth/voice_lib/voice.rb +0 -48
  472. data/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb +0 -18
  473. data/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +0 -60
  474. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +0 -703
  475. data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +0 -47
  476. data/lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb +0 -37
  477. data/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb +0 -62
  478. data/lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb +0 -17
  479. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb +0 -115
  480. data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb +0 -48
  481. data/lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb +0 -17
  482. data/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb +0 -60
  483. data/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb +0 -71
  484. data/lib/bandwidth/web_rtc_lib/web_rtc.rb +0 -22
  485. data/lib/bandwidth.rb +0 -73
  486. data/test/controllers/controller_test_base.rb +0 -21
  487. data/test/http_response_catcher.rb +0 -19
  488. data/test/integration/test_integration.rb +0 -691
  489. data/test/test_helper.rb +0 -94
@@ -0,0 +1,358 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ # If the originating call leaves the <Bridge>, then this callback is sent to the bridgeTargetCompleteUrl, and the BXML returned in it is executed on the target call. If this webhook is sent, the Bridge Complete webhook is NOT sent.
18
+ class BridgeTargetCompleteCallback
19
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
20
+ attr_accessor :event_type
21
+
22
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
23
+ attr_accessor :event_time
24
+
25
+ # The user account associated with the call.
26
+ attr_accessor :account_id
27
+
28
+ # The id of the application associated with the call.
29
+ attr_accessor :application_id
30
+
31
+ # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
32
+ attr_accessor :from
33
+
34
+ # The phone number that received the call, in E.164 format (e.g. +15555555555).
35
+ attr_accessor :to
36
+
37
+ attr_accessor :direction
38
+
39
+ # The call id associated with the event.
40
+ attr_accessor :call_id
41
+
42
+ # The URL of the call associated with the event.
43
+ attr_accessor :call_url
44
+
45
+ # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.
46
+ attr_accessor :enqueued_time
47
+
48
+ # Time the call was started, in ISO 8601 format.
49
+ attr_accessor :start_time
50
+
51
+ # Time the call was answered, in ISO 8601 format.
52
+ attr_accessor :answer_time
53
+
54
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
55
+ attr_accessor :tag
56
+
57
+ class EnumAttributeValidator
58
+ attr_reader :datatype
59
+ attr_reader :allowable_values
60
+
61
+ def initialize(datatype, allowable_values)
62
+ @allowable_values = allowable_values.map do |value|
63
+ case datatype.to_s
64
+ when /Integer/i
65
+ value.to_i
66
+ when /Float/i
67
+ value.to_f
68
+ else
69
+ value
70
+ end
71
+ end
72
+ end
73
+
74
+ def valid?(value)
75
+ !value || allowable_values.include?(value)
76
+ end
77
+ end
78
+
79
+ # Attribute mapping from ruby-style variable name to JSON key.
80
+ def self.attribute_map
81
+ {
82
+ :'event_type' => :'eventType',
83
+ :'event_time' => :'eventTime',
84
+ :'account_id' => :'accountId',
85
+ :'application_id' => :'applicationId',
86
+ :'from' => :'from',
87
+ :'to' => :'to',
88
+ :'direction' => :'direction',
89
+ :'call_id' => :'callId',
90
+ :'call_url' => :'callUrl',
91
+ :'enqueued_time' => :'enqueuedTime',
92
+ :'start_time' => :'startTime',
93
+ :'answer_time' => :'answerTime',
94
+ :'tag' => :'tag'
95
+ }
96
+ end
97
+
98
+ # Returns all the JSON keys this model knows about
99
+ def self.acceptable_attributes
100
+ attribute_map.values
101
+ end
102
+
103
+ # Attribute type mapping.
104
+ def self.openapi_types
105
+ {
106
+ :'event_type' => :'String',
107
+ :'event_time' => :'Time',
108
+ :'account_id' => :'String',
109
+ :'application_id' => :'String',
110
+ :'from' => :'String',
111
+ :'to' => :'String',
112
+ :'direction' => :'CallDirectionEnum',
113
+ :'call_id' => :'String',
114
+ :'call_url' => :'String',
115
+ :'enqueued_time' => :'Time',
116
+ :'start_time' => :'Time',
117
+ :'answer_time' => :'Time',
118
+ :'tag' => :'String'
119
+ }
120
+ end
121
+
122
+ # List of attributes with nullable: true
123
+ def self.openapi_nullable
124
+ Set.new([
125
+ :'enqueued_time',
126
+ :'answer_time',
127
+ :'tag'
128
+ ])
129
+ end
130
+
131
+ # Initializes the object
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ def initialize(attributes = {})
134
+ if (!attributes.is_a?(Hash))
135
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BridgeTargetCompleteCallback` initialize method'
136
+ end
137
+
138
+ # check to see if the attribute exists and convert string to symbol for hash key
139
+ attributes = attributes.each_with_object({}) { |(k, v), h|
140
+ if (!self.class.attribute_map.key?(k.to_sym))
141
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BridgeTargetCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
142
+ end
143
+ h[k.to_sym] = v
144
+ }
145
+
146
+ if attributes.key?(:'event_type')
147
+ self.event_type = attributes[:'event_type']
148
+ end
149
+
150
+ if attributes.key?(:'event_time')
151
+ self.event_time = attributes[:'event_time']
152
+ end
153
+
154
+ if attributes.key?(:'account_id')
155
+ self.account_id = attributes[:'account_id']
156
+ end
157
+
158
+ if attributes.key?(:'application_id')
159
+ self.application_id = attributes[:'application_id']
160
+ end
161
+
162
+ if attributes.key?(:'from')
163
+ self.from = attributes[:'from']
164
+ end
165
+
166
+ if attributes.key?(:'to')
167
+ self.to = attributes[:'to']
168
+ end
169
+
170
+ if attributes.key?(:'direction')
171
+ self.direction = attributes[:'direction']
172
+ end
173
+
174
+ if attributes.key?(:'call_id')
175
+ self.call_id = attributes[:'call_id']
176
+ end
177
+
178
+ if attributes.key?(:'call_url')
179
+ self.call_url = attributes[:'call_url']
180
+ end
181
+
182
+ if attributes.key?(:'enqueued_time')
183
+ self.enqueued_time = attributes[:'enqueued_time']
184
+ end
185
+
186
+ if attributes.key?(:'start_time')
187
+ self.start_time = attributes[:'start_time']
188
+ end
189
+
190
+ if attributes.key?(:'answer_time')
191
+ self.answer_time = attributes[:'answer_time']
192
+ end
193
+
194
+ if attributes.key?(:'tag')
195
+ self.tag = attributes[:'tag']
196
+ end
197
+ end
198
+
199
+ # Show invalid properties with the reasons. Usually used together with valid?
200
+ # @return Array for valid properties with the reasons
201
+ def list_invalid_properties
202
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
203
+ invalid_properties = Array.new
204
+ invalid_properties
205
+ end
206
+
207
+ # Check to see if the all the properties in the model are valid
208
+ # @return true if the model is valid
209
+ def valid?
210
+ warn '[DEPRECATED] the `valid?` method is obsolete'
211
+ true
212
+ end
213
+
214
+ # Checks equality by comparing each attribute.
215
+ # @param [Object] Object to be compared
216
+ def ==(o)
217
+ return true if self.equal?(o)
218
+ self.class == o.class &&
219
+ event_type == o.event_type &&
220
+ event_time == o.event_time &&
221
+ account_id == o.account_id &&
222
+ application_id == o.application_id &&
223
+ from == o.from &&
224
+ to == o.to &&
225
+ direction == o.direction &&
226
+ call_id == o.call_id &&
227
+ call_url == o.call_url &&
228
+ enqueued_time == o.enqueued_time &&
229
+ start_time == o.start_time &&
230
+ answer_time == o.answer_time &&
231
+ tag == o.tag
232
+ end
233
+
234
+ # @see the `==` method
235
+ # @param [Object] Object to be compared
236
+ def eql?(o)
237
+ self == o
238
+ end
239
+
240
+ # Calculates hash code according to all attributes.
241
+ # @return [Integer] Hash code
242
+ def hash
243
+ [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, enqueued_time, start_time, answer_time, tag].hash
244
+ end
245
+
246
+ # Builds the object from hash
247
+ # @param [Hash] attributes Model attributes in the form of hash
248
+ # @return [Object] Returns the model itself
249
+ def self.build_from_hash(attributes)
250
+ return nil unless attributes.is_a?(Hash)
251
+ attributes = attributes.transform_keys(&:to_sym)
252
+ transformed_hash = {}
253
+ openapi_types.each_pair do |key, type|
254
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
255
+ transformed_hash["#{key}"] = nil
256
+ elsif type =~ /\AArray<(.*)>/i
257
+ # check to ensure the input is an array given that the attribute
258
+ # is documented as an array but the input is not
259
+ if attributes[attribute_map[key]].is_a?(Array)
260
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
261
+ end
262
+ elsif !attributes[attribute_map[key]].nil?
263
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
264
+ end
265
+ end
266
+ new(transformed_hash)
267
+ end
268
+
269
+ # Deserializes the data based on type
270
+ # @param string type Data type
271
+ # @param string value Value to be deserialized
272
+ # @return [Object] Deserialized data
273
+ def self._deserialize(type, value)
274
+ case type.to_sym
275
+ when :Time
276
+ Time.parse(value)
277
+ when :Date
278
+ Date.parse(value)
279
+ when :String
280
+ value.to_s
281
+ when :Integer
282
+ value.to_i
283
+ when :Float
284
+ value.to_f
285
+ when :Boolean
286
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
287
+ true
288
+ else
289
+ false
290
+ end
291
+ when :Object
292
+ # generic object (usually a Hash), return directly
293
+ value
294
+ when /\AArray<(?<inner_type>.+)>\z/
295
+ inner_type = Regexp.last_match[:inner_type]
296
+ value.map { |v| _deserialize(inner_type, v) }
297
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
298
+ k_type = Regexp.last_match[:k_type]
299
+ v_type = Regexp.last_match[:v_type]
300
+ {}.tap do |hash|
301
+ value.each do |k, v|
302
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
303
+ end
304
+ end
305
+ else # model
306
+ # models (e.g. Pet) or oneOf
307
+ klass = Bandwidth.const_get(type)
308
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
309
+ end
310
+ end
311
+
312
+ # Returns the string representation of the object
313
+ # @return [String] String presentation of the object
314
+ def to_s
315
+ to_hash.to_s
316
+ end
317
+
318
+ # to_body is an alias to to_hash (backward compatibility)
319
+ # @return [Hash] Returns the object in the form of hash
320
+ def to_body
321
+ to_hash
322
+ end
323
+
324
+ # Returns the object in the form of hash
325
+ # @return [Hash] Returns the object in the form of hash
326
+ def to_hash
327
+ hash = {}
328
+ self.class.attribute_map.each_pair do |attr, param|
329
+ value = self.send(attr)
330
+ if value.nil?
331
+ is_nullable = self.class.openapi_nullable.include?(attr)
332
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
333
+ end
334
+
335
+ hash[param] = _to_hash(value)
336
+ end
337
+ hash
338
+ end
339
+
340
+ # Outputs non-array value in the form of hash
341
+ # For object, use to_hash. Otherwise, just return the value
342
+ # @param [Object] value Any valid value
343
+ # @return [Hash] Returns the value in the form of hash
344
+ def _to_hash(value)
345
+ if value.is_a?(Array)
346
+ value.compact.map { |v| _to_hash(v) }
347
+ elsif value.is_a?(Hash)
348
+ {}.tap do |hash|
349
+ value.each { |k, v| hash[k] = _to_hash(v) }
350
+ end
351
+ elsif value.respond_to? :to_hash
352
+ value.to_hash
353
+ else
354
+ value
355
+ end
356
+ end
357
+ end
358
+ end
@@ -0,0 +1,11 @@
1
+ module Bandwidth
2
+ module Bxml
3
+ class Bxml < Bandwidth::Bxml::Root
4
+ # Initializer
5
+ # @param nested_verbs [Array<Verb>] XML element children. Defaults to an empty array.
6
+ def initialize(nested_verbs = [])
7
+ super(tag = 'Bxml', nested_verbs)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,46 @@
1
+ require 'ox'
2
+
3
+ module Bandwidth
4
+ module Bxml
5
+ class NestableVerb < Bandwidth::Bxml::Verb
6
+ # Initializer
7
+ # @param tag [String] Name of the XML element.
8
+ # @param content [String] XML element content. Defaults to nil.
9
+ # @param nested_verbs [Array] XML element children. Defaults to an empty array.
10
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
11
+ def initialize(tag, content = nil, nested_verbs = [], attributes = {})
12
+ @tag = tag
13
+ @content = content
14
+ @nested_verbs = nested_verbs
15
+ @attributes = attributes
16
+ end
17
+
18
+ # Generate an XML element for the verb
19
+ # @return [Node] The XML element.
20
+ def generate_xml
21
+ root = Ox::Element.new(@tag)
22
+ if @content
23
+ root << @content
24
+ end
25
+
26
+ if @nested_verbs.length > 0
27
+ @nested_verbs.each do |verb|
28
+ root << verb.generate_xml
29
+ end
30
+ end
31
+
32
+ if !@attributes.empty? && !@attribute_map.nil?
33
+ @attributes.each do |key, value|
34
+ if @attribute_map.include? key.to_sym
35
+ root[@attribute_map[key.to_sym]] = value
36
+ else
37
+ raise NoMethodError.new("attribute '#{key}' is not a valid attribute for this verb")
38
+ end
39
+ end
40
+ end
41
+
42
+ root
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,11 @@
1
+ module Bandwidth
2
+ module Bxml
3
+ class Response < Bandwidth::Bxml::Root
4
+ # Initializer
5
+ # @param nested_verbs [Array<Verb>] XML element children. Defaults to an empty array.
6
+ def initialize(nested_verbs = [])
7
+ super(tag = 'Response', nested_verbs)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,47 @@
1
+ require 'ox'
2
+
3
+ module Bandwidth
4
+ module Bxml
5
+ SPEAK_SENTENCE_REGEX = /<SpeakSentence.*?>(.*?)<\/SpeakSentence>/
6
+ SSML_REGEX = /&lt;([a-zA-Z\/\/].*?)&gt;/
7
+
8
+ class Root
9
+ # Initializer
10
+ # @param tag [String] Name of the XML element.
11
+ # @param nested_verbs [Array<Verb>] XML element children. Defaults to an empty array.
12
+ def initialize(tag, nested_verbs = [])
13
+ @tag = tag
14
+ @nested_verbs = nested_verbs
15
+ end
16
+
17
+ # Generate an XML element for the BXML response
18
+ # @return [Document] The XML element.
19
+ def generate_xml
20
+ xml = Ox::Document.new
21
+ instruct = Ox::Instruct.new(:xml)
22
+ instruct[:version] = '1.0'
23
+ instruct[:encoding] = 'UTF-8'
24
+ xml << instruct
25
+ root = Ox::Element.new(@tag)
26
+ @nested_verbs.each do |verb|
27
+ root << verb.generate_xml
28
+ end
29
+ xml << root
30
+ xml
31
+ end
32
+
33
+ # Add a verb to the nested verbs array
34
+ # @param *nested_verbs [Verb] or [Array<Verb>] Verb or verbs to add to the array.
35
+ def add_verb(nested_verbs)
36
+ @nested_verbs.push(*nested_verbs)
37
+ end
38
+
39
+ # Return BXML representaion of this response
40
+ # @return [String] The XML response in string format.
41
+ def to_bxml
42
+ bxml = Ox.dump(generate_xml)
43
+ bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>') }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,50 @@
1
+ require 'ox'
2
+
3
+ module Bandwidth
4
+ module Bxml
5
+ class Verb
6
+ # Initializer
7
+ # @param tag [String] Name of the XML element.
8
+ # @param content [String] XML element content. Defaults to nil.
9
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
10
+ def initialize(tag, content = nil, attributes = {})
11
+ @tag = tag
12
+ @content = content
13
+ @attributes = attributes
14
+ end
15
+
16
+ # Set XML attributes for the verb
17
+ # @param attributes [Hash] The attributes to add to the element.
18
+ def set_attributes(attributes)
19
+ @attributes = attributes
20
+ end
21
+
22
+ # Generate an XML element for the verb
23
+ # @return [Node] The XML element.
24
+ def generate_xml
25
+ root = Ox::Element.new(@tag)
26
+ if @content
27
+ root << @content
28
+ end
29
+
30
+ if !@attributes.empty? && !@attribute_map.nil?
31
+ @attributes.each do |key, value|
32
+ if @attribute_map.include? key.to_sym
33
+ root[@attribute_map[key.to_sym]] = value
34
+ else
35
+ raise NoMethodError.new("attribute '#{key}' is not a valid attribute for this verb")
36
+ end
37
+ end
38
+ end
39
+
40
+ root
41
+ end
42
+
43
+ # Return BXML representaion of this element
44
+ # @return [String] The XML element in string format.
45
+ def to_bxml
46
+ Ox.dump(generate_xml)
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,28 @@
1
+ module Bandwidth
2
+ module Bxml
3
+ class Bridge < Bandwidth::Bxml::Verb
4
+ # Initializer
5
+ # @param target_call [String] The callId of the call to be bridged.
6
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
7
+ def initialize(target_call, attributes = {})
8
+ super('Bridge', target_call, attributes)
9
+
10
+ @attribute_map = {
11
+ bridge_complete_url: 'bridgeCompleteUrl', # Optional [String]: URL to send the Bridge Complete event to and request new BXML. If this attribute is specified, then Verbs following the <Bridge> verb will be ignored and the BXML returned in this webhook is executed on the call. If this attribute is not specified then no webhook will be sent, and execution of the verbs following the <Bridge> verb continues. May be a relative URL. Defaults to None.
12
+ bridge_complete_method: 'bridgeCompleteMethod', # Optional [String]: The HTTP method to use for the request to bridgeCompleteUrl. GET or POST. Default value is POST.
13
+ bridge_complete_fallback_url: 'bridgeCompleteFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Bridge Complete webhook delivery in case bridgeCompleteUrl fails to respond. Defaults to None.
14
+ bridge_complete_fallback_method: 'bridgeCompleteFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Bridge Complete webhook to bridgeCompleteFallbackUrl. GET or POST. Default value is POST.
15
+ bridge_target_complete_url: 'bridgeTargetCompleteUrl', # Optional [String]: URL to send the Bridge Target Complete event to and request new BXML. If this attribute is specified, then the BXML returned in this webhook is executed on the target call. If this attribute is not specified then no webhook will be sent, and the target call will be hung up. May be a relative URL. Defaults to None.
16
+ bridge_target_complete_method: 'bridgeTargetCompleteMethod', # Optional [String]: The HTTP method to use for the request to bridgeTargetCompleteUrl. GET or POST. Default value is POST.
17
+ bridge_target_complete_fallback_url: 'bridgeTargetCompleteFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Bridge Target Complete webhook delivery in case bridgeTargetCompleteUrl fails to respond. Defaults to None.
18
+ bridge_target_complete_fallback_method: 'bridgeTargetCompleteFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Bridge Target Complete webhook to bridgeTargetCompleteFallbackUrl. GET or POST. Default value is POST.
19
+ username: 'username', # Optional [String]: The username to send in the HTTP request to bridgeCompleteUrl and to bridgeTargetCompleteUrl. Defaults to None.
20
+ password: 'password', # Optional [String]: The password to send in the HTTP request to bridgeCompleteUrl and to bridgeTargetCompleteUrl. Defaults to None.
21
+ fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to bridgeCompleteFallbackUrl and to bridgeTargetCompleteFallbackUrl. Defaults to None.
22
+ fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to bridgeCompleteFallbackUrl and to bridgeTargetCompleteFallbackUrl. Defaults to None.
23
+ tag: 'tag', # Optional [String]: A custom string that will be sent with the bridgeComplete webhook and all future webhooks of the call unless overwritten by a future tag attribute or <Tag> verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None.
24
+ }
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module Bandwidth
2
+ module Bxml
3
+ class Conference < Bandwidth::Bxml::Verb
4
+ # Initializer
5
+ # @param name [String] The name of the conference. Can contain up to 100 characters of letters, numbers, and the symbols -, _, and .
6
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
7
+ def initialize(name, attributes = {})
8
+ super('Conference', name, attributes)
9
+
10
+ @attribute_map = {
11
+ mute: 'mute', # Optional [Boolean]: A boolean value to indicate whether the member should be on mute in the conference. When muted, a member can hear others speak, but others cannot hear them speak. Defaults to false.
12
+ hold: 'hold', # Optional [Boolean]: A boolean value to indicate whether the member should be on hold in the conference. When on hold, a member cannot hear others, and they cannot be heard. Defaults to false.
13
+ call_ids_to_coach: 'callIdsToCoach', # Optional [String]: A comma-separated list of call ids to coach. When a call joins a conference with this attribute set, it will coach the listed calls. Those calls will be able to hear and be heard by the coach, but other calls in the conference will not hear the coach.
14
+ conference_event_url: 'conferenceEventUrl', # Optional [String]: URL to send Conference events to. The URL, method, username, and password are set by the BXML document that creates the conference, and all events related to that conference will be delivered to that same endpoint. If more calls join afterwards and also have this property (or any other webhook related properties like username and password), they will be ignored and the original webhook information will be used. This URL may be a relative endpoint.
15
+ conference_event_method: 'conferenceEventMethod', # Optional [String]: The HTTP method to use for the request to conferenceEventUrl. GET or POST. Default value is POST.
16
+ conference_event_fallback_url: 'conferenceEventFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the conference webhook deliveries in case conferenceEventUrl fails to respond.
17
+ conference_event_fallback_method: 'conferenceEventFallbackMethod', # Optional [String]: The HTTP method to use to deliver the conference webhooks to conferenceEventFallbackUrl. GET or POST. Default value is POST.
18
+ username: 'username', # Optional [String]: The username to send in the HTTP request to conferenceEventUrl.
19
+ password: 'password', # Optional [String]: The password to send in the HTTP request to conferenceEventUrl.
20
+ fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to conferenceEventFallbackUrl.
21
+ fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to conferenceEventFallbackUrl.
22
+ tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or <Tag> verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None.
23
+ callback_timeout: 'callbackTimeout', # Optional [Number]: This is the timeout (in seconds) to use when delivering webhooks for the conference. If not set, it will inherit the webhook timeout from the call that creates the conference. Can be any numeric value (including decimals) between 1 and 25.
24
+ }
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,16 @@
1
+ module Bandwidth
2
+ module Bxml
3
+ class CustomParam < Bandwidth::Bxml::Verb
4
+ # Initializer
5
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
6
+ def initialize(attributes = {})
7
+ super('CustomParam', nil, attributes)
8
+
9
+ @attribute_map = {
10
+ name: 'name', # [String]: The name of this parameter, up to 256 characters.
11
+ value: 'value', # [String]: The value of this parameter, up to 2048 characters.
12
+ }
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,20 @@
1
+ module Bandwidth
2
+ module Bxml
3
+ class Forward < Bandwidth::Bxml::Verb
4
+ # Initializer
5
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
6
+ def initialize(attributes = {})
7
+ super('Forward', nil, attributes)
8
+
9
+ @attribute_map = {
10
+ to: 'to', # [String]: The phone number destination of the call.
11
+ from: 'from', # Optional [String]: The phone number that the recipient will receive the call from.
12
+ call_timeout: 'callTimeout', # Optional [Number]: The number of seconds to wait before timing out the call.
13
+ diversion_treatment: 'diversionTreatment', # Optional [String]: Can be any of the following: - none: No diversion headers are sent on the outbound leg of the transferred call. - propagate: Copy the Diversion header from the inbound leg to the outbound leg. Ignored if there is no Diversion header present on the inbound leg. - stack: After propagating any Diversion header from the inbound leg to the outbound leg, stack on top another Diversion header based on the Request-URI of the inbound call. If diversionTreatment is not specified, no diversion header will be included for the transfer even if one came with the inbound call. Defaults to None.
14
+ diversion_reason: 'diversionReason', # Optional [String]: Can be any of the following values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away. This parameter is considered only when diversionTreatment is set to stack. Defaults to None.
15
+ uui: 'uui', # Optional [String]: The value of the User-To-User header to send within the outbound INVITE when forwarding to a SIP URI. Must include the encoding parameter as specified in RFC 7433. Only base64 and jwt encoding are currently allowed. This value, including the encoding specifier, may not exceed 256 characters.
16
+ }
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,42 @@
1
+ module Bandwidth
2
+ module Bxml
3
+ class Gather < Bandwidth::Bxml::NestableVerb
4
+ # Initializer
5
+ # @param audio_verbs [Array] XML element children. Defaults to an empty array. Valid nested audio verbs are: SpeakSentence, PlayAudio.
6
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
7
+ def initialize(audio_verbs = [], attributes = {})
8
+ super('Gather', nil, audio_verbs, attributes)
9
+
10
+ @attribute_map = {
11
+ gather_url: 'gatherUrl', # Optional [String]: URL to send Gather event to and request new BXML. May be a relative URL.
12
+ gather_method: 'gatherMethod', # Optional [String]: The HTTP method to use for the request to gather_url. GET or POST. Default value is POST.
13
+ gather_fallback_url: 'gatherFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Gather event callback delivery in case gather_url fails to respond.
14
+ gather_fallback_method: 'gatherFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Gather event callback to gather_fallback_url. GET or POST. Default value is POST.
15
+ username: 'username', # Optional [String]: The username to send in the HTTP request to gather_url.
16
+ password: 'password', # Optional [String]: The password to send in the HTTP request to gather_url.
17
+ fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to gather_fallback_url.
18
+ fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to gather_fallback_url.
19
+ tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or <Tag> verb, or cleared. May be cleared by setting tag="". Max length 256 characters.
20
+ terminating_digits: 'terminatingDigits', # Optional [String]: When any of these digits are pressed, it will terminate the Gather. Default value is "", which disables this feature.
21
+ max_digits: 'maxDigits', # Optional [Number]: Max number of digits to collect. Default value is 50. Range: decimal values between 1 - 50.
22
+ inter_digit_timeout: 'interDigitTimeout', # Optional [Number]: Time (in seconds) allowed between digit presses before automatically terminating the Gather. Default value is 5. Range: decimal values between 1 - 60.
23
+ first_digit_timeout: 'firstDigitTimeout', # Optional [Number]: Time (in seconds) to pause after any audio from nested <SpeakSentence> or <PlayAudio> verb is played (in seconds) before terminating the Gather. Default value is 5. Range: decimal values between 0 - 60.
24
+ repeat_count: 'repeat_count', # Optional [Number]: The number of times the audio prompt should be played if no digits are pressed. For example, if this value is 3, the nested audio clip will be played a maximum of three times. The delay between repetitions will be equal to first_digit_timeout. Default value is 1. repeat_count * number of verbs must not be greater than 20.
25
+ }
26
+ end
27
+
28
+ # Return BXML representaion of this response
29
+ # @return [String] The XML response in string format.
30
+ def to_bxml
31
+ bxml = Ox.dump(generate_xml)
32
+ bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>') }
33
+ end
34
+
35
+ # Add audio verb/s to the nested verbs array
36
+ # @param audio_verbs [SpeakSentence] || [PlayAudio] or [Array<SpeakSentence || PlayAudio>] Verb or verbs to add to the array.
37
+ def add_audio_verb(audio_verbs)
38
+ @nested_verbs.push(*audio_verbs)
39
+ end
40
+ end
41
+ end
42
+ end