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.
- checksums.yaml +4 -4
- data/Gemfile +11 -0
- data/Gemfile.lock +102 -0
- data/README.md +204 -139
- data/Rakefile +30 -0
- data/bandwidth-sdk.gemspec +40 -0
- data/bandwidth.yml +5626 -0
- data/coverage/.last_run.json +5 -0
- data/coverage/.resultset.json +9761 -0
- data/coverage/.resultset.json.lock +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_both.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
- data/coverage/assets/0.12.3/application.css +1 -0
- data/coverage/assets/0.12.3/application.js +7 -0
- data/coverage/assets/0.12.3/colorbox/border.png +0 -0
- data/coverage/assets/0.12.3/colorbox/controls.png +0 -0
- data/coverage/assets/0.12.3/colorbox/loading.gif +0 -0
- data/coverage/assets/0.12.3/colorbox/loading_background.png +0 -0
- data/coverage/assets/0.12.3/favicon_green.png +0 -0
- data/coverage/assets/0.12.3/favicon_red.png +0 -0
- data/coverage/assets/0.12.3/favicon_yellow.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/assets/0.12.3/loading.gif +0 -0
- data/coverage/assets/0.12.3/magnify.png +0 -0
- data/coverage/index.html +108271 -0
- data/custom_templates/Gemfile.mustache +11 -0
- data/custom_templates/README.mustache +173 -0
- data/custom_templates/gem.mustache +99 -0
- data/custom_templates/gemspec.mustache +37 -0
- data/docs/AccountStatistics.md +20 -0
- data/docs/AnswerCallback.md +44 -0
- data/docs/BridgeCompleteCallback.md +48 -0
- data/docs/BridgeTargetCompleteCallback.md +42 -0
- data/docs/CallDirectionEnum.md +15 -0
- data/docs/CallRecordingMetadata.md +52 -0
- data/docs/CallState.md +52 -0
- data/docs/CallStateEnum.md +15 -0
- data/docs/CallbackMethodEnum.md +15 -0
- data/docs/CallsApi.md +304 -0
- data/docs/CodeRequest.md +28 -0
- data/docs/Conference.md +32 -0
- data/docs/ConferenceCompletedCallback.md +26 -0
- data/docs/ConferenceCreatedCallback.md +26 -0
- data/docs/ConferenceMember.md +28 -0
- data/docs/ConferenceMemberExitCallback.md +32 -0
- data/docs/ConferenceMemberJoinCallback.md +32 -0
- data/docs/ConferenceRecordingAvailableCallback.md +44 -0
- data/docs/ConferenceRecordingMetadata.md +38 -0
- data/docs/ConferenceRedirectCallback.md +26 -0
- data/docs/ConferenceStateEnum.md +15 -0
- data/docs/ConferencesApi.md +688 -0
- data/docs/CreateCall.md +56 -0
- data/docs/CreateCallResponse.md +58 -0
- data/docs/CreateLookupResponse.md +20 -0
- data/docs/CreateMessageRequestError.md +22 -0
- data/docs/CreateParticipantRequest.md +24 -0
- data/docs/CreateParticipantResponse.md +20 -0
- data/docs/DeferredResult.md +20 -0
- data/docs/DeviceApiVersionEnum.md +15 -0
- data/docs/DisconenctCallback.md +50 -0
- data/docs/DisconnectCallback.md +50 -0
- data/docs/Diversion.md +30 -0
- data/docs/DtmfCallback.md +50 -0
- data/docs/FieldError.md +20 -0
- data/docs/FileFormatEnum.md +15 -0
- data/docs/ForbiddenRequest.md +18 -0
- data/docs/GatherCallback.md +52 -0
- data/docs/InboundMessageCallback.md +26 -0
- data/docs/InboundMessageCallbackMessage.md +40 -0
- data/docs/InitiateCallback.md +40 -0
- data/docs/ListMessageDirectionEnum.md +15 -0
- data/docs/ListMessageItem.md +50 -0
- data/docs/LookupRequest.md +18 -0
- data/docs/LookupResult.md +34 -0
- data/docs/LookupStatus.md +24 -0
- data/docs/LookupStatusEnum.md +15 -0
- data/docs/MFAApi.md +226 -0
- data/docs/MachineDetectionCompleteCallback.md +44 -0
- data/docs/MachineDetectionConfiguration.md +46 -0
- data/docs/MachineDetectionModeEnum.md +15 -0
- data/docs/MachineDetectionResult.md +20 -0
- data/docs/Media.md +22 -0
- data/docs/MediaApi.md +307 -0
- data/docs/Message.md +42 -0
- data/docs/MessageDeliveredCallback.md +26 -0
- data/docs/MessageDeliveredCallbackMessage.md +40 -0
- data/docs/MessageDirectionEnum.md +15 -0
- data/docs/MessageFailedCallback.md +28 -0
- data/docs/MessageFailedCallbackMessage.md +40 -0
- data/docs/MessageRequest.md +32 -0
- data/docs/MessageSendingCallback.md +26 -0
- data/docs/MessageSendingCallbackMessage.md +40 -0
- data/docs/MessageStatusEnum.md +15 -0
- data/docs/MessageTypeEnum.md +15 -0
- data/docs/MessagesApi.md +183 -0
- data/docs/MessagesList.md +22 -0
- data/docs/MessagingCodeResponse.md +18 -0
- data/docs/MessagingRequestError.md +20 -0
- data/docs/MfaForbiddenRequestError.md +18 -0
- data/docs/MfaRequestError.md +20 -0
- data/docs/MfaUnauthorizedRequestError.md +18 -0
- data/docs/PageInfo.md +24 -0
- data/docs/Participant.md +30 -0
- data/docs/ParticipantSubscription.md +20 -0
- data/docs/ParticipantsApi.md +227 -0
- data/docs/PhoneNumberLookupApi.md +153 -0
- data/docs/PriorityEnum.md +15 -0
- data/docs/PublishPermissionsEnum.md +15 -0
- data/docs/RecordingAvailableCallback.md +60 -0
- data/docs/RecordingCompleteCallback.md +60 -0
- data/docs/RecordingStateEnum.md +15 -0
- data/docs/RecordingsApi.md +758 -0
- data/docs/RedirectCallback.md +48 -0
- data/docs/RedirectMethodEnum.md +15 -0
- data/docs/RequestError.md +20 -0
- data/docs/Session.md +20 -0
- data/docs/SessionsApi.md +605 -0
- data/docs/StatisticsApi.md +78 -0
- data/docs/StirShaken.md +22 -0
- data/docs/Subscriptions.md +20 -0
- data/docs/Tag.md +20 -0
- data/docs/TnLookupRequestError.md +18 -0
- data/docs/TranscribeRecording.md +30 -0
- data/docs/Transcription.md +20 -0
- data/docs/TranscriptionAvailableCallback.md +58 -0
- data/docs/TranscriptionList.md +18 -0
- data/docs/TranscriptionMetadata.md +24 -0
- data/docs/TransferAnswerCallback.md +46 -0
- data/docs/TransferCompleteCallback.md +52 -0
- data/docs/TransferDisconnectCallback.md +56 -0
- data/docs/UnauthorizedRequest.md +18 -0
- data/docs/UpdateCall.md +36 -0
- data/docs/UpdateCallRecording.md +18 -0
- data/docs/UpdateConference.md +34 -0
- data/docs/UpdateConferenceMember.md +22 -0
- data/docs/VerifyCodeRequest.md +24 -0
- data/docs/VerifyCodeResponse.md +18 -0
- data/docs/VoiceApiError.md +22 -0
- data/docs/VoiceCodeResponse.md +18 -0
- data/git_push.sh +57 -0
- data/lib/bandwidth-sdk/api/calls_api.rb +325 -0
- data/lib/bandwidth-sdk/api/conferences_api.rb +717 -0
- data/lib/bandwidth-sdk/api/media_api.rb +312 -0
- data/lib/bandwidth-sdk/api/messages_api.rb +204 -0
- data/lib/bandwidth-sdk/api/mfa_api.rb +244 -0
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +165 -0
- data/lib/bandwidth-sdk/api/recordings_api.rb +782 -0
- data/lib/bandwidth-sdk/api/statistics_api.rb +85 -0
- data/lib/bandwidth-sdk/api_client.rb +428 -0
- data/lib/bandwidth-sdk/api_error.rb +58 -0
- data/lib/bandwidth-sdk/configuration.rb +591 -0
- data/lib/bandwidth-sdk/models/account_statistics.rb +223 -0
- data/lib/bandwidth-sdk/models/answer_callback.rb +368 -0
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +390 -0
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +358 -0
- data/lib/bandwidth-sdk/models/bxml/bxml.rb +11 -0
- data/lib/bandwidth-sdk/models/bxml/nestable_verb.rb +46 -0
- data/lib/bandwidth-sdk/models/bxml/response.rb +11 -0
- data/lib/bandwidth-sdk/models/bxml/root.rb +47 -0
- data/lib/bandwidth-sdk/models/bxml/verb.rb +50 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb +28 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/conference.rb +28 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb +16 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/forward.rb +20 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +42 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb +10 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/pause.rb +15 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb +10 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb +26 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb +17 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/record.rb +32 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb +23 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb +10 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/ring.rb +16 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb +17 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb +27 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb +25 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb +19 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb +24 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +28 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +29 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb +10 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb +10 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb +15 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb +15 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb +16 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/tag.rb +11 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +34 -0
- data/lib/bandwidth-sdk/models/call_direction_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +404 -0
- data/lib/bandwidth-sdk/models/call_state.rb +416 -0
- data/lib/bandwidth-sdk/models/call_state_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/callback_method_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/code_request.rb +434 -0
- data/lib/bandwidth-sdk/models/conference.rb +313 -0
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +255 -0
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +255 -0
- data/lib/bandwidth-sdk/models/conference_member.rb +266 -0
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +285 -0
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +285 -0
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +367 -0
- data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +335 -0
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +255 -0
- data/lib/bandwidth-sdk/models/conference_state_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/create_call.rb +687 -0
- data/lib/bandwidth-sdk/models/create_call_response.rb +559 -0
- data/lib/bandwidth-sdk/models/create_lookup_response.rb +245 -0
- data/lib/bandwidth-sdk/models/create_message_request_error.rb +246 -0
- data/lib/bandwidth-sdk/models/deferred_result.rb +221 -0
- data/lib/bandwidth-sdk/models/disconenct_callback.rb +405 -0
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +400 -0
- data/lib/bandwidth-sdk/models/diversion.rb +273 -0
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +398 -0
- data/lib/bandwidth-sdk/models/field_error.rb +223 -0
- data/lib/bandwidth-sdk/models/file_format_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/gather_callback.rb +408 -0
- data/lib/bandwidth-sdk/models/inbound_message_callback.rb +284 -0
- data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +411 -0
- data/lib/bandwidth-sdk/models/initiate_callback.rb +343 -0
- data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/list_message_item.rb +398 -0
- data/lib/bandwidth-sdk/models/lookup_request.rb +222 -0
- data/lib/bandwidth-sdk/models/lookup_result.rb +294 -0
- data/lib/bandwidth-sdk/models/lookup_status.rb +269 -0
- data/lib/bandwidth-sdk/models/lookup_status_enum.rb +42 -0
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +368 -0
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +493 -0
- data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/machine_detection_result.rb +224 -0
- data/lib/bandwidth-sdk/models/media.rb +230 -0
- data/lib/bandwidth-sdk/models/message.rb +377 -0
- data/lib/bandwidth-sdk/models/message_delivered_callback.rb +284 -0
- data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +418 -0
- data/lib/bandwidth-sdk/models/message_direction_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/message_failed_callback.rb +300 -0
- data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +425 -0
- data/lib/bandwidth-sdk/models/message_request.rb +358 -0
- data/lib/bandwidth-sdk/models/message_sending_callback.rb +284 -0
- data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +425 -0
- data/lib/bandwidth-sdk/models/message_status_enum.rb +46 -0
- data/lib/bandwidth-sdk/models/message_type_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/messages_list.rb +233 -0
- data/lib/bandwidth-sdk/models/messaging_code_response.rb +213 -0
- data/lib/bandwidth-sdk/models/messaging_request_error.rb +235 -0
- data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +213 -0
- data/lib/bandwidth-sdk/models/mfa_request_error.rb +223 -0
- data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +213 -0
- data/lib/bandwidth-sdk/models/page_info.rb +243 -0
- data/lib/bandwidth-sdk/models/priority_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +447 -0
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +448 -0
- data/lib/bandwidth-sdk/models/recording_state_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/redirect_callback.rb +388 -0
- data/lib/bandwidth-sdk/models/redirect_method_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/stir_shaken.rb +233 -0
- data/lib/bandwidth-sdk/models/tag.rb +221 -0
- data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +213 -0
- data/lib/bandwidth-sdk/models/transcribe_recording.rb +360 -0
- data/lib/bandwidth-sdk/models/transcription.rb +223 -0
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +436 -0
- data/lib/bandwidth-sdk/models/transcription_list.rb +214 -0
- data/lib/bandwidth-sdk/models/transcription_metadata.rb +244 -0
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +378 -0
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +410 -0
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +430 -0
- data/lib/bandwidth-sdk/models/update_call.rb +413 -0
- data/lib/bandwidth-sdk/models/update_call_recording.rb +241 -0
- data/lib/bandwidth-sdk/models/update_conference.rb +387 -0
- data/lib/bandwidth-sdk/models/update_conference_member.rb +236 -0
- data/lib/bandwidth-sdk/models/verify_code_request.rb +341 -0
- data/lib/bandwidth-sdk/models/verify_code_response.rb +213 -0
- data/lib/bandwidth-sdk/models/voice_api_error.rb +231 -0
- data/lib/bandwidth-sdk/models/voice_code_response.rb +213 -0
- data/lib/bandwidth-sdk/version.rb +15 -0
- data/lib/bandwidth-sdk.rb +170 -0
- data/openapi-config.yml +12 -0
- data/openapitools.json +7 -0
- data/spec/api/calls_api_spec.rb +230 -0
- data/spec/api/conferences_api_spec.rb +393 -0
- data/spec/api/media_api_spec.rb +129 -0
- data/spec/api/messages_api_spec.rb +193 -0
- data/spec/api/mfa_api_spec.rb +130 -0
- data/spec/api/phone_number_lookup_api_spec.rb +100 -0
- data/spec/api/recordings_api_spec.rb +395 -0
- data/spec/api/statistics_api_spec.rb +45 -0
- data/spec/api_client_spec.rb +377 -0
- data/spec/api_error_spec.rb +23 -0
- data/spec/call_utils.rb +74 -0
- data/spec/configuration_spec.rb +190 -0
- data/spec/fixtures/ruby_cat.jpeg +0 -0
- data/spec/integration/calls_api_integration_spec.rb +202 -0
- data/spec/integration/conferences_api_integration_spec.rb +169 -0
- data/spec/integration/media_api_integration_spec.rb +92 -0
- data/spec/integration/messages_api_integration_spec.rb +138 -0
- data/spec/integration/mfa_api_integration_spec.rb +117 -0
- data/spec/integration/phone_number_lookup_api_integration_spec.rb +96 -0
- data/spec/integration/recordings_api_integration_spec.rb +226 -0
- data/spec/integration/statistics_api_integration_spec.rb +58 -0
- data/spec/models/bxml/bxml_spec.rb +16 -0
- data/spec/models/bxml/nestable_verb_spec.rb +11 -0
- data/spec/models/bxml/response_spec.rb +16 -0
- data/spec/models/bxml/verb_spec.rb +15 -0
- data/spec/models/bxml/verbs/bridge_spec.rb +58 -0
- data/spec/models/bxml/verbs/conference_spec.rb +58 -0
- data/spec/models/bxml/verbs/custom_param_spec.rb +36 -0
- data/spec/models/bxml/verbs/forward_spec.rb +44 -0
- data/spec/models/bxml/verbs/gather_spec.rb +86 -0
- data/spec/models/bxml/verbs/hangup_spec.rb +16 -0
- data/spec/models/bxml/verbs/pause_recording_spec.rb +16 -0
- data/spec/models/bxml/verbs/pause_spec.rb +34 -0
- data/spec/models/bxml/verbs/phone_number_spec.rb +54 -0
- data/spec/models/bxml/verbs/play_audio_spec.rb +36 -0
- data/spec/models/bxml/verbs/record_spec.rb +68 -0
- data/spec/models/bxml/verbs/redirect_spec.rb +50 -0
- data/spec/models/bxml/verbs/resume_recording_spec.rb +16 -0
- data/spec/models/bxml/verbs/ring_spec.rb +36 -0
- data/spec/models/bxml/verbs/send_dtmf_spec.rb +36 -0
- data/spec/models/bxml/verbs/sip_uri_spec.rb +56 -0
- data/spec/models/bxml/verbs/speak_sentence_spec.rb +38 -0
- data/spec/models/bxml/verbs/start_gather_spec.rb +42 -0
- data/spec/models/bxml/verbs/start_recording_spec.rb +52 -0
- data/spec/models/bxml/verbs/start_stream_spec.rb +72 -0
- data/spec/models/bxml/verbs/start_transcription_spec.rb +74 -0
- data/spec/models/bxml/verbs/stop_gather_spec.rb +16 -0
- data/spec/models/bxml/verbs/stop_recording_spec.rb +16 -0
- data/spec/models/bxml/verbs/stop_stream_spec.rb +34 -0
- data/spec/models/bxml/verbs/stop_transcription_spec.rb +34 -0
- data/spec/models/bxml/verbs/stream_param_spec.rb +36 -0
- data/spec/models/bxml/verbs/tag_spec.rb +16 -0
- data/spec/models/bxml/verbs/transfer_spec.rb +84 -0
- data/spec/models/call_state_enum_spec.rb +16 -0
- data/spec/models/call_state_spec.rb +168 -0
- data/spec/models/deferred_result_spec.rb +74 -0
- data/spec/models/message_spec.rb +138 -0
- data/spec/models/verify_code_request_spec.rb +126 -0
- data/spec/spec_helper.rb +171 -0
- metadata +430 -276
- data/LICENSE +0 -28
- data/lib/bandwidth/api_helper.rb +0 -280
- data/lib/bandwidth/client.rb +0 -75
- data/lib/bandwidth/configuration.rb +0 -209
- data/lib/bandwidth/exceptions/api_exception.rb +0 -20
- data/lib/bandwidth/http/api_response.rb +0 -38
- data/lib/bandwidth/http/auth/messaging_basic_auth.rb +0 -22
- data/lib/bandwidth/http/auth/multi_factor_auth_basic_auth.rb +0 -22
- data/lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb +0 -22
- data/lib/bandwidth/http/auth/voice_basic_auth.rb +0 -22
- data/lib/bandwidth/http/auth/web_rtc_basic_auth.rb +0 -22
- data/lib/bandwidth/http/faraday_client.rb +0 -73
- data/lib/bandwidth/http/http_call_back.rb +0 -24
- data/lib/bandwidth/http/http_client.rb +0 -104
- data/lib/bandwidth/http/http_method_enum.rb +0 -13
- data/lib/bandwidth/http/http_request.rb +0 -50
- data/lib/bandwidth/http/http_response.rb +0 -29
- data/lib/bandwidth/messaging_lib/messaging/client.rb +0 -60
- data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +0 -491
- data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +0 -47
- data/lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb +0 -37
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb +0 -100
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb +0 -164
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb +0 -203
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb +0 -79
- data/lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb +0 -60
- data/lib/bandwidth/messaging_lib/messaging/models/media.rb +0 -70
- data/lib/bandwidth/messaging_lib/messaging/models/message_request.rb +0 -111
- data/lib/bandwidth/messaging_lib/messaging/models/page_info.rb +0 -82
- data/lib/bandwidth/messaging_lib/messaging/models/priority_enum.rb +0 -19
- data/lib/bandwidth/messaging_lib/messaging/models/tag.rb +0 -60
- data/lib/bandwidth/messaging_lib/messaging.rb +0 -25
- data/lib/bandwidth/models/base_model.rb +0 -58
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/client.rb +0 -60
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/base_controller.rb +0 -47
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/controllers/mfa_controller.rb +0 -214
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb +0 -37
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/forbidden_request_exception.rb +0 -32
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/unauthorized_request_exception.rb +0 -32
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb +0 -103
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_messaging_response.rb +0 -50
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_code_response.rb +0 -50
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb +0 -94
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_voice_response.rb +0 -50
- data/lib/bandwidth/multi_factor_auth_lib/multi_factor_auth.rb +0 -23
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/client.rb +0 -60
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/api_controller.rb +0 -1553
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/controllers/base_controller.rb +0 -47
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/exceptions/accounts_tnlookup400_error_exception.rb +0 -32
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_request.rb +0 -50
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_response.rb +0 -61
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb +0 -95
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/result.rb +0 -132
- data/lib/bandwidth/phone_number_lookup_lib/phone_number_lookup.rb +0 -20
- data/lib/bandwidth/utilities/date_time_helper.rb +0 -156
- data/lib/bandwidth/utilities/file_wrapper.rb +0 -16
- data/lib/bandwidth/voice_lib/bxml/bxml.rb +0 -36
- data/lib/bandwidth/voice_lib/bxml/response.rb +0 -39
- data/lib/bandwidth/voice_lib/bxml/verbs/bridge.rb +0 -28
- data/lib/bandwidth/voice_lib/bxml/verbs/conference.rb +0 -32
- data/lib/bandwidth/voice_lib/bxml/verbs/forward.rb +0 -18
- data/lib/bandwidth/voice_lib/bxml/verbs/gather.rb +0 -49
- data/lib/bandwidth/voice_lib/bxml/verbs/hangup.rb +0 -14
- data/lib/bandwidth/voice_lib/bxml/verbs/pause.rb +0 -15
- data/lib/bandwidth/voice_lib/bxml/verbs/pause_recording.rb +0 -14
- data/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb +0 -24
- data/lib/bandwidth/voice_lib/bxml/verbs/play_audio.rb +0 -17
- data/lib/bandwidth/voice_lib/bxml/verbs/record.rb +0 -33
- data/lib/bandwidth/voice_lib/bxml/verbs/redirect.rb +0 -24
- data/lib/bandwidth/voice_lib/bxml/verbs/resume_recording.rb +0 -14
- data/lib/bandwidth/voice_lib/bxml/verbs/ring.rb +0 -16
- data/lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb +0 -16
- data/lib/bandwidth/voice_lib/bxml/verbs/sip_uri.rb +0 -25
- data/lib/bandwidth/voice_lib/bxml/verbs/speak_sentence.rb +0 -18
- data/lib/bandwidth/voice_lib/bxml/verbs/start_gather.rb +0 -20
- data/lib/bandwidth/voice_lib/bxml/verbs/start_recording.rb +0 -25
- data/lib/bandwidth/voice_lib/bxml/verbs/stop_gather.rb +0 -14
- data/lib/bandwidth/voice_lib/bxml/verbs/stop_recording.rb +0 -14
- data/lib/bandwidth/voice_lib/bxml/verbs/tag.rb +0 -13
- data/lib/bandwidth/voice_lib/bxml/verbs/transfer.rb +0 -48
- data/lib/bandwidth/voice_lib/bxml/verbs/xml_verb.rb +0 -26
- data/lib/bandwidth/voice_lib/voice/client.rb +0 -60
- data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +0 -1820
- data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +0 -47
- data/lib/bandwidth/voice_lib/voice/exceptions/api_error_exception.rb +0 -42
- data/lib/bandwidth/voice_lib/voice/models/answer_fallback_method_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/call_callback.rb +0 -343
- data/lib/bandwidth/voice_lib/voice/models/call_recording_metadata.rb +0 -250
- data/lib/bandwidth/voice_lib/voice/models/call_state.rb +0 -301
- data/lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/conference_callback.rb +0 -211
- data/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/conference_member_state.rb +0 -103
- data/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata.rb +0 -173
- data/lib/bandwidth/voice_lib/voice/models/conference_state.rb +0 -153
- data/lib/bandwidth/voice_lib/voice/models/create_call_request.rb +0 -236
- data/lib/bandwidth/voice_lib/voice/models/create_call_response.rb +0 -266
- data/lib/bandwidth/voice_lib/voice/models/direction_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/diversion.rb +0 -80
- data/lib/bandwidth/voice_lib/voice/models/fallback_method_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/file_format_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/machine_detection_configuration.rb +0 -231
- data/lib/bandwidth/voice_lib/voice/models/mode_enum.rb +0 -20
- data/lib/bandwidth/voice_lib/voice/models/modify_call_recording_request.rb +0 -48
- data/lib/bandwidth/voice_lib/voice/models/modify_call_request.rb +0 -156
- data/lib/bandwidth/voice_lib/voice/models/modify_conference_request.rb +0 -144
- data/lib/bandwidth/voice_lib/voice/models/redirect_fallback_method_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/state1_enum.rb +0 -20
- data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/status_enum.rb +0 -17
- data/lib/bandwidth/voice_lib/voice/models/transcribe_recording_request.rb +0 -108
- data/lib/bandwidth/voice_lib/voice/models/transcript.rb +0 -60
- data/lib/bandwidth/voice_lib/voice/models/transcription.rb +0 -80
- data/lib/bandwidth/voice_lib/voice/models/transcription_metadata.rb +0 -89
- data/lib/bandwidth/voice_lib/voice/models/transcription_response.rb +0 -59
- data/lib/bandwidth/voice_lib/voice.rb +0 -48
- data/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb +0 -18
- data/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +0 -60
- data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +0 -703
- data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +0 -47
- data/lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb +0 -37
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb +0 -62
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb +0 -17
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb +0 -115
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb +0 -48
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb +0 -17
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb +0 -60
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb +0 -71
- data/lib/bandwidth/web_rtc_lib/web_rtc.rb +0 -22
- data/lib/bandwidth.rb +0 -73
- data/test/controllers/controller_test_base.rb +0 -21
- data/test/http_response_catcher.rb +0 -19
- data/test/integration/test_integration.rb +0 -691
- data/test/test_helper.rb +0 -94
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Integration Tests for Bandwidth::MFAApi
|
|
2
|
+
describe 'MFAApi Integration Tests' do
|
|
3
|
+
# mfa info
|
|
4
|
+
let(:message) { 'Your temporary {NAME} {SCOPE} code is: {CODE}' }
|
|
5
|
+
let(:digits) { 6 }
|
|
6
|
+
|
|
7
|
+
before(:all) do
|
|
8
|
+
WebMock.allow_net_connect!
|
|
9
|
+
Bandwidth.configure do |config|
|
|
10
|
+
config.username = BW_USERNAME
|
|
11
|
+
config.password = BW_PASSWORD
|
|
12
|
+
end
|
|
13
|
+
@mfa_api_instance = Bandwidth::MFAApi.new
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
after(:all) do
|
|
17
|
+
WebMock.disable_net_connect!
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Messaging Authentication Code
|
|
21
|
+
describe 'generate_messaging_code' do
|
|
22
|
+
it 'generates messaging mfa code' do
|
|
23
|
+
req_schema = Bandwidth::CodeRequest.new(
|
|
24
|
+
to: USER_NUMBER,
|
|
25
|
+
from: BW_NUMBER,
|
|
26
|
+
application_id: BW_MESSAGING_APPLICATION_ID,
|
|
27
|
+
message: message,
|
|
28
|
+
digits: digits
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
data, status_code, headers = @mfa_api_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema)
|
|
32
|
+
|
|
33
|
+
expect(status_code).to eq(200)
|
|
34
|
+
expect(data).to be_instance_of(Bandwidth::MessagingCodeResponse)
|
|
35
|
+
expect(data.message_id.length).to eq(29)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Voice Authentication Code
|
|
40
|
+
describe 'generate_voice_code' do
|
|
41
|
+
it 'generates voice mfa code' do
|
|
42
|
+
req_schema = Bandwidth::CodeRequest.new(
|
|
43
|
+
to: USER_NUMBER,
|
|
44
|
+
from: BW_NUMBER,
|
|
45
|
+
application_id: BW_VOICE_APPLICATION_ID,
|
|
46
|
+
message: message,
|
|
47
|
+
digits: digits
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
data, status_code, headers = @mfa_api_instance.generate_voice_code_with_http_info(BW_ACCOUNT_ID, req_schema)
|
|
51
|
+
|
|
52
|
+
expect(status_code).to eq(200)
|
|
53
|
+
expect(data).to be_instance_of(Bandwidth::VoiceCodeResponse)
|
|
54
|
+
expect(data.call_id.length).to eq(47)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Verify Authentication Code
|
|
59
|
+
describe 'verify_code' do
|
|
60
|
+
it 'verifies mfa code' do
|
|
61
|
+
req_schema = Bandwidth::VerifyCodeRequest.new(
|
|
62
|
+
to: '+1000' + rand(1...10000000).to_s,
|
|
63
|
+
scope: '2FA',
|
|
64
|
+
expiration_time_in_minutes: 3,
|
|
65
|
+
code: '12345'
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
data, status_code, headers = @mfa_api_instance.verify_code_with_http_info(BW_ACCOUNT_ID, req_schema)
|
|
69
|
+
|
|
70
|
+
expect(status_code).to eq(200)
|
|
71
|
+
expect(data).to be_instance_of(Bandwidth::VerifyCodeResponse)
|
|
72
|
+
expect(data.valid).to be false
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# HTTP 4XX Errors
|
|
77
|
+
describe 'http error' do
|
|
78
|
+
it 'causes a 400 error' do
|
|
79
|
+
req_schema = Bandwidth::CodeRequest.new(
|
|
80
|
+
to: USER_NUMBER,
|
|
81
|
+
from: BW_NUMBER,
|
|
82
|
+
application_id: 'not_an_application_id',
|
|
83
|
+
message: message,
|
|
84
|
+
digits: digits
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
expect {
|
|
88
|
+
@mfa_api_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema)
|
|
89
|
+
}.to raise_error { |e|
|
|
90
|
+
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
91
|
+
expect(e.code).to eq(400)
|
|
92
|
+
}
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
it 'causes a 403 error' do
|
|
96
|
+
Bandwidth.configure do |config|
|
|
97
|
+
config.username = UNAUTHORIZED_USERNAME
|
|
98
|
+
config.password = UNAUTHORIZED_PASSWORD
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
req_schema = Bandwidth::CodeRequest.new(
|
|
102
|
+
to: USER_NUMBER,
|
|
103
|
+
from: BW_NUMBER,
|
|
104
|
+
application_id: BW_MESSAGING_APPLICATION_ID,
|
|
105
|
+
message: message,
|
|
106
|
+
digits: digits
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
expect {
|
|
110
|
+
@mfa_api_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema)
|
|
111
|
+
}.to raise_error { |e|
|
|
112
|
+
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
113
|
+
expect(e.code).to eq(403)
|
|
114
|
+
}
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Integration Tests for Bandwidth::PhoneNumberLookupApi
|
|
2
|
+
describe 'PhoneNumberLookupApi Integration Tests' do
|
|
3
|
+
before(:all) do
|
|
4
|
+
WebMock.allow_net_connect!
|
|
5
|
+
Bandwidth.configure do |config|
|
|
6
|
+
config.username = BW_USERNAME
|
|
7
|
+
config.password = BW_PASSWORD
|
|
8
|
+
end
|
|
9
|
+
@api_instance_tnlookup = Bandwidth::PhoneNumberLookupApi.new
|
|
10
|
+
|
|
11
|
+
# lookup info
|
|
12
|
+
$lookup_request_id = ''
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
after(:all) do
|
|
16
|
+
WebMock.disable_net_connect!
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Create Lookup
|
|
20
|
+
describe 'create_lookup' do
|
|
21
|
+
it 'creates a tn lookup request' do
|
|
22
|
+
tn_body = Bandwidth::LookupRequest.new(
|
|
23
|
+
tns: [BW_NUMBER]
|
|
24
|
+
)
|
|
25
|
+
data, status_code, headers = @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body)
|
|
26
|
+
|
|
27
|
+
expect(status_code).to eq(202)
|
|
28
|
+
expect(data).to be_instance_of(Bandwidth::CreateLookupResponse)
|
|
29
|
+
expect(data.request_id.length).to eq(36)
|
|
30
|
+
expect(data.status).to be_instance_of(String)
|
|
31
|
+
|
|
32
|
+
$lookup_request_id = data.request_id
|
|
33
|
+
sleep(1)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Get Lookup Status
|
|
38
|
+
describe 'get_lookup_status' do
|
|
39
|
+
it 'gets lookup status' do
|
|
40
|
+
data, status_code, headers = @api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, $lookup_request_id)
|
|
41
|
+
|
|
42
|
+
expect(status_code).to eq(200)
|
|
43
|
+
expect(data).to be_instance_of(Bandwidth::LookupStatus)
|
|
44
|
+
expect(data.request_id).to eq($lookup_request_id)
|
|
45
|
+
expect(data.status).to be_instance_of(String)
|
|
46
|
+
expect(data.result).to be_instance_of(Array)
|
|
47
|
+
expect(data.result[0].response_code).to be_instance_of(Integer)
|
|
48
|
+
expect(data.result[0].e_164_format).to eq(BW_NUMBER)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# HTTP 4XX Errors
|
|
53
|
+
describe 'http error' do
|
|
54
|
+
it 'causes a 400 error' do
|
|
55
|
+
tn_body_bad = Bandwidth::LookupRequest.new(
|
|
56
|
+
tns: ['+1invalid']
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
expect {
|
|
60
|
+
@api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body_bad)
|
|
61
|
+
}.to raise_error { |e|
|
|
62
|
+
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
63
|
+
expect(e.code).to eq(400)
|
|
64
|
+
}
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
it 'causes a 404 error' do
|
|
68
|
+
req_id_dne = '12345678-abcd-cdef-9876-12345678abcd'
|
|
69
|
+
|
|
70
|
+
expect {
|
|
71
|
+
@api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, req_id_dne)
|
|
72
|
+
}.to raise_error { |e|
|
|
73
|
+
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
74
|
+
expect(e.code).to eq(404)
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
it 'causes a 401 error' do
|
|
79
|
+
Bandwidth.configure do |config|
|
|
80
|
+
config.username = UNAUTHORIZED_USERNAME
|
|
81
|
+
config.password = UNAUTHORIZED_PASSWORD
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
tn_body = Bandwidth::LookupRequest.new(
|
|
85
|
+
tns: [BW_NUMBER]
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
expect {
|
|
89
|
+
@api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body)
|
|
90
|
+
}.to raise_error { |e|
|
|
91
|
+
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
92
|
+
expect(e.code).to eq(401)
|
|
93
|
+
}
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
require_relative '../call_utils'
|
|
2
|
+
|
|
3
|
+
# Integration Tests for Bandwidth::RecordingsApi
|
|
4
|
+
describe 'RecordingsApi Integration Tests' do
|
|
5
|
+
before(:all) do
|
|
6
|
+
WebMock.allow_net_connect!
|
|
7
|
+
Bandwidth.configure do |config|
|
|
8
|
+
config.username = BW_USERNAME
|
|
9
|
+
config.password = BW_PASSWORD
|
|
10
|
+
config.return_binary_data = true
|
|
11
|
+
end
|
|
12
|
+
@recordings_api_instance = Bandwidth::RecordingsApi.new
|
|
13
|
+
@calls_api_instance = Bandwidth::CallsApi.new
|
|
14
|
+
|
|
15
|
+
# recording info
|
|
16
|
+
$manteca_test_id = setup_manteca('CALL')
|
|
17
|
+
$manteca_call_id = create_manteca_call($manteca_test_id, '/bxml/startLongRecording', @calls_api_instance)
|
|
18
|
+
$recording_id = ''
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
after(:all) do
|
|
22
|
+
WebMock.disable_net_connect!
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Update Recording
|
|
26
|
+
describe 'update_call_recording_state' do
|
|
27
|
+
it 'updates and ends the manteca call recording' do
|
|
28
|
+
pause_recording = Bandwidth::UpdateCallRecording.new(
|
|
29
|
+
state: Bandwidth::RecordingStateEnum::PAUSED
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
start_recording = Bandwidth::UpdateCallRecording.new(
|
|
33
|
+
state: Bandwidth::RecordingStateEnum::RECORDING
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
sleep(SLEEP_TIME_S * 2)
|
|
37
|
+
pause_data, pause_status_code, pause_headers = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, pause_recording)
|
|
38
|
+
expect(pause_status_code).to eq(200)
|
|
39
|
+
|
|
40
|
+
sleep(SLEEP_TIME_S)
|
|
41
|
+
record_data, record_status_code, record_headers = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, start_recording)
|
|
42
|
+
expect(record_status_code).to eq(200)
|
|
43
|
+
|
|
44
|
+
complete_data, complete_status_code, complete_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $complete_call_body)
|
|
45
|
+
expect(complete_status_code).to eq(200)
|
|
46
|
+
|
|
47
|
+
retries = 0
|
|
48
|
+
recording_complete = false
|
|
49
|
+
begin
|
|
50
|
+
while !recording_complete && retries < MAX_RETRIES
|
|
51
|
+
recording_complete = get_manteca_test_status($manteca_test_id)['callRecorded']
|
|
52
|
+
retries += 1
|
|
53
|
+
sleep(SLEEP_TIME_S)
|
|
54
|
+
end
|
|
55
|
+
rescue => e
|
|
56
|
+
puts e.inspect
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
expect(recording_complete).to be true
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Get Call Recordings
|
|
64
|
+
describe 'list_account_call_recordings' do
|
|
65
|
+
it 'lists account call recordings' do
|
|
66
|
+
data, status_code, headers = @recordings_api_instance.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID)
|
|
67
|
+
|
|
68
|
+
expect(status_code).to eq(200)
|
|
69
|
+
expect(data).to be_instance_of(Array)
|
|
70
|
+
expect(data[0]).to be_instance_of(Bandwidth::CallRecordingMetadata)
|
|
71
|
+
expect(data[0].application_id).to be_instance_of(String)
|
|
72
|
+
expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# List Call Recordings
|
|
77
|
+
describe 'list_call_recordings' do
|
|
78
|
+
it 'lists all recordings for a single call' do
|
|
79
|
+
data, status_code, headers = @recordings_api_instance.list_call_recordings_with_http_info(BW_ACCOUNT_ID, $manteca_call_id)
|
|
80
|
+
|
|
81
|
+
expect(status_code).to eq(200)
|
|
82
|
+
expect(data).to be_instance_of(Array)
|
|
83
|
+
expect(data[0]).to be_instance_of(Bandwidth::CallRecordingMetadata)
|
|
84
|
+
expect(data[0].application_id).to eq(MANTECA_APPLICATION_ID)
|
|
85
|
+
expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
|
|
86
|
+
expect(data[0].call_id).to eq($manteca_call_id)
|
|
87
|
+
expect(data[0].recording_id).to be_instance_of(String)
|
|
88
|
+
expect(data[0].status).to eq('complete').or eq('partial')
|
|
89
|
+
|
|
90
|
+
$recording_id = data[0].recording_id
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Get Call Recording
|
|
95
|
+
describe 'get_call_recording' do
|
|
96
|
+
it 'gets a call recording by id' do
|
|
97
|
+
data, status_code, headers = @recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
|
98
|
+
|
|
99
|
+
expect(status_code).to eq(200)
|
|
100
|
+
expect(data).to be_instance_of(Bandwidth::CallRecordingMetadata)
|
|
101
|
+
expect(data.application_id).to eq(MANTECA_APPLICATION_ID)
|
|
102
|
+
expect(data.account_id).to eq(BW_ACCOUNT_ID)
|
|
103
|
+
expect(data.call_id).to eq($manteca_call_id)
|
|
104
|
+
expect(data.status).to eq('complete').or eq('partial')
|
|
105
|
+
expect(data.recording_id).to eq($recording_id)
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Download Recording
|
|
110
|
+
describe 'download_call_recording' do
|
|
111
|
+
it 'downloads a call recording by id' do
|
|
112
|
+
data, status_code, headers = @recordings_api_instance.download_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
|
113
|
+
|
|
114
|
+
expect(status_code).to eq(200)
|
|
115
|
+
expect(data).to be_instance_of(String)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Create Transcription Request
|
|
120
|
+
describe 'transcribe_call_recording' do
|
|
121
|
+
it 'creates a transcription request' do
|
|
122
|
+
transcribe_recording = Bandwidth::TranscribeRecording.new(
|
|
123
|
+
callback_url: MANTECA_BASE_URL + '/transcriptions',
|
|
124
|
+
tag: $manteca_test_id
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
data, status_code, headers = @recordings_api_instance.transcribe_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id, transcribe_recording)
|
|
128
|
+
expect(status_code).to eq(204)
|
|
129
|
+
|
|
130
|
+
retries = 0
|
|
131
|
+
transcription_complete = false
|
|
132
|
+
sleep(SLEEP_TIME_S * 10)
|
|
133
|
+
begin
|
|
134
|
+
while !transcription_complete && retries < MAX_RETRIES
|
|
135
|
+
transcription_complete = get_manteca_test_status($manteca_test_id)['callTranscribed']
|
|
136
|
+
retries += 1
|
|
137
|
+
sleep(SLEEP_TIME_S)
|
|
138
|
+
end
|
|
139
|
+
rescue => e
|
|
140
|
+
puts e.inspect
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
expect(transcription_complete).to be true
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Get Transcription
|
|
148
|
+
describe 'get_call_transcription' do
|
|
149
|
+
it 'gets the completed call recording transcription' do
|
|
150
|
+
data, status_code, headers = @recordings_api_instance.get_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
|
151
|
+
|
|
152
|
+
expect(status_code).to eq(200)
|
|
153
|
+
expect(data).to be_instance_of(Bandwidth::TranscriptionList)
|
|
154
|
+
expect(data.transcripts).to be_instance_of(Array)
|
|
155
|
+
expect(data.transcripts[0]).to be_instance_of(Bandwidth::Transcription)
|
|
156
|
+
expect(data.transcripts[0].text).to be_instance_of(String)
|
|
157
|
+
expect(data.transcripts[0].confidence).to be_instance_of(Float)
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Delete Transcription
|
|
162
|
+
describe 'delete_call_transcription' do
|
|
163
|
+
it 'deletes the completed call recording transcription' do
|
|
164
|
+
data, status_code, headers = @recordings_api_instance.delete_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
|
165
|
+
expect(status_code).to eq(204)
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Delete Recording Media
|
|
170
|
+
describe 'delete_recording_media' do
|
|
171
|
+
it 'deletes the completed call recording media' do
|
|
172
|
+
data, status_code, headers = @recordings_api_instance.delete_recording_media_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
|
173
|
+
expect(status_code).to eq(204)
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Delete Recording
|
|
178
|
+
describe 'delete_recording' do
|
|
179
|
+
it 'deletes the completed call recording data' do
|
|
180
|
+
data, status_code, headers = @recordings_api_instance.delete_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
|
181
|
+
expect(status_code).to eq(204)
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# HTTP 4XX Errors
|
|
186
|
+
describe 'http error' do
|
|
187
|
+
it 'causes a 404 error' do
|
|
188
|
+
dne_id = 'does-not-exist'
|
|
189
|
+
|
|
190
|
+
expect {
|
|
191
|
+
@recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, dne_id, dne_id)
|
|
192
|
+
}.to raise_error { |e|
|
|
193
|
+
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
194
|
+
expect(e.code).to eq(404)
|
|
195
|
+
}
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
it 'causes a 401 error' do
|
|
199
|
+
Bandwidth.configure do |config|
|
|
200
|
+
config.username = UNAUTHORIZED_USERNAME
|
|
201
|
+
config.password = UNAUTHORIZED_PASSWORD
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
expect {
|
|
205
|
+
@recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
|
206
|
+
}.to raise_error { |e|
|
|
207
|
+
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
208
|
+
expect(e.code).to eq(401)
|
|
209
|
+
}
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
it 'causes a 403 error' do
|
|
213
|
+
Bandwidth.configure do |config|
|
|
214
|
+
config.username = FORBIDDEN_USERNAME
|
|
215
|
+
config.password = FORBIDDEN_PASSWORD
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
expect {
|
|
219
|
+
@recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
|
220
|
+
}.to raise_error { |e|
|
|
221
|
+
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
222
|
+
expect(e.code).to eq(403)
|
|
223
|
+
}
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Integration Tests for Bandwidth::StatisticsApi
|
|
2
|
+
describe 'StatisticsApi Integration Tests' do
|
|
3
|
+
before(:all) do
|
|
4
|
+
WebMock.allow_net_connect!
|
|
5
|
+
Bandwidth.configure do |config|
|
|
6
|
+
config.username = BW_USERNAME
|
|
7
|
+
config.password = BW_PASSWORD
|
|
8
|
+
end
|
|
9
|
+
@statistics_api_instance = Bandwidth::StatisticsApi.new
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
after(:all) do
|
|
13
|
+
WebMock.disable_net_connect!
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Get Account Statistics
|
|
17
|
+
describe 'get_statistics' do
|
|
18
|
+
it 'gets account statistics' do
|
|
19
|
+
data, status_code, headers = @statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID)
|
|
20
|
+
|
|
21
|
+
expect(status_code).to eq(200)
|
|
22
|
+
expect(data).to be_instance_of(Bandwidth::AccountStatistics)
|
|
23
|
+
expect(data.current_call_queue_size).to be_instance_of(Integer)
|
|
24
|
+
expect(data.max_call_queue_size).to eq(7500)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# HTTP 4XX Errors
|
|
29
|
+
describe 'http error' do
|
|
30
|
+
it 'causes a 401 error' do
|
|
31
|
+
Bandwidth.configure do |config|
|
|
32
|
+
config.username = UNAUTHORIZED_USERNAME
|
|
33
|
+
config.password = UNAUTHORIZED_PASSWORD
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
expect {
|
|
37
|
+
@statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID)
|
|
38
|
+
}.to raise_error { |e|
|
|
39
|
+
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
40
|
+
expect(e.code).to eq(401)
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it 'causes a 403 error' do
|
|
45
|
+
Bandwidth.configure do |config|
|
|
46
|
+
config.username = FORBIDDEN_USERNAME
|
|
47
|
+
config.password = FORBIDDEN_PASSWORD
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
expect {
|
|
51
|
+
@statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID)
|
|
52
|
+
}.to raise_error { |e|
|
|
53
|
+
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
54
|
+
expect(e.code).to eq(403)
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Unit tests for Bandwidth::Bxml::Bxml
|
|
2
|
+
describe 'Bandwidth::Bxml::Bxml' do
|
|
3
|
+
let(:instance) { Bandwidth::Bxml::Bxml.new }
|
|
4
|
+
|
|
5
|
+
describe 'test an instance of Bxml' do
|
|
6
|
+
it 'validates instance of Bxml' do
|
|
7
|
+
expect(instance).to be_instance_of(Bandwidth::Bxml::Bxml)
|
|
8
|
+
expect(instance).to be_a(Bandwidth::Bxml::Root)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'test the to_bxml method of the Bxml instance' do
|
|
12
|
+
expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bxml/>\n"
|
|
13
|
+
expect(instance.to_bxml).to eq(expected)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Unit tests for Bandwidth::Bxml::NestableVerb
|
|
2
|
+
describe 'Bandwidth::Bxml::NestableVerb' do
|
|
3
|
+
let(:instance) { Bandwidth::Bxml::NestableVerb.new('Test') }
|
|
4
|
+
|
|
5
|
+
describe 'test an instance of NestableVerb' do
|
|
6
|
+
it 'validates instance of NestableVerb' do
|
|
7
|
+
expect(instance).to be_a(Bandwidth::Bxml::NestableVerb)
|
|
8
|
+
expect(instance).to be_a(Bandwidth::Bxml::Verb)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Unit tests for Bandwidth::Bxml::Response
|
|
2
|
+
describe 'Bandwidth::Bxml::Response' do
|
|
3
|
+
let(:instance) { Bandwidth::Bxml::Response.new }
|
|
4
|
+
|
|
5
|
+
describe 'test an instance of Response' do
|
|
6
|
+
it 'validates instance of Response' do
|
|
7
|
+
expect(instance).to be_instance_of(Bandwidth::Bxml::Response)
|
|
8
|
+
expect(instance).to be_a(Bandwidth::Bxml::Root)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'test the to_bxml method of the Response instance' do
|
|
12
|
+
expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response/>\n"
|
|
13
|
+
expect(instance.to_bxml).to eq(expected)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Unit tests for Bandwidth::Bxml::Verb
|
|
2
|
+
describe 'Bandwidth::Bxml::Verb' do
|
|
3
|
+
let(:instance) { Bandwidth::Bxml::Verb.new('Test') }
|
|
4
|
+
|
|
5
|
+
describe 'test an instance of Verb' do
|
|
6
|
+
it 'validates instance of Verb' do
|
|
7
|
+
expect(instance).to be_a(Bandwidth::Bxml::Verb)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it 'tests the to_bxml method of the Verb instance' do
|
|
11
|
+
expected = "\n<Test/>\n"
|
|
12
|
+
expect(instance.to_bxml).to eq(expected)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Unit tests for Bandwidth::Bxml::Bridge
|
|
2
|
+
describe 'Bandwidth::Bxml::Bridge' do
|
|
3
|
+
let(:initial_attributes) {
|
|
4
|
+
{
|
|
5
|
+
bridge_complete_url: 'https://initial.com',
|
|
6
|
+
bridge_complete_method: 'POST',
|
|
7
|
+
bridge_complete_fallback_url: 'https://initial.com',
|
|
8
|
+
bridge_complete_fallback_method: 'POST',
|
|
9
|
+
bridge_target_complete_url: 'https://initial.com',
|
|
10
|
+
bridge_target_complete_method: 'POST',
|
|
11
|
+
bridge_target_complete_fallback_url: 'https://initial.com',
|
|
12
|
+
bridge_target_complete_fallback_method: 'POST',
|
|
13
|
+
username: 'initial_username',
|
|
14
|
+
password: 'initial_password',
|
|
15
|
+
fallback_username: 'initial_fallback_username',
|
|
16
|
+
fallback_password: 'initial_fallback_password',
|
|
17
|
+
tag: 'initial_tag'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let(:new_attributes) {
|
|
22
|
+
{
|
|
23
|
+
bridge_complete_url: 'https://new.com',
|
|
24
|
+
bridge_complete_method: 'GET',
|
|
25
|
+
bridge_complete_fallback_url: 'https://new.com',
|
|
26
|
+
bridge_complete_fallback_method: 'GET',
|
|
27
|
+
bridge_target_complete_url: 'https://new.com',
|
|
28
|
+
bridge_target_complete_method: 'GET',
|
|
29
|
+
bridge_target_complete_fallback_url: 'https://new.com',
|
|
30
|
+
bridge_target_complete_fallback_method: 'GET',
|
|
31
|
+
username: 'new_username',
|
|
32
|
+
password: 'new_password',
|
|
33
|
+
fallback_username: 'new_fallback_username',
|
|
34
|
+
fallback_password: 'new_fallback_password',
|
|
35
|
+
tag: 'new_tag'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let(:instance) { Bandwidth::Bxml::Bridge.new('c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', initial_attributes) }
|
|
40
|
+
|
|
41
|
+
describe 'test an instance of Bridge' do
|
|
42
|
+
it 'validates instance of Bridge' do
|
|
43
|
+
expect(instance).to be_instance_of(Bandwidth::Bxml::Bridge)
|
|
44
|
+
expect(instance).to be_a(Bandwidth::Bxml::Verb)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
it 'tests the to_bxml method of the Bridge instance' do
|
|
48
|
+
expected = "\n<Bridge bridgeCompleteUrl=\"https://initial.com\" bridgeCompleteMethod=\"POST\" bridgeCompleteFallbackUrl=\"https://initial.com\" bridgeCompleteFallbackMethod=\"POST\" bridgeTargetCompleteUrl=\"https://initial.com\" bridgeTargetCompleteMethod=\"POST\" bridgeTargetCompleteFallbackUrl=\"https://initial.com\" bridgeTargetCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\">c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d</Bridge>\n"
|
|
49
|
+
expect(instance.to_bxml).to eq(expected)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it 'tests the set_attributes method of the Bridge instance' do
|
|
53
|
+
instance.set_attributes(new_attributes)
|
|
54
|
+
expected = "\n<Bridge bridgeCompleteUrl=\"https://new.com\" bridgeCompleteMethod=\"GET\" bridgeCompleteFallbackUrl=\"https://new.com\" bridgeCompleteFallbackMethod=\"GET\" bridgeTargetCompleteUrl=\"https://new.com\" bridgeTargetCompleteMethod=\"GET\" bridgeTargetCompleteFallbackUrl=\"https://new.com\" bridgeTargetCompleteFallbackMethod=\"GET\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\">c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d</Bridge>\n"
|
|
55
|
+
expect(instance.to_bxml).to eq(expected)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Unit tests for Bandwidth::Bxml::Conference
|
|
2
|
+
describe 'Bandwidth::Bxml::Conference' do
|
|
3
|
+
let(:initial_attributes) {
|
|
4
|
+
{
|
|
5
|
+
mute: true,
|
|
6
|
+
hold: true,
|
|
7
|
+
call_ids_to_coach: 'initial',
|
|
8
|
+
conference_event_url: 'https://initial.com',
|
|
9
|
+
conference_event_method: 'POST',
|
|
10
|
+
conference_event_fallback_url: 'https://initial.com',
|
|
11
|
+
conference_event_fallback_method: 'POST',
|
|
12
|
+
username: 'initial_username',
|
|
13
|
+
password: 'initial_password',
|
|
14
|
+
fallback_username: 'initial_fallback_username',
|
|
15
|
+
fallback_password: 'initial_fallback_password',
|
|
16
|
+
tag: 'initial_tag',
|
|
17
|
+
callback_timeout: 5.0
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let(:new_attributes) {
|
|
22
|
+
{
|
|
23
|
+
mute: false,
|
|
24
|
+
hold: false,
|
|
25
|
+
call_ids_to_coach: 'new',
|
|
26
|
+
conference_event_url: 'https://new.com',
|
|
27
|
+
conference_event_method: 'GET',
|
|
28
|
+
conference_event_fallback_url: 'https://new.com',
|
|
29
|
+
conference_event_fallback_method: 'GET',
|
|
30
|
+
username: 'new_username',
|
|
31
|
+
password: 'new_password',
|
|
32
|
+
fallback_username: 'new_fallback_username',
|
|
33
|
+
fallback_password: 'new_fallback_password',
|
|
34
|
+
tag: 'new_tag',
|
|
35
|
+
callback_timeout: 10.0
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let(:instance) { Bandwidth::Bxml::Conference.new('conference_name', initial_attributes) }
|
|
40
|
+
|
|
41
|
+
describe 'test an instance of Conference' do
|
|
42
|
+
it 'validates instance of Conference' do
|
|
43
|
+
expect(instance).to be_instance_of(Bandwidth::Bxml::Conference)
|
|
44
|
+
expect(instance).to be_a(Bandwidth::Bxml::Verb)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
it 'tests the to_bxml method of the Conference instance' do
|
|
48
|
+
expected = "\n<Conference mute=\"true\" hold=\"true\" callIdsToCoach=\"initial\" conferenceEventUrl=\"https://initial.com\" conferenceEventMethod=\"POST\" conferenceEventFallbackUrl=\"https://initial.com\" conferenceEventFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" callbackTimeout=\"5.0\">conference_name</Conference>\n"
|
|
49
|
+
expect(instance.to_bxml).to eq(expected)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it 'tests the set_attributes method of the Conference instance' do
|
|
53
|
+
instance.set_attributes(new_attributes)
|
|
54
|
+
expected = "\n<Conference mute=\"false\" hold=\"false\" callIdsToCoach=\"new\" conferenceEventUrl=\"https://new.com\" conferenceEventMethod=\"GET\" conferenceEventFallbackUrl=\"https://new.com\" conferenceEventFallbackMethod=\"GET\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\" callbackTimeout=\"10.0\">conference_name</Conference>\n"
|
|
55
|
+
expect(instance.to_bxml).to eq(expected)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|