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
@@ -0,0 +1,395 @@
|
|
1
|
+
# Unit tests for Bandwidth::RecordingsApi
|
2
|
+
describe 'RecordingsApi' do
|
3
|
+
# recording info
|
4
|
+
let(:call_id) { 'c-3f758f24-40c0bd9f-0a8e-4ab6-88d4-c88a2e961c7d' }
|
5
|
+
let(:recording_id) { 'r-fbe05094-87f9b821-e110-4bfb-ac57-82b2bf2bb3d5' }
|
6
|
+
let(:duration) { 'PT4.478S' }
|
7
|
+
let(:direction) { Bandwidth::CallDirectionEnum::OUTBOUND }
|
8
|
+
let(:channels) { 1 }
|
9
|
+
let(:start_time) { '2023-06-26T14:58:51.195Z' }
|
10
|
+
let(:end_time) { '2023-06-26T14:58:57.502Z' }
|
11
|
+
let(:file_format) { Bandwidth::FileFormatEnum::WAV }
|
12
|
+
let(:status) { 'complete' }
|
13
|
+
let(:media_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/media" }
|
14
|
+
let(:text) { 'Now a recording, a long pause.' }
|
15
|
+
let(:confidence) { 0.975 }
|
16
|
+
let(:test_id) { 'test id' }
|
17
|
+
|
18
|
+
# stubs
|
19
|
+
let(:download_call_recording_body_stub) { 'RIFFFWAVEfmtLISTINFOISFTLavf58.45.100data' }
|
20
|
+
let(:download_call_recording_headers_stub) { { 'content-type' => 'audio/vnd.wave', 'content-length' => "#{download_call_recording_body_stub.length}" } }
|
21
|
+
let(:get_call_recording_headers_stub) { { 'content-type' => 'application/json' } }
|
22
|
+
let(:get_call_recording_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"recordingId\":\"#{recording_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"duration\":\"#{duration}\",\"direction\":\"#{direction}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}" }
|
23
|
+
let(:get_call_transcription_headers_stub) { { 'content-type' => 'application/json' } }
|
24
|
+
let(:get_call_transcription_body_stub) { "{\"transcripts\":[{\"text\":\"#{text}\",\"confidence\":#{confidence}}]}" }
|
25
|
+
let(:list_account_call_recordings_headers_stub) { { 'content-type' => 'application/json' } }
|
26
|
+
let(:list_account_call_recordings_body_stub) { "[{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"recordingId\":\"#{recording_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"duration\":\"#{duration}\",\"direction\":\"#{direction}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}]" }
|
27
|
+
let(:list_call_recordings_headers_stub) { { 'content-type' => 'application/json' } }
|
28
|
+
let(:list_call_recordings_body_stub) { "[{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"recordingId\":\"#{recording_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"duration\":\"#{duration}\",\"direction\":\"#{direction}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}]" }
|
29
|
+
let(:update_call_recording_state_headers_stub) { { 'content-length' => '0' } }
|
30
|
+
|
31
|
+
before(:all) do
|
32
|
+
Bandwidth.configure do |config|
|
33
|
+
config.return_binary_data = true
|
34
|
+
config.debugging = true
|
35
|
+
end
|
36
|
+
@recordings_api_instance = Bandwidth::RecordingsApi.new
|
37
|
+
end
|
38
|
+
|
39
|
+
describe 'test an instance of RecordingsApi' do
|
40
|
+
it 'should create an instance of RecordingsApi' do
|
41
|
+
expect(@recordings_api_instance).to be_instance_of(Bandwidth::RecordingsApi)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# Delete Transcription
|
46
|
+
describe 'delete_call_transcription' do
|
47
|
+
it 'deletes the completed call recording transcription' do
|
48
|
+
stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/transcription").
|
49
|
+
to_return(status: 204)
|
50
|
+
|
51
|
+
data, status_code, headers = @recordings_api_instance.delete_call_transcription_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
|
52
|
+
|
53
|
+
expect(status_code).to eq(204)
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'causes an ArgumentError for a missing account_id' do
|
57
|
+
expect {
|
58
|
+
resp = @recordings_api_instance.delete_call_transcription(nil, '', '')
|
59
|
+
}.to raise_error(ArgumentError)
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'causes an ArgumentError for a missing call_id' do
|
63
|
+
expect {
|
64
|
+
@recordings_api_instance.delete_call_transcription(BW_ACCOUNT_ID, nil, '')
|
65
|
+
}.to raise_error(ArgumentError)
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'causes an ArgumentError for a missing recording_id' do
|
69
|
+
expect {
|
70
|
+
@recordings_api_instance.delete_call_transcription(BW_ACCOUNT_ID, '', nil)
|
71
|
+
}.to raise_error(ArgumentError)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Delete Recording
|
76
|
+
describe 'delete_recording' do
|
77
|
+
it 'deletes the completed call recording data' do
|
78
|
+
stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}").
|
79
|
+
to_return(status: 204)
|
80
|
+
|
81
|
+
data, status_code, headers = @recordings_api_instance.delete_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
|
82
|
+
|
83
|
+
expect(status_code).to eq(204)
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'causes an ArgumentError for a missing account_id' do
|
87
|
+
expect {
|
88
|
+
resp = @recordings_api_instance.delete_recording(nil, '', '')
|
89
|
+
}.to raise_error(ArgumentError)
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'causes an ArgumentError for a missing call_id' do
|
93
|
+
expect {
|
94
|
+
@recordings_api_instance.delete_recording(BW_ACCOUNT_ID, nil, '')
|
95
|
+
}.to raise_error(ArgumentError)
|
96
|
+
end
|
97
|
+
|
98
|
+
it 'causes an ArgumentError for a missing recording_id' do
|
99
|
+
expect {
|
100
|
+
@recordings_api_instance.delete_recording(BW_ACCOUNT_ID, '', nil)
|
101
|
+
}.to raise_error(ArgumentError)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# Delete Recording Media
|
106
|
+
describe 'delete_recording_media' do
|
107
|
+
it 'deletes the completed call recording media' do
|
108
|
+
stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/media").
|
109
|
+
to_return(status: 204)
|
110
|
+
|
111
|
+
data, status_code, headers = @recordings_api_instance.delete_recording_media_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
|
112
|
+
|
113
|
+
expect(status_code).to eq(204)
|
114
|
+
end
|
115
|
+
|
116
|
+
it 'causes an ArgumentError for a missing account_id' do
|
117
|
+
expect {
|
118
|
+
resp = @recordings_api_instance.delete_recording_media(nil, '', '')
|
119
|
+
}.to raise_error(ArgumentError)
|
120
|
+
end
|
121
|
+
|
122
|
+
it 'causes an ArgumentError for a missing call_id' do
|
123
|
+
expect {
|
124
|
+
@recordings_api_instance.delete_recording_media(BW_ACCOUNT_ID, nil, '')
|
125
|
+
}.to raise_error(ArgumentError)
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'causes an ArgumentError for a missing recording_id' do
|
129
|
+
expect {
|
130
|
+
@recordings_api_instance.delete_recording_media(BW_ACCOUNT_ID, '', nil)
|
131
|
+
}.to raise_error(ArgumentError)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
# Download Recording
|
136
|
+
describe 'download_call_recording' do
|
137
|
+
it 'downloads a call recording by id' do
|
138
|
+
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/media").
|
139
|
+
to_return(status: 200, headers: download_call_recording_headers_stub, body: download_call_recording_body_stub)
|
140
|
+
|
141
|
+
data, status_code, headers = @recordings_api_instance.download_call_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
|
142
|
+
|
143
|
+
expect(status_code).to eq(200)
|
144
|
+
expect(headers).to eq(download_call_recording_headers_stub)
|
145
|
+
expect(data).to eq(download_call_recording_body_stub)
|
146
|
+
end
|
147
|
+
|
148
|
+
it 'causes an ArgumentError for a missing account_id' do
|
149
|
+
expect {
|
150
|
+
resp = @recordings_api_instance.download_call_recording(nil, '', '')
|
151
|
+
}.to raise_error(ArgumentError)
|
152
|
+
end
|
153
|
+
|
154
|
+
it 'causes an ArgumentError for a missing call_id' do
|
155
|
+
expect {
|
156
|
+
@recordings_api_instance.download_call_recording(BW_ACCOUNT_ID, nil, '')
|
157
|
+
}.to raise_error(ArgumentError)
|
158
|
+
end
|
159
|
+
|
160
|
+
it 'causes an ArgumentError for a missing recording_id' do
|
161
|
+
expect {
|
162
|
+
@recordings_api_instance.download_call_recording(BW_ACCOUNT_ID, '', nil)
|
163
|
+
}.to raise_error(ArgumentError)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Get Call Recording
|
168
|
+
describe 'get_call_recording' do
|
169
|
+
it 'gets a call recording by id' do
|
170
|
+
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}").
|
171
|
+
to_return(status: 200, headers: get_call_recording_headers_stub, body: get_call_recording_body_stub)
|
172
|
+
|
173
|
+
data, status_code, headers = @recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
|
174
|
+
|
175
|
+
expect(status_code).to eq(200)
|
176
|
+
expect(headers).to eq(get_call_recording_headers_stub)
|
177
|
+
expect(data).to be_instance_of(Bandwidth::CallRecordingMetadata)
|
178
|
+
expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
|
179
|
+
expect(data.account_id).to eq(BW_ACCOUNT_ID)
|
180
|
+
expect(data.call_id).to eq(call_id)
|
181
|
+
expect(data.recording_id).to eq(recording_id)
|
182
|
+
expect(data.to).to eq(USER_NUMBER)
|
183
|
+
expect(data.from).to eq(BW_NUMBER)
|
184
|
+
expect(data.duration).to eq(duration)
|
185
|
+
expect(data.direction).to eq(direction)
|
186
|
+
expect(data.channels).to eq(channels)
|
187
|
+
expect(data.start_time).to eq(Time.parse(start_time))
|
188
|
+
expect(data.end_time).to eq(Time.parse(end_time))
|
189
|
+
expect(data.file_format).to eq(file_format)
|
190
|
+
expect(data.status).to eq(status)
|
191
|
+
expect(data.media_url).to eq(media_url)
|
192
|
+
end
|
193
|
+
|
194
|
+
it 'causes an ArgumentError for a missing account_id' do
|
195
|
+
expect {
|
196
|
+
resp = @recordings_api_instance.get_call_recording(nil, '', '')
|
197
|
+
}.to raise_error(ArgumentError)
|
198
|
+
end
|
199
|
+
|
200
|
+
it 'causes an ArgumentError for a missing call_id' do
|
201
|
+
expect {
|
202
|
+
@recordings_api_instance.get_call_recording(BW_ACCOUNT_ID, nil, '')
|
203
|
+
}.to raise_error(ArgumentError)
|
204
|
+
end
|
205
|
+
|
206
|
+
it 'causes an ArgumentError for a missing recording_id' do
|
207
|
+
expect {
|
208
|
+
@recordings_api_instance.get_call_recording(BW_ACCOUNT_ID, '', nil)
|
209
|
+
}.to raise_error(ArgumentError)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
# Get Transcription
|
214
|
+
describe 'get_call_transcription' do
|
215
|
+
it 'gets the completed call recording transcription' do
|
216
|
+
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/transcription").
|
217
|
+
to_return(status: 200, headers: get_call_transcription_headers_stub, body: get_call_transcription_body_stub)
|
218
|
+
|
219
|
+
data, status_code, headers = @recordings_api_instance.get_call_transcription_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
|
220
|
+
|
221
|
+
expect(status_code).to eq(200)
|
222
|
+
expect(data).to be_instance_of(Bandwidth::TranscriptionList)
|
223
|
+
expect(data.transcripts).to be_instance_of(Array)
|
224
|
+
expect(data.transcripts[0]).to be_instance_of(Bandwidth::Transcription)
|
225
|
+
expect(data.transcripts[0].text).to eq(text)
|
226
|
+
expect(data.transcripts[0].confidence).to eq(confidence)
|
227
|
+
end
|
228
|
+
|
229
|
+
it 'causes an ArgumentError for a missing account_id' do
|
230
|
+
expect {
|
231
|
+
resp = @recordings_api_instance.get_call_transcription(nil, '', '')
|
232
|
+
}.to raise_error(ArgumentError)
|
233
|
+
end
|
234
|
+
|
235
|
+
it 'causes an ArgumentError for a missing call_id' do
|
236
|
+
expect {
|
237
|
+
@recordings_api_instance.get_call_transcription(BW_ACCOUNT_ID, nil, '')
|
238
|
+
}.to raise_error(ArgumentError)
|
239
|
+
end
|
240
|
+
|
241
|
+
it 'causes an ArgumentError for a missing recording_id' do
|
242
|
+
expect {
|
243
|
+
@recordings_api_instance.get_call_transcription(BW_ACCOUNT_ID, '', nil)
|
244
|
+
}.to raise_error(ArgumentError)
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
# Get Call Recordings
|
249
|
+
describe 'list_account_call_recordings' do
|
250
|
+
it 'lists account call recordings' do
|
251
|
+
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/recordings").
|
252
|
+
to_return(status: 200, headers: list_account_call_recordings_headers_stub, body: list_account_call_recordings_body_stub)
|
253
|
+
|
254
|
+
data, status_code, headers = @recordings_api_instance.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID)
|
255
|
+
|
256
|
+
expect(status_code).to eq(200)
|
257
|
+
expect(data).to be_instance_of(Array)
|
258
|
+
expect(data[0]).to be_instance_of(Bandwidth::CallRecordingMetadata)
|
259
|
+
expect(data[0].application_id).to eq(BW_VOICE_APPLICATION_ID)
|
260
|
+
expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
|
261
|
+
expect(data[0].call_id).to eq(call_id)
|
262
|
+
expect(data[0].recording_id).to eq(recording_id)
|
263
|
+
expect(data[0].to).to eq(USER_NUMBER)
|
264
|
+
expect(data[0].from).to eq(BW_NUMBER)
|
265
|
+
expect(data[0].duration).to eq(duration)
|
266
|
+
expect(data[0].direction).to eq(direction)
|
267
|
+
expect(data[0].channels).to eq(channels)
|
268
|
+
expect(data[0].start_time).to eq(Time.parse(start_time))
|
269
|
+
expect(data[0].end_time).to eq(Time.parse(end_time))
|
270
|
+
expect(data[0].file_format).to eq(file_format)
|
271
|
+
expect(data[0].status).to eq(status)
|
272
|
+
expect(data[0].media_url).to eq(media_url)
|
273
|
+
end
|
274
|
+
|
275
|
+
it 'causes an ArgumentError for a missing account_id' do
|
276
|
+
expect {
|
277
|
+
resp = @recordings_api_instance.list_account_call_recordings(nil)
|
278
|
+
}.to raise_error(ArgumentError)
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
# List Call Recordings
|
283
|
+
describe 'list_call_recordings' do
|
284
|
+
it 'lists all recordings for a single call' do
|
285
|
+
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings").
|
286
|
+
to_return(status: 200, headers: list_call_recordings_headers_stub, body: list_call_recordings_body_stub)
|
287
|
+
|
288
|
+
data, status_code, headers = @recordings_api_instance.list_call_recordings_with_http_info(BW_ACCOUNT_ID, call_id)
|
289
|
+
|
290
|
+
expect(status_code).to eq(200)
|
291
|
+
expect(data).to be_instance_of(Array)
|
292
|
+
expect(data[0].application_id).to eq(BW_VOICE_APPLICATION_ID)
|
293
|
+
expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
|
294
|
+
expect(data[0].call_id).to eq(call_id)
|
295
|
+
expect(data[0].recording_id).to eq(recording_id)
|
296
|
+
expect(data[0].to).to eq(USER_NUMBER)
|
297
|
+
expect(data[0].from).to eq(BW_NUMBER)
|
298
|
+
expect(data[0].duration).to eq(duration)
|
299
|
+
expect(data[0].direction).to eq(direction)
|
300
|
+
expect(data[0].channels).to eq(channels)
|
301
|
+
expect(data[0].start_time).to eq(Time.parse(start_time))
|
302
|
+
expect(data[0].end_time).to eq(Time.parse(end_time))
|
303
|
+
expect(data[0].file_format).to eq(file_format)
|
304
|
+
expect(data[0].status).to eq(status)
|
305
|
+
expect(data[0].media_url).to eq(media_url)
|
306
|
+
end
|
307
|
+
|
308
|
+
it 'causes an ArgumentError for a missing account_id' do
|
309
|
+
expect {
|
310
|
+
resp = @recordings_api_instance.list_call_recordings(nil, '')
|
311
|
+
}.to raise_error(ArgumentError)
|
312
|
+
end
|
313
|
+
|
314
|
+
it 'causes an ArgumentError for a missing call_id' do
|
315
|
+
expect {
|
316
|
+
@recordings_api_instance.list_call_recordings(BW_ACCOUNT_ID, nil)
|
317
|
+
}.to raise_error(ArgumentError)
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
# Create Transcription Request
|
322
|
+
describe 'transcribe_call_recording' do
|
323
|
+
it 'creates a transcription request' do
|
324
|
+
stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/transcription").
|
325
|
+
to_return(status: 204)
|
326
|
+
|
327
|
+
transcribe_recording = Bandwidth::TranscribeRecording.new(
|
328
|
+
callback_url: BASE_CALLBACK_URL + '/transcriptions',
|
329
|
+
tag: test_id
|
330
|
+
)
|
331
|
+
|
332
|
+
data, status_code, headers = @recordings_api_instance.transcribe_call_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id, transcribe_recording)
|
333
|
+
|
334
|
+
expect(status_code).to eq(204)
|
335
|
+
end
|
336
|
+
|
337
|
+
it 'causes an ArgumentError for a missing account_id' do
|
338
|
+
expect {
|
339
|
+
resp = @recordings_api_instance.transcribe_call_recording(nil, '', '', '')
|
340
|
+
}.to raise_error(ArgumentError)
|
341
|
+
end
|
342
|
+
|
343
|
+
it 'causes an ArgumentError for a missing call_id' do
|
344
|
+
expect {
|
345
|
+
@recordings_api_instance.transcribe_call_recording(BW_ACCOUNT_ID, nil, '', '')
|
346
|
+
}.to raise_error(ArgumentError)
|
347
|
+
end
|
348
|
+
|
349
|
+
it 'causes an ArgumentError for a missing recording_id' do
|
350
|
+
expect {
|
351
|
+
@recordings_api_instance.transcribe_call_recording(BW_ACCOUNT_ID, '', nil, '')
|
352
|
+
}.to raise_error(ArgumentError)
|
353
|
+
end
|
354
|
+
|
355
|
+
it 'causes an ArgumentError for a missing transcribe_recording' do
|
356
|
+
expect {
|
357
|
+
@recordings_api_instance.transcribe_call_recording(BW_ACCOUNT_ID, '', '', nil)
|
358
|
+
}.to raise_error(ArgumentError)
|
359
|
+
end
|
360
|
+
end
|
361
|
+
|
362
|
+
# Update Recording
|
363
|
+
describe 'update_call_recording_state' do
|
364
|
+
it 'updates and ends the manteca call recording' do
|
365
|
+
stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recording").
|
366
|
+
to_return(status: 200, headers: update_call_recording_state_headers_stub)
|
367
|
+
|
368
|
+
pause_recording = Bandwidth::UpdateCallRecording.new(
|
369
|
+
state: Bandwidth::RecordingStateEnum::PAUSED
|
370
|
+
)
|
371
|
+
|
372
|
+
data, status_code, headers = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, call_id, pause_recording)
|
373
|
+
|
374
|
+
expect(status_code).to eq(200)
|
375
|
+
end
|
376
|
+
|
377
|
+
it 'causes an ArgumentError for a missing account_id' do
|
378
|
+
expect {
|
379
|
+
resp = @recordings_api_instance.update_call_recording_state(nil, '', {})
|
380
|
+
}.to raise_error(ArgumentError)
|
381
|
+
end
|
382
|
+
|
383
|
+
it 'causes an ArgumentError for a missing call_id' do
|
384
|
+
expect {
|
385
|
+
@recordings_api_instance.update_call_recording_state(BW_ACCOUNT_ID, nil, {})
|
386
|
+
}.to raise_error(ArgumentError)
|
387
|
+
end
|
388
|
+
|
389
|
+
it 'causes an ArgumentError for a missing update_call_recording' do
|
390
|
+
expect {
|
391
|
+
@recordings_api_instance.update_call_recording_state(BW_ACCOUNT_ID, '', nil)
|
392
|
+
}.to raise_error(ArgumentError)
|
393
|
+
end
|
394
|
+
end
|
395
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Unit tests for Bandwidth::StatisticsApi
|
2
|
+
describe 'StatisticsApi' do
|
3
|
+
# statistics info
|
4
|
+
let(:current_call_queue_size) { 0 }
|
5
|
+
let(:max_call_queue_size) { 7500 }
|
6
|
+
|
7
|
+
# stubs
|
8
|
+
let(:get_statistics_headers_stub) { { 'content-type' => 'application/json' } }
|
9
|
+
let(:get_statistics_body_stub) { "{\"currentCallQueueSize\":#{current_call_queue_size},\"maxCallQueueSize\":#{max_call_queue_size}}" }
|
10
|
+
|
11
|
+
before(:all) do
|
12
|
+
Bandwidth.configure do |config|
|
13
|
+
config.debugging = true
|
14
|
+
end
|
15
|
+
@statistics_api_instance = Bandwidth::StatisticsApi.new
|
16
|
+
end
|
17
|
+
|
18
|
+
describe 'test an instance of StatisticsApi' do
|
19
|
+
it 'should create an instance of StatisticsApi' do
|
20
|
+
expect(@statistics_api_instance).to be_instance_of(Bandwidth::StatisticsApi)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Get Account Statistics
|
25
|
+
describe 'get_statistics' do
|
26
|
+
it 'gets account statistics' do
|
27
|
+
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/statistics").
|
28
|
+
to_return(status: 200, headers: get_statistics_headers_stub, body: get_statistics_body_stub)
|
29
|
+
|
30
|
+
data, status_code, headers = @statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID)
|
31
|
+
|
32
|
+
expect(status_code).to eq(200)
|
33
|
+
expect(headers).to eq(get_statistics_headers_stub)
|
34
|
+
expect(data).to be_instance_of(Bandwidth::AccountStatistics)
|
35
|
+
expect(data.current_call_queue_size).to eq(current_call_queue_size)
|
36
|
+
expect(data.max_call_queue_size).to eq(max_call_queue_size)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'causes an ArgumentError for a missing account_id' do
|
40
|
+
expect {
|
41
|
+
resp = @statistics_api_instance.get_statistics(nil)
|
42
|
+
}.to raise_error(ArgumentError)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|