bandwidth-sdk 11.0.0.pre.beta.1 → 11.0.0.pre.beta.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/Gemfile.lock +46 -23
- data/README.md +7 -3
- data/Rakefile +10 -2
- data/bandwidth-sdk.gemspec +12 -12
- data/bandwidth.yml +409 -353
- data/coverage/.last_run.json +5 -0
- data/coverage/.resultset.json +9792 -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 +108612 -0
- data/custom_templates/Gemfile.mustache +11 -0
- data/custom_templates/README.mustache +170 -0
- data/custom_templates/gem.mustache +99 -0
- data/custom_templates/gemspec.mustache +37 -0
- data/custom_templates/version.mustache +7 -0
- data/docs/AnswerCallback.md +3 -3
- data/docs/BridgeCompleteCallback.md +2 -2
- data/docs/BridgeTargetCompleteCallback.md +2 -2
- data/docs/CallState.md +2 -2
- data/docs/CallsApi.md +15 -15
- data/docs/Conference.md +4 -4
- data/docs/ConferenceCompletedCallback.md +2 -2
- data/docs/ConferenceCreatedCallback.md +2 -2
- data/docs/ConferenceMemberExitCallback.md +2 -2
- data/docs/ConferenceMemberJoinCallback.md +2 -2
- data/docs/ConferenceRecordingAvailableCallback.md +2 -2
- data/docs/ConferenceRedirectCallback.md +2 -2
- data/docs/ConferencesApi.md +42 -42
- data/docs/CreateCall.md +11 -11
- data/docs/CreateCallResponse.md +11 -11
- data/docs/DisconnectCallback.md +2 -2
- data/docs/DtmfCallback.md +2 -2
- data/docs/GatherCallback.md +2 -2
- data/docs/InitiateCallback.md +2 -2
- data/docs/ListMessageItem.md +5 -3
- data/docs/MFAApi.md +6 -6
- data/docs/MachineDetectionCompleteCallback.md +3 -3
- data/docs/MachineDetectionConfiguration.md +2 -2
- data/docs/MachineDetectionResult.md +20 -0
- data/docs/Message.md +5 -3
- data/docs/MessageDeliveredCallbackMessage.md +1 -1
- data/docs/MessageFailedCallbackMessage.md +1 -1
- data/docs/MessageRequest.md +1 -1
- data/docs/MessageSendingCallbackMessage.md +1 -1
- data/docs/MessagesApi.md +5 -1
- data/docs/MessagesList.md +1 -1
- data/docs/PhoneNumberLookupApi.md +4 -4
- data/docs/RecordingAvailableCallback.md +2 -2
- data/docs/RecordingCompleteCallback.md +2 -2
- data/docs/RecordingsApi.md +52 -52
- data/docs/RedirectCallback.md +2 -2
- data/docs/StatisticsApi.md +2 -2
- data/docs/TranscribeRecording.md +4 -2
- data/docs/TranscriptionAvailableCallback.md +2 -2
- data/docs/TransferAnswerCallback.md +2 -2
- data/docs/TransferCompleteCallback.md +2 -2
- data/docs/TransferDisconnectCallback.md +2 -2
- data/docs/UpdateCall.md +3 -3
- data/docs/UpdateConference.md +3 -3
- data/lib/bandwidth-sdk/api/calls_api.rb +18 -18
- data/lib/bandwidth-sdk/api/conferences_api.rb +46 -46
- data/lib/bandwidth-sdk/api/media_api.rb +2 -2
- data/lib/bandwidth-sdk/api/messages_api.rb +8 -2
- data/lib/bandwidth-sdk/api/mfa_api.rb +10 -10
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +6 -6
- data/lib/bandwidth-sdk/api/recordings_api.rb +55 -55
- data/lib/bandwidth-sdk/api/statistics_api.rb +3 -3
- data/lib/bandwidth-sdk/api_client.rb +1 -1
- data/lib/bandwidth-sdk/api_error.rb +2 -2
- data/lib/bandwidth-sdk/configuration.rb +3 -3
- data/lib/bandwidth-sdk/models/account_statistics.rb +2 -4
- data/lib/bandwidth-sdk/models/answer_callback.rb +4 -7
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/bxml/bxml.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/nestable_verb.rb +3 -7
- data/lib/bandwidth-sdk/models/bxml/response.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/root.rb +3 -3
- data/lib/bandwidth-sdk/models/bxml/verb.rb +4 -5
- data/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/conference.rb +2 -5
- data/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb +16 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/forward.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +3 -5
- data/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/pause.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/record.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/ring.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb +3 -5
- data/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +29 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb +15 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/tag.rb +2 -4
- data/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +2 -4
- data/lib/bandwidth-sdk/models/call_direction_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +2 -4
- data/lib/bandwidth-sdk/models/call_state.rb +4 -6
- data/lib/bandwidth-sdk/models/call_state_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/callback_method_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/code_request.rb +2 -4
- data/lib/bandwidth-sdk/models/conference.rb +5 -7
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/conference_member.rb +2 -4
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +2 -4
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/conference_state_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/create_call.rb +14 -7
- data/lib/bandwidth-sdk/models/create_call_response.rb +10 -12
- data/lib/bandwidth-sdk/models/create_lookup_response.rb +2 -4
- data/lib/bandwidth-sdk/models/create_message_request_error.rb +2 -4
- data/lib/bandwidth-sdk/models/deferred_result.rb +2 -4
- data/lib/bandwidth-sdk/models/disconenct_callback.rb +1 -3
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/diversion.rb +2 -4
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/field_error.rb +2 -4
- data/lib/bandwidth-sdk/models/file_format_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/gather_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/inbound_message_callback.rb +2 -4
- data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +3 -4
- data/lib/bandwidth-sdk/models/initiate_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/list_message_item.rb +19 -10
- data/lib/bandwidth-sdk/models/lookup_request.rb +2 -4
- data/lib/bandwidth-sdk/models/lookup_result.rb +2 -4
- data/lib/bandwidth-sdk/models/lookup_status.rb +2 -4
- data/lib/bandwidth-sdk/models/lookup_status_enum.rb +5 -5
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +4 -7
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +2 -4
- data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/machine_detection_result.rb +229 -0
- data/lib/bandwidth-sdk/models/media.rb +2 -4
- data/lib/bandwidth-sdk/models/message.rb +17 -9
- data/lib/bandwidth-sdk/models/message_delivered_callback.rb +2 -4
- data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +3 -4
- data/lib/bandwidth-sdk/models/message_direction_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/message_failed_callback.rb +2 -4
- data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +3 -4
- data/lib/bandwidth-sdk/models/message_request.rb +4 -6
- data/lib/bandwidth-sdk/models/message_sending_callback.rb +2 -4
- data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +3 -4
- data/lib/bandwidth-sdk/models/message_status_enum.rb +9 -9
- data/lib/bandwidth-sdk/models/message_type_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/messages_list.rb +3 -5
- data/lib/bandwidth-sdk/models/messaging_code_response.rb +2 -4
- data/lib/bandwidth-sdk/models/messaging_request_error.rb +2 -4
- data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +2 -4
- data/lib/bandwidth-sdk/models/mfa_request_error.rb +2 -4
- data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +2 -4
- data/lib/bandwidth-sdk/models/page_info.rb +2 -4
- data/lib/bandwidth-sdk/models/priority_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/recording_state_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/redirect_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/redirect_method_enum.rb +3 -3
- data/lib/bandwidth-sdk/models/stir_shaken.rb +2 -4
- data/lib/bandwidth-sdk/models/tag.rb +2 -4
- data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +2 -4
- data/lib/bandwidth-sdk/models/transcribe_recording.rb +20 -9
- data/lib/bandwidth-sdk/models/transcription.rb +2 -4
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/transcription_list.rb +2 -4
- data/lib/bandwidth-sdk/models/transcription_metadata.rb +2 -4
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +3 -5
- data/lib/bandwidth-sdk/models/update_call.rb +12 -5
- data/lib/bandwidth-sdk/models/update_call_recording.rb +2 -4
- data/lib/bandwidth-sdk/models/update_conference.rb +3 -5
- data/lib/bandwidth-sdk/models/update_conference_member.rb +2 -4
- data/lib/bandwidth-sdk/models/verify_code_request.rb +2 -4
- data/lib/bandwidth-sdk/models/verify_code_response.rb +2 -4
- data/lib/bandwidth-sdk/models/voice_api_error.rb +2 -4
- data/lib/bandwidth-sdk/models/voice_code_response.rb +2 -4
- data/lib/bandwidth-sdk/version.rb +2 -2
- data/lib/bandwidth-sdk.rb +5 -1
- data/openapi-config.yml +1 -0
- data/openapitools.json +7 -0
- data/ruby-notes.md +11 -60
- data/spec/api/calls_api_spec.rb +228 -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 +28 -28
- data/spec/configuration_spec.rb +178 -0
- data/spec/integration/calls_api_integration_spec.rb +88 -69
- data/spec/integration/conferences_api_integration_spec.rb +74 -68
- data/spec/integration/media_api_integration_spec.rb +38 -32
- data/spec/integration/messages_api_integration_spec.rb +79 -38
- data/spec/integration/mfa_api_integration_spec.rb +41 -33
- data/spec/integration/phone_number_lookup_api_integration_spec.rb +26 -22
- data/spec/integration/recordings_api_integration_spec.rb +84 -77
- data/spec/integration/statistics_api_integration_spec.rb +15 -14
- data/spec/{unit/models → models}/bxml/bxml_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/nestable_verb_spec.rb +1 -3
- data/spec/{unit/models → models}/bxml/response_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verb_spec.rb +1 -14
- data/spec/{unit/models → models}/bxml/verbs/bridge_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/conference_spec.rb +0 -2
- data/spec/models/bxml/verbs/custom_param_spec.rb +36 -0
- data/spec/{unit/models → models}/bxml/verbs/forward_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/gather_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/hangup_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/pause_recording_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/pause_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/phone_number_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/play_audio_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/record_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/redirect_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/resume_recording_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/ring_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/send_dtmf_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/sip_uri_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/speak_sentence_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/start_gather_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/start_recording_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/start_stream_spec.rb +2 -4
- data/spec/models/bxml/verbs/start_transcription_spec.rb +74 -0
- data/spec/{unit/models → models}/bxml/verbs/stop_gather_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/stop_recording_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/stop_stream_spec.rb +0 -2
- data/spec/models/bxml/verbs/stop_transcription_spec.rb +34 -0
- data/spec/{unit/models → models}/bxml/verbs/stream_param_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/tag_spec.rb +0 -2
- data/spec/{unit/models → models}/bxml/verbs/transfer_spec.rb +0 -2
- data/spec/models/call_state_enum_spec.rb +16 -0
- data/spec/models/call_state_spec.rb +181 -0
- data/spec/models/deferred_result_spec.rb +87 -0
- data/spec/models/message_spec.rb +145 -0
- data/spec/models/verify_code_request_spec.rb +134 -0
- data/spec/spec_helper.rb +48 -31
- metadata +146 -254
- data/spec/unit/api/calls_api_spec.rb +0 -89
- data/spec/unit/api/conferences_api_spec.rb +0 -163
- data/spec/unit/api/media_api_spec.rb +0 -90
- data/spec/unit/api/messages_api_spec.rb +0 -73
- data/spec/unit/api/mfa_api_spec.rb +0 -74
- data/spec/unit/api/phone_number_lookup_api_spec.rb +0 -61
- data/spec/unit/api/recordings_api_spec.rb +0 -177
- data/spec/unit/api/statistics_api_spec.rb +0 -47
- data/spec/unit/models/account_statistics_spec.rb +0 -40
- data/spec/unit/models/answer_callback_spec.rb +0 -112
- data/spec/unit/models/bridge_complete_callback_spec.rb +0 -124
- data/spec/unit/models/bridge_target_complete_callback_spec.rb +0 -106
- data/spec/unit/models/call_direction_enum_spec.rb +0 -28
- data/spec/unit/models/call_recording_metadata_spec.rb +0 -136
- data/spec/unit/models/call_state_enum_spec.rb +0 -28
- data/spec/unit/models/call_state_spec.rb +0 -136
- data/spec/unit/models/callback_method_enum_spec.rb +0 -28
- data/spec/unit/models/code_request_spec.rb +0 -64
- data/spec/unit/models/conference_completed_callback_spec.rb +0 -58
- data/spec/unit/models/conference_created_callback_spec.rb +0 -58
- data/spec/unit/models/conference_member_exit_callback_spec.rb +0 -76
- data/spec/unit/models/conference_member_join_callback_spec.rb +0 -76
- data/spec/unit/models/conference_member_spec.rb +0 -64
- data/spec/unit/models/conference_recording_available_callback_spec.rb +0 -112
- data/spec/unit/models/conference_recording_metadata_spec.rb +0 -94
- data/spec/unit/models/conference_redirect_callback_spec.rb +0 -58
- data/spec/unit/models/conference_spec.rb +0 -76
- data/spec/unit/models/conference_state_enum_spec.rb +0 -28
- data/spec/unit/models/create_call_response_spec.rb +0 -154
- data/spec/unit/models/create_call_spec.rb +0 -142
- data/spec/unit/models/create_lookup_response_spec.rb +0 -40
- data/spec/unit/models/create_message_request_error_spec.rb +0 -46
- data/spec/unit/models/deferred_result_spec.rb +0 -40
- data/spec/unit/models/disconnect_callback_spec.rb +0 -130
- data/spec/unit/models/diversion_spec.rb +0 -70
- data/spec/unit/models/dtmf_callback_spec.rb +0 -130
- data/spec/unit/models/field_error_spec.rb +0 -40
- data/spec/unit/models/file_format_enum_spec.rb +0 -28
- data/spec/unit/models/gather_callback_spec.rb +0 -136
- data/spec/unit/models/inbound_message_callback_message_spec.rb +0 -100
- data/spec/unit/models/inbound_message_callback_spec.rb +0 -58
- data/spec/unit/models/initiate_callback_spec.rb +0 -100
- data/spec/unit/models/list_message_direction_enum_spec.rb +0 -28
- data/spec/unit/models/list_message_item_spec.rb +0 -124
- data/spec/unit/models/lookup_request_spec.rb +0 -34
- data/spec/unit/models/lookup_result_spec.rb +0 -82
- data/spec/unit/models/lookup_status_enum_spec.rb +0 -28
- data/spec/unit/models/lookup_status_spec.rb +0 -52
- data/spec/unit/models/machine_detection_complete_callback_spec.rb +0 -112
- data/spec/unit/models/machine_detection_configuration_spec.rb +0 -118
- data/spec/unit/models/machine_detection_mode_enum_spec.rb +0 -28
- data/spec/unit/models/media_spec.rb +0 -46
- data/spec/unit/models/message_delivered_callback_message_spec.rb +0 -100
- data/spec/unit/models/message_delivered_callback_spec.rb +0 -58
- data/spec/unit/models/message_direction_enum_spec.rb +0 -28
- data/spec/unit/models/message_failed_callback_message_spec.rb +0 -100
- data/spec/unit/models/message_failed_callback_spec.rb +0 -64
- data/spec/unit/models/message_request_spec.rb +0 -76
- data/spec/unit/models/message_sending_callback_message_spec.rb +0 -100
- data/spec/unit/models/message_sending_callback_spec.rb +0 -58
- data/spec/unit/models/message_spec.rb +0 -100
- data/spec/unit/models/message_status_enum_spec.rb +0 -28
- data/spec/unit/models/message_type_enum_spec.rb +0 -28
- data/spec/unit/models/messages_list_spec.rb +0 -46
- data/spec/unit/models/messaging_code_response_spec.rb +0 -34
- data/spec/unit/models/messaging_request_error_spec.rb +0 -40
- data/spec/unit/models/mfa_forbidden_request_error_spec.rb +0 -34
- data/spec/unit/models/mfa_request_error_spec.rb +0 -40
- data/spec/unit/models/mfa_unauthorized_request_error_spec.rb +0 -34
- data/spec/unit/models/page_info_spec.rb +0 -52
- data/spec/unit/models/priority_enum_spec.rb +0 -28
- data/spec/unit/models/recording_available_callback_spec.rb +0 -160
- data/spec/unit/models/recording_complete_callback_spec.rb +0 -160
- data/spec/unit/models/recording_state_enum_spec.rb +0 -28
- data/spec/unit/models/redirect_callback_spec.rb +0 -124
- data/spec/unit/models/redirect_method_enum_spec.rb +0 -28
- data/spec/unit/models/stir_shaken_spec.rb +0 -46
- data/spec/unit/models/tag_spec.rb +0 -40
- data/spec/unit/models/tn_lookup_request_error_spec.rb +0 -34
- data/spec/unit/models/transcribe_recording_spec.rb +0 -64
- data/spec/unit/models/transcription_available_callback_spec.rb +0 -154
- data/spec/unit/models/transcription_list_spec.rb +0 -34
- data/spec/unit/models/transcription_metadata_spec.rb +0 -52
- data/spec/unit/models/transcription_spec.rb +0 -40
- data/spec/unit/models/transfer_answer_callback_spec.rb +0 -118
- data/spec/unit/models/transfer_complete_callback_spec.rb +0 -136
- data/spec/unit/models/transfer_disconnect_callback_spec.rb +0 -148
- data/spec/unit/models/update_call_recording_spec.rb +0 -34
- data/spec/unit/models/update_call_spec.rb +0 -88
- data/spec/unit/models/update_conference_member_spec.rb +0 -46
- data/spec/unit/models/update_conference_spec.rb +0 -82
- data/spec/unit/models/verify_code_request_spec.rb +0 -52
- data/spec/unit/models/verify_code_response_spec.rb +0 -34
- data/spec/unit/models/voice_api_error_spec.rb +0 -46
- data/spec/unit/models/voice_code_response_spec.rb +0 -34
@@ -1,29 +1,45 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'json'
|
3
1
|
require_relative '../call_utils'
|
4
2
|
|
5
3
|
# Integration Tests for Bandwidth::CallsApi
|
6
4
|
describe 'CallsApi Integration Tests' do
|
5
|
+
# call info
|
6
|
+
let(:answer_method) { Bandwidth::CallbackMethodEnum::POST }
|
7
|
+
let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' }
|
8
|
+
let(:answer_fallback_method) { Bandwidth::CallbackMethodEnum::POST }
|
9
|
+
let(:disconnect_method) { Bandwidth::CallbackMethodEnum::GET }
|
10
|
+
let(:disconnect_url) { BASE_CALLBACK_URL + '/callbacks/disconnect' }
|
11
|
+
let(:priority) { 5 }
|
12
|
+
let(:direction) { Bandwidth::CallDirectionEnum::OUTBOUND }
|
13
|
+
let(:call_timeout) { 30.0 }
|
14
|
+
let(:callback_timeout) { 15.0 }
|
15
|
+
|
7
16
|
before(:all) do
|
17
|
+
WebMock.allow_net_connect!
|
8
18
|
Bandwidth.configure do |config|
|
9
19
|
config.username = BW_USERNAME
|
10
20
|
config.password = BW_PASSWORD
|
11
21
|
end
|
12
|
-
@
|
13
|
-
|
22
|
+
@calls_api_instance = Bandwidth::CallsApi.new
|
23
|
+
|
24
|
+
# call id
|
25
|
+
$call_info_id = ''
|
26
|
+
end
|
27
|
+
|
28
|
+
after(:all) do
|
29
|
+
WebMock.disable_net_connect!
|
14
30
|
end
|
15
31
|
|
16
32
|
# Create Call
|
17
33
|
describe 'create_call' do
|
18
34
|
it 'creates a call with amd' do
|
19
35
|
amd_config = Bandwidth::MachineDetectionConfiguration.new(
|
20
|
-
mode:
|
36
|
+
mode: 'async',
|
21
37
|
detection_timeout: 5.0,
|
22
38
|
silence_timeout: 5.0,
|
23
39
|
speech_threshold: 5.0,
|
24
40
|
speech_end_threshold: 5.0,
|
25
41
|
delay_result: true,
|
26
|
-
callback_url: BASE_CALLBACK_URL +
|
42
|
+
callback_url: BASE_CALLBACK_URL + '/machineDetection',
|
27
43
|
callback_method: Bandwidth::CallbackMethodEnum::POST
|
28
44
|
)
|
29
45
|
|
@@ -31,35 +47,34 @@ describe 'CallsApi Integration Tests' do
|
|
31
47
|
application_id: BW_VOICE_APPLICATION_ID,
|
32
48
|
to: USER_NUMBER,
|
33
49
|
from: BW_NUMBER,
|
34
|
-
answer_url:
|
35
|
-
answer_method:
|
36
|
-
disconnect_url:
|
37
|
-
disconnect_method:
|
50
|
+
answer_url: answer_url,
|
51
|
+
answer_method: answer_method,
|
52
|
+
disconnect_url: disconnect_url,
|
53
|
+
disconnect_method: disconnect_method,
|
38
54
|
machine_detection: amd_config,
|
39
|
-
call_timeout:
|
40
|
-
callback_timeout:
|
55
|
+
call_timeout: call_timeout,
|
56
|
+
callback_timeout: callback_timeout
|
41
57
|
)
|
42
58
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
expect(
|
47
|
-
expect(
|
48
|
-
expect(
|
49
|
-
expect(
|
50
|
-
expect(
|
51
|
-
expect(
|
52
|
-
expect(
|
53
|
-
expect(
|
54
|
-
expect(
|
55
|
-
expect(
|
56
|
-
expect(
|
57
|
-
expect(
|
58
|
-
expect(
|
59
|
-
expect(
|
60
|
-
|
61
|
-
|
62
|
-
$call_info_id = response[DATA].call_id
|
59
|
+
data, status_code, headers = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
|
60
|
+
|
61
|
+
expect(status_code).to eq(201)
|
62
|
+
expect(data).to be_instance_of(Bandwidth::CreateCallResponse)
|
63
|
+
expect(data.call_id.length).to eq(47)
|
64
|
+
expect(data.account_id).to eq(BW_ACCOUNT_ID)
|
65
|
+
expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
|
66
|
+
expect(data.to).to eq(USER_NUMBER)
|
67
|
+
expect(data.from).to eq(BW_NUMBER)
|
68
|
+
expect(data.call_timeout).to eq(call_timeout)
|
69
|
+
expect(data.callback_timeout).to eq(callback_timeout)
|
70
|
+
expect(data.enqueued_time).to be_instance_of(Time)
|
71
|
+
expect(data.answer_method).to eq(answer_method)
|
72
|
+
expect(data.answer_fallback_method).to eq(answer_fallback_method)
|
73
|
+
expect(data.disconnect_method).to eq(disconnect_method)
|
74
|
+
expect(data.answer_url).to eq(answer_url)
|
75
|
+
expect(data.disconnect_url).to eq(disconnect_url)
|
76
|
+
|
77
|
+
$call_info_id = data.call_id
|
63
78
|
$active_calls.append($call_info_id)
|
64
79
|
end
|
65
80
|
end
|
@@ -67,17 +82,24 @@ describe 'CallsApi Integration Tests' do
|
|
67
82
|
# Get Call State Information
|
68
83
|
describe 'get_call_state' do
|
69
84
|
it 'gets the call state' do
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
85
|
+
begin
|
86
|
+
sleep(SLEEP_TIME_S)
|
87
|
+
data, status_code, headers = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
|
88
|
+
|
89
|
+
expect(status_code).to eq(200)
|
90
|
+
expect(data).to be_instance_of(Bandwidth::CallState)
|
91
|
+
expect(data.call_id).to eq($call_info_id)
|
92
|
+
expect(data.account_id).to eq(BW_ACCOUNT_ID)
|
93
|
+
expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
|
94
|
+
expect(data.start_time).to be_instance_of(Time)
|
95
|
+
expect(data.last_update).to be_instance_of(Time)
|
96
|
+
expect(data.state).to be_instance_of(String)
|
97
|
+
expect(data.direction).to eq(direction)
|
98
|
+
rescue Bandwidth::ApiError => e
|
99
|
+
if e.code != 404
|
100
|
+
raise e
|
101
|
+
end
|
102
|
+
end
|
81
103
|
end
|
82
104
|
end
|
83
105
|
|
@@ -86,34 +108,34 @@ describe 'CallsApi Integration Tests' do
|
|
86
108
|
it 'creates and updates a call' do
|
87
109
|
update_call_body = Bandwidth::UpdateCall.new(
|
88
110
|
state: Bandwidth::CallStateEnum::ACTIVE,
|
89
|
-
redirect_url: MANTECA_BASE_URL +
|
111
|
+
redirect_url: MANTECA_BASE_URL + '/bxml/pause'
|
90
112
|
)
|
91
113
|
|
92
|
-
update_call_id = create_manteca_call(@
|
114
|
+
update_call_id = create_manteca_call(@calls_api_instance)
|
93
115
|
sleep(SLEEP_TIME_S)
|
94
116
|
|
95
|
-
|
96
|
-
expect(
|
117
|
+
update_data, update_status_code, update_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, update_call_body)
|
118
|
+
expect(update_status_code).to eq(200)
|
97
119
|
sleep(SLEEP_TIME_S)
|
98
120
|
|
99
|
-
|
100
|
-
expect(
|
121
|
+
complete_data, complete_status_code, complete_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
|
122
|
+
expect(complete_status_code).to eq(200)
|
101
123
|
end
|
102
124
|
end
|
103
125
|
|
104
126
|
# Update Call BXML
|
105
127
|
describe 'update_call_bxml' do
|
106
128
|
it 'updates a call using bxml' do
|
107
|
-
update_call_id = create_manteca_call(@
|
129
|
+
update_call_id = create_manteca_call(@calls_api_instance)
|
108
130
|
sleep(SLEEP_TIME_S)
|
109
131
|
|
110
|
-
update_bxml =
|
111
|
-
|
112
|
-
expect(
|
132
|
+
update_bxml = '<?xml version="1.0" encoding="UTF-8"?><Bxml><SpeakSentence locale="en_US" gender="female" voice="susan">This is a test bxml response</SpeakSentence><Pause duration="3"/></Bxml>'
|
133
|
+
update_data, update_status_code, update_headers = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, update_call_id, update_bxml)
|
134
|
+
expect(update_status_code).to eq(204)
|
113
135
|
sleep(SLEEP_TIME_S)
|
114
136
|
|
115
|
-
|
116
|
-
expect(
|
137
|
+
complete_data, complete_status_code, complete_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
|
138
|
+
expect(complete_status_code).to eq(200)
|
117
139
|
end
|
118
140
|
end
|
119
141
|
|
@@ -122,16 +144,16 @@ describe 'CallsApi Integration Tests' do
|
|
122
144
|
it 'causes a 400 error' do
|
123
145
|
call_body_bad = Bandwidth::CreateCall.new(
|
124
146
|
application_id: BW_VOICE_APPLICATION_ID,
|
125
|
-
to:
|
147
|
+
to: '+1invalid',
|
126
148
|
from: BW_NUMBER,
|
127
|
-
answer_url:
|
128
|
-
answer_method:
|
129
|
-
disconnect_url:
|
130
|
-
disconnect_method:
|
149
|
+
answer_url: answer_url,
|
150
|
+
answer_method: answer_method,
|
151
|
+
disconnect_url: disconnect_url,
|
152
|
+
disconnect_method: disconnect_method
|
131
153
|
)
|
132
154
|
|
133
155
|
expect {
|
134
|
-
@
|
156
|
+
@calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body_bad)
|
135
157
|
}.to raise_error { |e|
|
136
158
|
expect(e).to be_instance_of(Bandwidth::ApiError)
|
137
159
|
expect(e.code).to eq(400)
|
@@ -139,10 +161,8 @@ describe 'CallsApi Integration Tests' do
|
|
139
161
|
end
|
140
162
|
|
141
163
|
it 'causes a 404 error' do
|
142
|
-
dne_id = "does-not-exist"
|
143
|
-
|
144
164
|
expect {
|
145
|
-
@
|
165
|
+
@calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, 'does-not-exist')
|
146
166
|
}.to raise_error { |e|
|
147
167
|
expect(e).to be_instance_of(Bandwidth::ApiError)
|
148
168
|
expect(e.code).to eq(404)
|
@@ -151,12 +171,12 @@ describe 'CallsApi Integration Tests' do
|
|
151
171
|
|
152
172
|
it 'causes a 401 error' do
|
153
173
|
Bandwidth.configure do |config|
|
154
|
-
config.username =
|
155
|
-
config.password =
|
174
|
+
config.username = UNAUTHORIZED_USERNAME
|
175
|
+
config.password = UNAUTHORIZED_PASSWORD
|
156
176
|
end
|
157
177
|
|
158
178
|
expect {
|
159
|
-
@
|
179
|
+
@calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
|
160
180
|
}.to raise_error { |e|
|
161
181
|
expect(e).to be_instance_of(Bandwidth::ApiError)
|
162
182
|
expect(e.code).to eq(401)
|
@@ -170,12 +190,11 @@ describe 'CallsApi Integration Tests' do
|
|
170
190
|
end
|
171
191
|
|
172
192
|
expect {
|
173
|
-
@
|
193
|
+
@calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
|
174
194
|
}.to raise_error { |e|
|
175
195
|
expect(e).to be_instance_of(Bandwidth::ApiError)
|
176
196
|
expect(e.code).to eq(403)
|
177
197
|
}
|
178
198
|
end
|
179
199
|
end
|
180
|
-
|
181
200
|
end
|
@@ -1,21 +1,26 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'json'
|
3
1
|
require_relative '../call_utils'
|
4
2
|
|
5
3
|
# Integration Tests for Bandwidth::ConferencesApi
|
6
4
|
describe 'ConferencesApi Integration Tests' do
|
7
5
|
before(:all) do
|
6
|
+
WebMock.allow_net_connect!
|
8
7
|
Bandwidth.configure do |config|
|
9
8
|
config.username = BW_USERNAME
|
10
9
|
config.password = BW_PASSWORD
|
11
10
|
config.return_binary_data = true
|
12
11
|
end
|
13
|
-
@
|
14
|
-
@
|
12
|
+
@conferences_api_instance = Bandwidth::ConferencesApi.new
|
13
|
+
@calls_api_instance = Bandwidth::CallsApi.new
|
14
|
+
|
15
|
+
# conference info
|
15
16
|
$manteca_test_id = setup_manteca('conference')
|
16
|
-
$manteca_call_id = create_manteca_call($manteca_test_id,
|
17
|
-
$conference_id =
|
18
|
-
$recording_id =
|
17
|
+
$manteca_call_id = create_manteca_call($manteca_test_id, '/bxml/joinConferencePause', @calls_api_instance)
|
18
|
+
$conference_id = ''
|
19
|
+
$recording_id = ''
|
20
|
+
end
|
21
|
+
|
22
|
+
after(:all) do
|
23
|
+
WebMock.disable_net_connect!
|
19
24
|
end
|
20
25
|
|
21
26
|
# Get Conferences
|
@@ -26,37 +31,38 @@ describe 'ConferencesApi Integration Tests' do
|
|
26
31
|
}
|
27
32
|
|
28
33
|
sleep(SLEEP_TIME_S)
|
29
|
-
|
34
|
+
data, status_code, headers = @conferences_api_instance.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts)
|
30
35
|
|
31
|
-
expect(
|
32
|
-
expect(
|
33
|
-
expect(
|
34
|
-
|
36
|
+
expect(status_code).to eq(200)
|
37
|
+
expect(data).to be_instance_of(Array)
|
38
|
+
expect(data[0]).to be_instance_of(Bandwidth::Conference)
|
39
|
+
expect(data[0].id).to be_instance_of(String)
|
40
|
+
$conference_id = data[0].id
|
35
41
|
end
|
36
42
|
end
|
37
43
|
|
38
44
|
# Get Conference Information
|
39
45
|
describe 'get_conference' do
|
40
46
|
it 'get a conference by id' do
|
41
|
-
|
47
|
+
data, status_code, headers = @conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, $conference_id)
|
42
48
|
|
43
|
-
expect(
|
44
|
-
expect(
|
45
|
-
expect(
|
46
|
-
expect(
|
47
|
-
expect(
|
49
|
+
expect(status_code).to eq(200)
|
50
|
+
expect(data).to be_instance_of(Bandwidth::Conference)
|
51
|
+
expect(data.id).to eq($conference_id)
|
52
|
+
expect(data.name).to eq($manteca_test_id)
|
53
|
+
expect(data.tag).to eq($manteca_test_id)
|
48
54
|
end
|
49
55
|
end
|
50
56
|
|
51
57
|
# Get Conference Member
|
52
58
|
describe 'get_conference_member' do
|
53
59
|
it 'gets a conference member by call id' do
|
54
|
-
|
60
|
+
data, status_code, headers = @conferences_api_instance.get_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id)
|
55
61
|
|
56
|
-
expect(
|
57
|
-
expect(
|
58
|
-
expect(
|
59
|
-
expect(
|
62
|
+
expect(status_code).to eq(200)
|
63
|
+
expect(data).to be_instance_of(Bandwidth::ConferenceMember)
|
64
|
+
expect(data.conference_id).to eq($conference_id)
|
65
|
+
expect(data.call_id).to eq($manteca_call_id)
|
60
66
|
end
|
61
67
|
end
|
62
68
|
|
@@ -67,8 +73,8 @@ describe 'ConferencesApi Integration Tests' do
|
|
67
73
|
mute: false
|
68
74
|
)
|
69
75
|
|
70
|
-
|
71
|
-
expect(
|
76
|
+
data, status_code, headers = @conferences_api_instance.update_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id, update_conference_member)
|
77
|
+
expect(status_code).to eq(204)
|
72
78
|
end
|
73
79
|
end
|
74
80
|
|
@@ -77,34 +83,34 @@ describe 'ConferencesApi Integration Tests' do
|
|
77
83
|
it 'updates a conference' do
|
78
84
|
update_conference_body = Bandwidth::UpdateConference.new(
|
79
85
|
status: Bandwidth::ConferenceStateEnum::ACTIVE,
|
80
|
-
redirect_url: MANTECA_BASE_URL +
|
86
|
+
redirect_url: MANTECA_BASE_URL + '/bxml/pause',
|
81
87
|
redirect_method: Bandwidth::RedirectMethodEnum::POST,
|
82
|
-
username:
|
83
|
-
password:
|
84
|
-
redirect_fallback_url: MANTECA_BASE_URL +
|
88
|
+
username: 'username',
|
89
|
+
password: 'password',
|
90
|
+
redirect_fallback_url: MANTECA_BASE_URL + '/bxml/pause',
|
85
91
|
redirect_fallback_method: Bandwidth::RedirectMethodEnum::POST,
|
86
|
-
fallback_username:
|
87
|
-
fallback_password:
|
92
|
+
fallback_username: 'username',
|
93
|
+
fallback_password: 'password'
|
88
94
|
)
|
89
95
|
|
90
|
-
|
91
|
-
expect(
|
96
|
+
data, status_code, headers = @conferences_api_instance.update_conference_with_http_info(BW_ACCOUNT_ID, $conference_id, update_conference_body)
|
97
|
+
expect(status_code).to eq(204)
|
92
98
|
end
|
93
99
|
end
|
94
100
|
|
95
101
|
# Update Conference BXML
|
96
102
|
describe 'update_conference_bxml' do
|
97
103
|
it 'updates a conference using bxml' do
|
98
|
-
update_bxml =
|
104
|
+
update_bxml = '<?xml version="1.0" encoding="UTF-8"?><Bxml><StartRecording/><SpeakSentence locale="en_US" gender="female" voice="susan">This should be a conference recording.</SpeakSentence><StopRecording/></Bxml>'
|
99
105
|
|
100
|
-
|
101
|
-
expect(
|
106
|
+
data, status_code, headers = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, $conference_id, update_bxml)
|
107
|
+
expect(status_code).to eq(204)
|
102
108
|
|
103
109
|
retries = 0
|
104
110
|
recording_complete = false
|
105
111
|
begin
|
106
112
|
while !recording_complete && retries < MAX_RETRIES
|
107
|
-
recording_complete = get_manteca_test_status($manteca_test_id)[
|
113
|
+
recording_complete = get_manteca_test_status($manteca_test_id)['callRecorded']
|
108
114
|
retries += 1
|
109
115
|
sleep(SLEEP_TIME_S)
|
110
116
|
end
|
@@ -112,52 +118,52 @@ describe 'ConferencesApi Integration Tests' do
|
|
112
118
|
puts e.inspect
|
113
119
|
end
|
114
120
|
|
115
|
-
expect(recording_complete).to
|
121
|
+
expect(recording_complete).to be true
|
116
122
|
end
|
117
123
|
end
|
118
124
|
|
119
125
|
# Get Conference Recordings
|
120
126
|
describe 'list_conference_recordings' do
|
121
127
|
it 'lists recordings for a conference' do
|
122
|
-
|
123
|
-
|
124
|
-
expect(
|
125
|
-
expect(
|
126
|
-
expect(
|
127
|
-
expect(
|
128
|
-
expect(
|
129
|
-
expect(
|
130
|
-
expect(
|
131
|
-
expect(
|
132
|
-
|
133
|
-
|
128
|
+
data, status_code, headers = @conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, $conference_id)
|
129
|
+
|
130
|
+
expect(status_code).to eq(200)
|
131
|
+
expect(data).to be_instance_of(Array)
|
132
|
+
expect(data[0]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
|
133
|
+
expect(data[0].conference_id).to eq($conference_id)
|
134
|
+
expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
|
135
|
+
expect(data[0].name).to eq($manteca_test_id)
|
136
|
+
expect(data[0].status).to eq('complete').or eq('partial')
|
137
|
+
expect(data[0].recording_id).to be_instance_of(String)
|
138
|
+
expect(data[0].file_format).to eq(Bandwidth::FileFormatEnum::WAV)
|
139
|
+
|
140
|
+
$recording_id = data[0].recording_id
|
134
141
|
end
|
135
142
|
end
|
136
143
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
end
|
144
|
+
# Get Conference Recording Information
|
145
|
+
describe 'get_conference_recording' do
|
146
|
+
it 'gets a conference recording by id' do
|
147
|
+
data, status_code, headers = @conferences_api_instance.get_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
|
148
|
+
|
149
|
+
expect(status_code).to eq(200)
|
150
|
+
expect(data).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
|
151
|
+
expect(data.conference_id).to eq($conference_id)
|
152
|
+
expect(data.account_id).to eq(BW_ACCOUNT_ID)
|
153
|
+
expect(data.name).to eq($manteca_test_id)
|
154
|
+
expect(data.status).to eq('complete').or eq('partial')
|
155
|
+
expect(data.recording_id).to be_instance_of(String)
|
156
|
+
expect(data.file_format).to eq(Bandwidth::FileFormatEnum::WAV)
|
151
157
|
end
|
158
|
+
end
|
152
159
|
|
153
160
|
# Download Conference Recording
|
154
161
|
describe 'download_conference_recording test' do
|
155
162
|
it 'should work' do
|
156
|
-
|
163
|
+
data, status_code, headers = @conferences_api_instance.download_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
|
157
164
|
|
158
|
-
expect(
|
159
|
-
expect(
|
165
|
+
expect(status_code).to eq(200)
|
166
|
+
expect(data).to be_instance_of(String)
|
160
167
|
end
|
161
168
|
end
|
162
|
-
|
163
169
|
end
|
@@ -1,73 +1,80 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'json'
|
3
|
-
|
4
1
|
# Integration Tests for Bandwidth::MediaApi
|
5
2
|
describe 'MediaApi Integration Tests' do
|
3
|
+
# media info
|
4
|
+
let(:binary_media_data) { '123456' }
|
5
|
+
let(:media_file_data) { File.open('spec/fixtures/ruby_cat.jpeg').read }
|
6
|
+
let(:media_file_md5) { Digest::MD5.hexdigest(media_file_data) }
|
7
|
+
|
6
8
|
before(:all) do
|
9
|
+
WebMock.allow_net_connect!
|
7
10
|
Bandwidth.configure do |config|
|
8
11
|
config.username = BW_USERNAME
|
9
12
|
config.password = BW_PASSWORD
|
10
13
|
config.return_binary_data = true
|
11
14
|
end
|
12
15
|
@api_instance_media = Bandwidth::MediaApi.new
|
16
|
+
|
17
|
+
# media names
|
13
18
|
@binary_media_name = 'ruby_binary_media' + SecureRandom.uuid
|
14
|
-
@binary_media_data = '123456'
|
15
19
|
@media_file_name = 'ruby_media_file' + SecureRandom.uuid
|
16
|
-
|
17
|
-
|
20
|
+
end
|
21
|
+
|
22
|
+
after(:all) do
|
23
|
+
WebMock.disable_net_connect!
|
18
24
|
end
|
19
25
|
|
20
26
|
# Upload Media
|
21
27
|
describe 'upload_media' do
|
22
28
|
it 'uploads binary media' do
|
23
|
-
|
24
|
-
expect(
|
29
|
+
data, status_code, headers = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, binary_media_data)
|
30
|
+
expect(status_code).to eq(204)
|
25
31
|
end
|
26
32
|
|
27
33
|
it 'uploads media file' do
|
28
|
-
|
29
|
-
expect(
|
34
|
+
data, status_code, headers = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @media_file_name, media_file_data)
|
35
|
+
expect(status_code).to eq(204)
|
30
36
|
end
|
31
37
|
end
|
32
38
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
# List Media
|
40
|
+
describe 'list_media' do
|
41
|
+
it 'lists media' do
|
42
|
+
data, status_code, headers = @api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID)
|
43
|
+
expect(status_code).to eq(200)
|
44
|
+
expect(data).to be_instance_of(Array)
|
45
|
+
expect(data[0]).to be_instance_of(Bandwidth::Media)
|
46
|
+
expect(data[0].content).to be_instance_of(String)
|
47
|
+
expect(data[0].content_length).to be > 0
|
42
48
|
end
|
49
|
+
end
|
43
50
|
|
44
51
|
# Get Media
|
45
52
|
describe 'get_media' do
|
46
53
|
it 'gets uploaded binary media' do
|
47
|
-
|
48
|
-
expect(
|
49
|
-
expect(
|
54
|
+
data, status_code, headers = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name)
|
55
|
+
expect(status_code).to eq(200)
|
56
|
+
expect(data).to eq(binary_media_data)
|
50
57
|
end
|
51
58
|
|
52
59
|
it 'gets uploaded media file' do
|
53
|
-
|
54
|
-
response_md5 = Digest::MD5.hexdigest(
|
60
|
+
data, status_code, headers = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
|
61
|
+
response_md5 = Digest::MD5.hexdigest(data)
|
55
62
|
|
56
|
-
expect(
|
57
|
-
expect(response_md5).to eq(
|
63
|
+
expect(status_code).to eq(200)
|
64
|
+
expect(response_md5).to eq(media_file_md5)
|
58
65
|
end
|
59
66
|
end
|
60
67
|
|
61
68
|
# Delete Media
|
62
69
|
describe 'delete_media' do
|
63
70
|
it 'deletes the binary media' do
|
64
|
-
|
65
|
-
expect(
|
71
|
+
data, status_code, headers = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name)
|
72
|
+
expect(status_code).to eq(204)
|
66
73
|
end
|
67
74
|
|
68
75
|
it 'deletes the media file' do
|
69
|
-
|
70
|
-
expect(
|
76
|
+
data, status_code, headers = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
|
77
|
+
expect(status_code).to eq(204)
|
71
78
|
end
|
72
79
|
end
|
73
80
|
|
@@ -75,12 +82,11 @@ describe 'MediaApi Integration Tests' do
|
|
75
82
|
describe 'http error' do
|
76
83
|
it 'causes a 404 error' do
|
77
84
|
expect {
|
78
|
-
|
85
|
+
@api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, 'does_not_exist')
|
79
86
|
}.to raise_error { |e|
|
80
87
|
expect(e).to be_instance_of(Bandwidth::ApiError)
|
81
88
|
expect(e.code).to eq(404)
|
82
89
|
}
|
83
90
|
end
|
84
91
|
end
|
85
|
-
|
86
92
|
end
|