bandwidth-sdk 11.3.0 → 12.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +18 -16
- data/README.md +15 -9
- data/Rakefile +4 -12
- data/bandwidth.yml +243 -28
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +1412 -1009
- data/coverage/index.html +16274 -11823
- data/custom_templates/README.mustache +4 -4
- data/docs/AnswerCallback.md +1 -1
- data/docs/BridgeCompleteCallback.md +1 -1
- data/docs/BridgeTargetCompleteCallback.md +1 -1
- data/docs/CallRecordingMetadata.md +3 -3
- data/docs/CallTranscription.md +24 -0
- data/docs/CallTranscriptionMetadata.md +20 -0
- data/docs/CallTranscriptionResponse.md +24 -0
- data/docs/CallsApi.md +1 -1
- data/docs/ConferenceMemberExitCallback.md +1 -1
- data/docs/ConferenceMemberJoinCallback.md +1 -1
- data/docs/CreateCall.md +5 -3
- data/docs/DisconnectCallback.md +1 -1
- data/docs/DtmfCallback.md +2 -2
- data/docs/GatherCallback.md +2 -2
- data/docs/InitiateCallback.md +1 -1
- data/docs/MachineDetectionCompleteCallback.md +1 -1
- data/docs/RecordingAvailableCallback.md +4 -4
- data/docs/RecordingCompleteCallback.md +2 -2
- data/docs/RecordingTranscriptionMetadata.md +24 -0
- data/docs/RecordingTranscriptions.md +18 -0
- data/docs/RecordingsApi.md +49 -49
- data/docs/RedirectCallback.md +2 -2
- data/docs/TranscriptionAvailableCallback.md +2 -2
- data/docs/TranscriptionsApi.md +229 -0
- data/docs/TransferAnswerCallback.md +2 -2
- data/docs/TransferCompleteCallback.md +2 -2
- data/docs/TransferDisconnectCallback.md +2 -2
- data/lib/bandwidth-sdk/api/recordings_api.rb +56 -56
- data/lib/bandwidth-sdk/api/transcriptions_api.rb +241 -0
- data/lib/bandwidth-sdk/configuration.rb +22 -4
- data/lib/bandwidth-sdk/models/answer_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +3 -3
- data/lib/bandwidth-sdk/models/call_transcription.rb +317 -0
- data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +223 -0
- data/lib/bandwidth-sdk/models/call_transcription_response.rb +244 -0
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/create_call.rb +14 -3
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/gather_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/initiate_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +244 -0
- data/lib/bandwidth-sdk/models/recording_transcriptions.rb +214 -0
- data/lib/bandwidth-sdk/models/redirect_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +2 -2
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +6 -2
- data/spec/{integration/calls_api_integration_spec.rb → smoke/calls_api_spec.rb} +9 -7
- data/spec/{integration/conferences_api_integration_spec.rb → smoke/conferences_api_spec.rb} +9 -9
- data/spec/{integration/media_api_integration_spec.rb → smoke/media_api_spec.rb} +7 -7
- data/spec/{integration/messages_api_integration_spec.rb → smoke/messages_api_spec.rb} +3 -3
- data/spec/{integration/mfa_api_integration_spec.rb → smoke/mfa_api_spec.rb} +3 -3
- data/spec/{integration/phone_number_lookup_api_integration_spec.rb → smoke/phone_number_lookup_api_spec.rb} +2 -2
- data/spec/{integration/recordings_api_integration_spec.rb → smoke/recordings_api_spec.rb} +14 -14
- data/spec/{integration/statistics_api_integration_spec.rb → smoke/statistics_api_spec.rb} +1 -1
- data/spec/smoke/transcriptions_api_spec.rb +84 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/{api → unit/api}/calls_api_spec.rb +6 -4
- data/spec/{api → unit/api}/conferences_api_spec.rb +12 -12
- data/spec/{api → unit/api}/media_api_spec.rb +6 -6
- data/spec/{api → unit/api}/messages_api_spec.rb +2 -2
- data/spec/{api → unit/api}/mfa_api_spec.rb +6 -6
- data/spec/{api → unit/api}/phone_number_lookup_api_spec.rb +2 -2
- data/spec/{api → unit/api}/recordings_api_spec.rb +30 -30
- data/spec/{api → unit/api}/statistics_api_spec.rb +1 -1
- data/spec/unit/api/transcriptions_api_spec.rb +130 -0
- data/spec/{api_client_spec.rb → unit/client/api_client_spec.rb} +2 -2
- metadata +130 -114
- /data/spec/{api_error_spec.rb → unit/client/api_error_spec.rb} +0 -0
- /data/spec/{configuration_spec.rb → unit/client/configuration_spec.rb} +0 -0
- /data/spec/{models → unit/models}/bxml/bxml_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/nestable_verb_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/response_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verb_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/bridge_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/conference_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/custom_param_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/forward_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/gather_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/hangup_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/pause_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/pause_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/phone_number_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/play_audio_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/record_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/redirect_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/resume_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/ring_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/send_dtmf_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/sip_uri_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/speak_sentence_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_gather_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_stream_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_transcription_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_gather_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_stream_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_transcription_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stream_param_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/tag_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/transfer_spec.rb +0 -0
- /data/spec/{models → unit/models}/call_state_enum_spec.rb +0 -0
- /data/spec/{models → unit/models}/call_state_spec.rb +0 -0
- /data/spec/{models → unit/models}/deferred_result_spec.rb +0 -0
- /data/spec/{models → unit/models}/message_spec.rb +0 -0
- /data/spec/{models → unit/models}/verify_code_request_spec.rb +0 -0
@@ -31,7 +31,7 @@ describe 'ConferencesApi Integration Tests' do
|
|
31
31
|
}
|
32
32
|
|
33
33
|
sleep(SLEEP_TIME_S)
|
34
|
-
data, status_code
|
34
|
+
data, status_code = @conferences_api_instance.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts)
|
35
35
|
|
36
36
|
expect(status_code).to eq(200)
|
37
37
|
expect(data).to be_instance_of(Array)
|
@@ -44,7 +44,7 @@ describe 'ConferencesApi Integration Tests' do
|
|
44
44
|
# Get Conference Information
|
45
45
|
describe 'get_conference' do
|
46
46
|
it 'get a conference by id' do
|
47
|
-
data, status_code
|
47
|
+
data, status_code = @conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, $conference_id)
|
48
48
|
|
49
49
|
expect(status_code).to eq(200)
|
50
50
|
expect(data).to be_instance_of(Bandwidth::Conference)
|
@@ -57,7 +57,7 @@ describe 'ConferencesApi Integration Tests' do
|
|
57
57
|
# Get Conference Member
|
58
58
|
describe 'get_conference_member' do
|
59
59
|
it 'gets a conference member by call id' do
|
60
|
-
data, status_code
|
60
|
+
data, status_code = @conferences_api_instance.get_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id)
|
61
61
|
|
62
62
|
expect(status_code).to eq(200)
|
63
63
|
expect(data).to be_instance_of(Bandwidth::ConferenceMember)
|
@@ -73,7 +73,7 @@ describe 'ConferencesApi Integration Tests' do
|
|
73
73
|
mute: false
|
74
74
|
)
|
75
75
|
|
76
|
-
|
76
|
+
_data, status_code = @conferences_api_instance.update_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id, update_conference_member)
|
77
77
|
expect(status_code).to eq(204)
|
78
78
|
end
|
79
79
|
end
|
@@ -93,7 +93,7 @@ describe 'ConferencesApi Integration Tests' do
|
|
93
93
|
fallback_password: 'password'
|
94
94
|
)
|
95
95
|
|
96
|
-
|
96
|
+
_data, status_code = @conferences_api_instance.update_conference_with_http_info(BW_ACCOUNT_ID, $conference_id, update_conference_body)
|
97
97
|
expect(status_code).to eq(204)
|
98
98
|
end
|
99
99
|
end
|
@@ -103,7 +103,7 @@ describe 'ConferencesApi Integration Tests' do
|
|
103
103
|
it 'updates a conference using bxml' do
|
104
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>'
|
105
105
|
|
106
|
-
|
106
|
+
_data, status_code = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, $conference_id, update_bxml)
|
107
107
|
expect(status_code).to eq(204)
|
108
108
|
|
109
109
|
retries = 0
|
@@ -125,7 +125,7 @@ describe 'ConferencesApi Integration Tests' do
|
|
125
125
|
# Get Conference Recordings
|
126
126
|
describe 'list_conference_recordings' do
|
127
127
|
it 'lists recordings for a conference' do
|
128
|
-
data, status_code
|
128
|
+
data, status_code = @conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, $conference_id)
|
129
129
|
|
130
130
|
expect(status_code).to eq(200)
|
131
131
|
expect(data).to be_instance_of(Array)
|
@@ -144,7 +144,7 @@ describe 'ConferencesApi Integration Tests' do
|
|
144
144
|
# Get Conference Recording Information
|
145
145
|
describe 'get_conference_recording' do
|
146
146
|
it 'gets a conference recording by id' do
|
147
|
-
data, status_code
|
147
|
+
data, status_code = @conferences_api_instance.get_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
|
148
148
|
|
149
149
|
expect(status_code).to eq(200)
|
150
150
|
expect(data).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
|
@@ -160,7 +160,7 @@ describe 'ConferencesApi Integration Tests' do
|
|
160
160
|
# Download Conference Recording
|
161
161
|
describe 'download_conference_recording test' do
|
162
162
|
it 'should work' do
|
163
|
-
data, status_code
|
163
|
+
data, status_code = @conferences_api_instance.download_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
|
164
164
|
|
165
165
|
expect(status_code).to eq(200)
|
166
166
|
expect(data).to be_instance_of(String)
|
@@ -26,12 +26,12 @@ describe 'MediaApi Integration Tests' do
|
|
26
26
|
# Upload Media
|
27
27
|
describe 'upload_media' do
|
28
28
|
it 'uploads binary media' do
|
29
|
-
|
29
|
+
_data, status_code = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, binary_media_data)
|
30
30
|
expect(status_code).to eq(204)
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'uploads media file' do
|
34
|
-
|
34
|
+
_data, status_code = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @media_file_name, media_file_data)
|
35
35
|
expect(status_code).to eq(204)
|
36
36
|
end
|
37
37
|
end
|
@@ -39,7 +39,7 @@ describe 'MediaApi Integration Tests' do
|
|
39
39
|
# List Media
|
40
40
|
describe 'list_media' do
|
41
41
|
it 'lists media' do
|
42
|
-
data, status_code
|
42
|
+
data, status_code = @api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID)
|
43
43
|
expect(status_code).to eq(200)
|
44
44
|
expect(data).to be_instance_of(Array)
|
45
45
|
expect(data[0]).to be_instance_of(Bandwidth::Media)
|
@@ -51,13 +51,13 @@ describe 'MediaApi Integration Tests' do
|
|
51
51
|
# Get Media
|
52
52
|
describe 'get_media' do
|
53
53
|
it 'gets uploaded binary media' do
|
54
|
-
data, status_code
|
54
|
+
data, status_code = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name)
|
55
55
|
expect(status_code).to eq(200)
|
56
56
|
expect(data).to eq(binary_media_data)
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'gets uploaded media file' do
|
60
|
-
data, status_code
|
60
|
+
data, status_code = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
|
61
61
|
response_md5 = Digest::MD5.hexdigest(data)
|
62
62
|
|
63
63
|
expect(status_code).to eq(200)
|
@@ -68,12 +68,12 @@ describe 'MediaApi Integration Tests' do
|
|
68
68
|
# Delete Media
|
69
69
|
describe 'delete_media' do
|
70
70
|
it 'deletes the binary media' do
|
71
|
-
|
71
|
+
_data, status_code = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name)
|
72
72
|
expect(status_code).to eq(204)
|
73
73
|
end
|
74
74
|
|
75
75
|
it 'deletes the media file' do
|
76
|
-
|
76
|
+
_data, status_code = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
|
77
77
|
expect(status_code).to eq(204)
|
78
78
|
end
|
79
79
|
end
|
@@ -37,7 +37,7 @@ describe 'MessagesApi Integration Tests' do
|
|
37
37
|
tag: mms_tag
|
38
38
|
)
|
39
39
|
|
40
|
-
data, status_code
|
40
|
+
data, status_code = @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, message_request)
|
41
41
|
|
42
42
|
expect(status_code).to eq(202)
|
43
43
|
expect(data).to be_instance_of(Bandwidth::Message)
|
@@ -61,7 +61,7 @@ describe 'MessagesApi Integration Tests' do
|
|
61
61
|
expiration: @expiration_time
|
62
62
|
)
|
63
63
|
|
64
|
-
data, status_code
|
64
|
+
data, status_code = @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, message_request)
|
65
65
|
|
66
66
|
expect(status_code).to eq(202)
|
67
67
|
expect(data).to be_instance_of(Bandwidth::Message)
|
@@ -83,7 +83,7 @@ describe 'MessagesApi Integration Tests' do
|
|
83
83
|
source_tn: BW_NUMBER,
|
84
84
|
message_direction: list_message_direction
|
85
85
|
}
|
86
|
-
data, status_code
|
86
|
+
data, status_code = @messaging_api_instance.list_messages_with_http_info(BW_ACCOUNT_ID, get_opts)
|
87
87
|
|
88
88
|
expect(status_code).to eq(200)
|
89
89
|
expect(data).to be_instance_of(Bandwidth::MessagesList)
|
@@ -28,7 +28,7 @@ describe 'MFAApi Integration Tests' do
|
|
28
28
|
digits: digits
|
29
29
|
)
|
30
30
|
|
31
|
-
data, status_code
|
31
|
+
data, status_code = @mfa_api_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema)
|
32
32
|
|
33
33
|
expect(status_code).to eq(200)
|
34
34
|
expect(data).to be_instance_of(Bandwidth::MessagingCodeResponse)
|
@@ -47,7 +47,7 @@ describe 'MFAApi Integration Tests' do
|
|
47
47
|
digits: digits
|
48
48
|
)
|
49
49
|
|
50
|
-
data, status_code
|
50
|
+
data, status_code = @mfa_api_instance.generate_voice_code_with_http_info(BW_ACCOUNT_ID, req_schema)
|
51
51
|
|
52
52
|
expect(status_code).to eq(200)
|
53
53
|
expect(data).to be_instance_of(Bandwidth::VoiceCodeResponse)
|
@@ -65,7 +65,7 @@ describe 'MFAApi Integration Tests' do
|
|
65
65
|
code: '12345'
|
66
66
|
)
|
67
67
|
|
68
|
-
data, status_code
|
68
|
+
data, status_code = @mfa_api_instance.verify_code_with_http_info(BW_ACCOUNT_ID, req_schema)
|
69
69
|
|
70
70
|
expect(status_code).to eq(200)
|
71
71
|
expect(data).to be_instance_of(Bandwidth::VerifyCodeResponse)
|
@@ -22,7 +22,7 @@ describe 'PhoneNumberLookupApi Integration Tests' do
|
|
22
22
|
tn_body = Bandwidth::LookupRequest.new(
|
23
23
|
tns: [BW_NUMBER]
|
24
24
|
)
|
25
|
-
data, status_code
|
25
|
+
data, status_code = @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body)
|
26
26
|
|
27
27
|
expect(status_code).to eq(202)
|
28
28
|
expect(data).to be_instance_of(Bandwidth::CreateLookupResponse)
|
@@ -37,7 +37,7 @@ describe 'PhoneNumberLookupApi Integration Tests' do
|
|
37
37
|
# Get Lookup Status
|
38
38
|
describe 'get_lookup_status' do
|
39
39
|
it 'gets lookup status' do
|
40
|
-
data, status_code
|
40
|
+
data, status_code = @api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, $lookup_request_id)
|
41
41
|
|
42
42
|
expect(status_code).to eq(200)
|
43
43
|
expect(data).to be_instance_of(Bandwidth::LookupStatus)
|
@@ -34,14 +34,14 @@ describe 'RecordingsApi Integration Tests' do
|
|
34
34
|
)
|
35
35
|
|
36
36
|
sleep(SLEEP_TIME_S * 2)
|
37
|
-
|
37
|
+
_pause_data, pause_status_code = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, pause_recording)
|
38
38
|
expect(pause_status_code).to eq(200)
|
39
39
|
|
40
40
|
sleep(SLEEP_TIME_S)
|
41
|
-
|
41
|
+
_record_data, record_status_code = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, start_recording)
|
42
42
|
expect(record_status_code).to eq(200)
|
43
43
|
|
44
|
-
|
44
|
+
_complete_data, complete_status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $complete_call_body)
|
45
45
|
expect(complete_status_code).to eq(200)
|
46
46
|
|
47
47
|
retries = 0
|
@@ -63,7 +63,7 @@ describe 'RecordingsApi Integration Tests' do
|
|
63
63
|
# Get Call Recordings
|
64
64
|
describe 'list_account_call_recordings' do
|
65
65
|
it 'lists account call recordings' do
|
66
|
-
data, status_code
|
66
|
+
data, status_code = @recordings_api_instance.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID)
|
67
67
|
|
68
68
|
expect(status_code).to eq(200)
|
69
69
|
expect(data).to be_instance_of(Array)
|
@@ -76,7 +76,7 @@ describe 'RecordingsApi Integration Tests' do
|
|
76
76
|
# List Call Recordings
|
77
77
|
describe 'list_call_recordings' do
|
78
78
|
it 'lists all recordings for a single call' do
|
79
|
-
data, status_code
|
79
|
+
data, status_code = @recordings_api_instance.list_call_recordings_with_http_info(BW_ACCOUNT_ID, $manteca_call_id)
|
80
80
|
|
81
81
|
expect(status_code).to eq(200)
|
82
82
|
expect(data).to be_instance_of(Array)
|
@@ -94,7 +94,7 @@ describe 'RecordingsApi Integration Tests' do
|
|
94
94
|
# Get Call Recording
|
95
95
|
describe 'get_call_recording' do
|
96
96
|
it 'gets a call recording by id' do
|
97
|
-
data, status_code
|
97
|
+
data, status_code = @recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
98
98
|
|
99
99
|
expect(status_code).to eq(200)
|
100
100
|
expect(data).to be_instance_of(Bandwidth::CallRecordingMetadata)
|
@@ -109,7 +109,7 @@ describe 'RecordingsApi Integration Tests' do
|
|
109
109
|
# Download Recording
|
110
110
|
describe 'download_call_recording' do
|
111
111
|
it 'downloads a call recording by id' do
|
112
|
-
data, status_code
|
112
|
+
data, status_code = @recordings_api_instance.download_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
113
113
|
|
114
114
|
expect(status_code).to eq(200)
|
115
115
|
expect(data).to be_instance_of(String)
|
@@ -118,13 +118,13 @@ describe 'RecordingsApi Integration Tests' do
|
|
118
118
|
|
119
119
|
# Create Transcription Request
|
120
120
|
describe 'transcribe_call_recording' do
|
121
|
-
it 'creates a transcription request' do
|
121
|
+
it 'creates a recording transcription request' do
|
122
122
|
transcribe_recording = Bandwidth::TranscribeRecording.new(
|
123
123
|
callback_url: MANTECA_BASE_URL + '/transcriptions',
|
124
124
|
tag: $manteca_test_id
|
125
125
|
)
|
126
126
|
|
127
|
-
|
127
|
+
_data, status_code = @recordings_api_instance.transcribe_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id, transcribe_recording)
|
128
128
|
expect(status_code).to eq(204)
|
129
129
|
|
130
130
|
retries = 0
|
@@ -147,10 +147,10 @@ describe 'RecordingsApi Integration Tests' do
|
|
147
147
|
# Get Transcription
|
148
148
|
describe 'get_call_transcription' do
|
149
149
|
it 'gets the completed call recording transcription' do
|
150
|
-
data, status_code
|
150
|
+
data, status_code = @recordings_api_instance.get_recording_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
151
151
|
|
152
152
|
expect(status_code).to eq(200)
|
153
|
-
expect(data).to be_instance_of(Bandwidth::
|
153
|
+
expect(data).to be_instance_of(Bandwidth::RecordingTranscriptions)
|
154
154
|
expect(data.transcripts).to be_instance_of(Array)
|
155
155
|
expect(data.transcripts[0]).to be_instance_of(Bandwidth::Transcription)
|
156
156
|
expect(data.transcripts[0].text).to be_instance_of(String)
|
@@ -161,7 +161,7 @@ describe 'RecordingsApi Integration Tests' do
|
|
161
161
|
# Delete Transcription
|
162
162
|
describe 'delete_call_transcription' do
|
163
163
|
it 'deletes the completed call recording transcription' do
|
164
|
-
|
164
|
+
_data, status_code = @recordings_api_instance.delete_recording_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
165
165
|
expect(status_code).to eq(204)
|
166
166
|
end
|
167
167
|
end
|
@@ -169,7 +169,7 @@ describe 'RecordingsApi Integration Tests' do
|
|
169
169
|
# Delete Recording Media
|
170
170
|
describe 'delete_recording_media' do
|
171
171
|
it 'deletes the completed call recording media' do
|
172
|
-
|
172
|
+
_data, status_code = @recordings_api_instance.delete_recording_media_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
173
173
|
expect(status_code).to eq(204)
|
174
174
|
end
|
175
175
|
end
|
@@ -177,7 +177,7 @@ describe 'RecordingsApi Integration Tests' do
|
|
177
177
|
# Delete Recording
|
178
178
|
describe 'delete_recording' do
|
179
179
|
it 'deletes the completed call recording data' do
|
180
|
-
|
180
|
+
_data, status_code = @recordings_api_instance.delete_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
|
181
181
|
expect(status_code).to eq(204)
|
182
182
|
end
|
183
183
|
end
|
@@ -16,7 +16,7 @@ describe 'StatisticsApi Integration Tests' do
|
|
16
16
|
# Get Account Statistics
|
17
17
|
describe 'get_statistics' do
|
18
18
|
it 'gets account statistics' do
|
19
|
-
data, status_code
|
19
|
+
data, status_code = @statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID)
|
20
20
|
|
21
21
|
expect(status_code).to eq(200)
|
22
22
|
expect(data).to be_instance_of(Bandwidth::AccountStatistics)
|
@@ -0,0 +1,84 @@
|
|
1
|
+
require_relative '../call_utils'
|
2
|
+
|
3
|
+
# Integration Tests for Bandwidth::TranscriptionsApi
|
4
|
+
describe 'TranscriptionsApi 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
|
+
end
|
11
|
+
@transcriptions_api_instance = Bandwidth::TranscriptionsApi.new
|
12
|
+
@calls_api_instance = Bandwidth::CallsApi.new
|
13
|
+
|
14
|
+
# transcription info
|
15
|
+
$manteca_test_id = setup_manteca('CALL')
|
16
|
+
$manteca_call_id = create_manteca_call($manteca_test_id, '/bxml/idle', @calls_api_instance)
|
17
|
+
$transcription_id = ''
|
18
|
+
end
|
19
|
+
|
20
|
+
after(:all) do
|
21
|
+
WebMock.disable_net_connect!
|
22
|
+
end
|
23
|
+
|
24
|
+
# Create Call Transcription
|
25
|
+
describe 'create_call_transcription' do
|
26
|
+
it 'creates a call transcription' do
|
27
|
+
sleep(SLEEP_TIME_S)
|
28
|
+
|
29
|
+
start_transcription_bxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><StartTranscription name=\"#{$manteca_call_id}\" tracks=\"inbound\"></StartTranscription><Pause duration=\"6\"/></Response>"
|
30
|
+
_start_data, start_status_code = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, start_transcription_bxml)
|
31
|
+
expect(start_status_code).to eq(204)
|
32
|
+
sleep(SLEEP_TIME_S)
|
33
|
+
|
34
|
+
stop_transcription_bxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><StopTranscription name=\"#{$manteca_call_id}\"></StopTranscription></Response>"
|
35
|
+
_stop_data, stop_status_code = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, stop_transcription_bxml)
|
36
|
+
expect(stop_status_code).to eq(204)
|
37
|
+
sleep(SLEEP_TIME_S)
|
38
|
+
|
39
|
+
_complete_data, complete_status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $complete_call_body)
|
40
|
+
expect(complete_status_code).to eq(200)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# List Real Time Call Transcriptions
|
45
|
+
describe 'list_real_time_transcriptions' do
|
46
|
+
it 'lists call transcriptions' do
|
47
|
+
sleep(SLEEP_TIME_S * 20)
|
48
|
+
data, status_code, _headers = @transcriptions_api_instance.list_real_time_transcriptions_with_http_info(BW_ACCOUNT_ID, $manteca_call_id)
|
49
|
+
|
50
|
+
expect(status_code).to eq(200)
|
51
|
+
expect(data).to be_instance_of(Array)
|
52
|
+
expect(data[0]).to be_instance_of(Bandwidth::CallTranscriptionMetadata)
|
53
|
+
expect(data[0].transcription_id).to be_instance_of(String)
|
54
|
+
expect(data[0].transcription_url).to be_instance_of(String)
|
55
|
+
$transcription_id = data[0].transcription_id
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Get Real Time Call Transcription
|
60
|
+
describe 'get_real_time_transcription' do
|
61
|
+
it 'gets the specified call transcription' do
|
62
|
+
data, status_code, _headers = @transcriptions_api_instance.get_real_time_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $transcription_id)
|
63
|
+
|
64
|
+
expect(status_code).to eq(200)
|
65
|
+
expect(data).to be_instance_of(Bandwidth::CallTranscriptionResponse)
|
66
|
+
expect(data.account_id).to eq(BW_ACCOUNT_ID)
|
67
|
+
expect(data.call_id).to eq($manteca_call_id)
|
68
|
+
expect(data.transcription_id).to eq($transcription_id)
|
69
|
+
expect(data.tracks).to be_instance_of(Array)
|
70
|
+
expect(data.tracks[0]).to be_instance_of(Bandwidth::CallTranscription)
|
71
|
+
expect(data.tracks[0].track).to eq('inbound')
|
72
|
+
expect(data.tracks[0].confidence).to be_instance_of(Float)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Delete Real Time Call Transcription
|
77
|
+
describe 'delete_real_time_transcription' do
|
78
|
+
it 'deletes the specified call transcription' do
|
79
|
+
_data, status_code = @transcriptions_api_instance.delete_real_time_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $transcription_id)
|
80
|
+
|
81
|
+
expect(status_code).to eq(200) # This is a bug in the API, it should return 204. VAPI-1863 should fix this.
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Test Coverage Configuration
|
2
2
|
require 'simplecov'
|
3
3
|
SimpleCov.start do
|
4
|
-
add_filter 'spec/
|
4
|
+
add_filter 'spec/smoke'
|
5
5
|
add_filter 'spec/call_utils.rb'
|
6
6
|
add_filter do |source_file|
|
7
7
|
if !source_file.filename.include? 'bandwidth-sdk/models' then
|
@@ -89,7 +89,7 @@ RSpec.configure do |config|
|
|
89
89
|
config.password = BW_PASSWORD
|
90
90
|
end
|
91
91
|
calls_api = Bandwidth::CallsApi.new
|
92
|
-
|
92
|
+
cleanup_calls($active_calls, calls_api)
|
93
93
|
}
|
94
94
|
|
95
95
|
# rspec-expectations config goes here. You can use an alternate
|
@@ -6,6 +6,7 @@ describe 'CallsApi' do
|
|
6
6
|
let(:call_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}" }
|
7
7
|
let(:call_timeout) { 30.0 }
|
8
8
|
let(:callback_timeout) { 15.0 }
|
9
|
+
let(:privacy) { false }
|
9
10
|
let(:display_name) { 'Ruby SDK' }
|
10
11
|
let(:answer_method) { Bandwidth::CallbackMethodEnum::POST }
|
11
12
|
let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' }
|
@@ -72,6 +73,7 @@ describe 'CallsApi' do
|
|
72
73
|
application_id: BW_VOICE_APPLICATION_ID,
|
73
74
|
to: USER_NUMBER,
|
74
75
|
from: BW_NUMBER,
|
76
|
+
privacy: privacy,
|
75
77
|
display_name: display_name,
|
76
78
|
answer_url: answer_url,
|
77
79
|
answer_fallback_url: answer_fallback_url,
|
@@ -180,7 +182,7 @@ describe 'CallsApi' do
|
|
180
182
|
|
181
183
|
it 'causes an ArgumentError for a missing account_id' do
|
182
184
|
expect {
|
183
|
-
|
185
|
+
@calls_api_instance.get_call_state(nil, '')
|
184
186
|
}.to raise_error(ArgumentError)
|
185
187
|
end
|
186
188
|
|
@@ -202,7 +204,7 @@ describe 'CallsApi' do
|
|
202
204
|
redirect_url: MANTECA_BASE_URL + '/bxml/pause'
|
203
205
|
)
|
204
206
|
|
205
|
-
|
207
|
+
_data, status_code, headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, update_call_body)
|
206
208
|
|
207
209
|
expect(status_code).to eq(200)
|
208
210
|
expect(headers).to eq(update_call_headers_stub)
|
@@ -210,7 +212,7 @@ describe 'CallsApi' do
|
|
210
212
|
|
211
213
|
it 'causes an ArgumentError for a missing account_id' do
|
212
214
|
expect {
|
213
|
-
|
215
|
+
@calls_api_instance.update_call(nil, '', {})
|
214
216
|
}.to raise_error(ArgumentError)
|
215
217
|
end
|
216
218
|
|
@@ -235,7 +237,7 @@ describe 'CallsApi' do
|
|
235
237
|
|
236
238
|
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>'
|
237
239
|
|
238
|
-
|
240
|
+
_data, status_code = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, update_bxml)
|
239
241
|
|
240
242
|
expect(status_code).to eq(204)
|
241
243
|
end
|
@@ -61,7 +61,7 @@ describe 'ConferencesApi' do
|
|
61
61
|
|
62
62
|
it 'causes an ArgumentError for a missing account_id' do
|
63
63
|
expect {
|
64
|
-
|
64
|
+
@conferences_api_instance.download_conference_recording(nil, '', '')
|
65
65
|
}.to raise_error(ArgumentError)
|
66
66
|
end
|
67
67
|
|
@@ -107,7 +107,7 @@ describe 'ConferencesApi' do
|
|
107
107
|
|
108
108
|
it 'causes an ArgumentError for a missing account_id' do
|
109
109
|
expect {
|
110
|
-
|
110
|
+
@conferences_api_instance.get_conference(nil, '')
|
111
111
|
}.to raise_error(ArgumentError)
|
112
112
|
end
|
113
113
|
|
@@ -139,7 +139,7 @@ describe 'ConferencesApi' do
|
|
139
139
|
|
140
140
|
it 'causes an ArgumentError for a missing account_id' do
|
141
141
|
expect {
|
142
|
-
|
142
|
+
@conferences_api_instance.get_conference_member(nil, '', '')
|
143
143
|
}.to raise_error(ArgumentError)
|
144
144
|
end
|
145
145
|
|
@@ -182,7 +182,7 @@ describe 'ConferencesApi' do
|
|
182
182
|
|
183
183
|
it 'causes an ArgumentError for a missing account_id' do
|
184
184
|
expect {
|
185
|
-
|
185
|
+
@conferences_api_instance.get_conference_recording(nil, '', '')
|
186
186
|
}.to raise_error(ArgumentError)
|
187
187
|
end
|
188
188
|
|
@@ -226,7 +226,7 @@ describe 'ConferencesApi' do
|
|
226
226
|
|
227
227
|
it 'causes an ArgumentError for a missing account_id' do
|
228
228
|
expect {
|
229
|
-
|
229
|
+
@conferences_api_instance.list_conference_recordings(nil, '')
|
230
230
|
}.to raise_error(ArgumentError)
|
231
231
|
end
|
232
232
|
|
@@ -263,7 +263,7 @@ describe 'ConferencesApi' do
|
|
263
263
|
|
264
264
|
it 'causes an ArgumentError for a missing account_id' do
|
265
265
|
expect {
|
266
|
-
|
266
|
+
@conferences_api_instance.list_conferences(nil, {})
|
267
267
|
}.to raise_error(ArgumentError)
|
268
268
|
end
|
269
269
|
|
@@ -298,13 +298,13 @@ describe 'ConferencesApi' do
|
|
298
298
|
fallback_password: 'password'
|
299
299
|
)
|
300
300
|
|
301
|
-
|
301
|
+
_data, status_code = @conferences_api_instance.update_conference_with_http_info(BW_ACCOUNT_ID, conference_id, update_conference_body)
|
302
302
|
expect(status_code).to eq(204)
|
303
303
|
end
|
304
304
|
|
305
305
|
it 'causes an ArgumentError for a missing account_id' do
|
306
306
|
expect {
|
307
|
-
|
307
|
+
@conferences_api_instance.update_conference(nil, '', '')
|
308
308
|
}.to raise_error(ArgumentError)
|
309
309
|
end
|
310
310
|
|
@@ -329,13 +329,13 @@ describe 'ConferencesApi' do
|
|
329
329
|
|
330
330
|
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>'
|
331
331
|
|
332
|
-
|
332
|
+
_data, status_code = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, conference_id, update_bxml)
|
333
333
|
expect(status_code).to eq(204)
|
334
334
|
end
|
335
335
|
|
336
336
|
it 'causes an ArgumentError for a missing account_id' do
|
337
337
|
expect {
|
338
|
-
|
338
|
+
@conferences_api_instance.update_conference_bxml(nil, '', '')
|
339
339
|
}.to raise_error(ArgumentError)
|
340
340
|
end
|
341
341
|
|
@@ -362,13 +362,13 @@ describe 'ConferencesApi' do
|
|
362
362
|
mute: false
|
363
363
|
)
|
364
364
|
|
365
|
-
|
365
|
+
_data, status_code = @conferences_api_instance.update_conference_member_with_http_info(BW_ACCOUNT_ID, conference_id, call_id, update_conference_member)
|
366
366
|
expect(status_code).to eq(204)
|
367
367
|
end
|
368
368
|
|
369
369
|
it 'causes an ArgumentError for a missing account_id' do
|
370
370
|
expect {
|
371
|
-
|
371
|
+
@conferences_api_instance.update_conference_member(nil, '', '', {})
|
372
372
|
}.to raise_error(ArgumentError)
|
373
373
|
end
|
374
374
|
|
@@ -30,14 +30,14 @@ describe 'MediaApi' do
|
|
30
30
|
stub_request(:delete, "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/media/#{media_name}").
|
31
31
|
to_return(status: 204)
|
32
32
|
|
33
|
-
|
33
|
+
_data, status_code = @media_api_instance.delete_media_with_http_info(BW_ACCOUNT_ID, media_name)
|
34
34
|
|
35
35
|
expect(status_code).to eq(204)
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'causes an ArgumentError for a missing account_id' do
|
39
39
|
expect {
|
40
|
-
|
40
|
+
@media_api_instance.delete_media(nil, '')
|
41
41
|
}.to raise_error(ArgumentError)
|
42
42
|
end
|
43
43
|
|
@@ -63,7 +63,7 @@ describe 'MediaApi' do
|
|
63
63
|
|
64
64
|
it 'causes an ArgumentError for a missing account_id' do
|
65
65
|
expect {
|
66
|
-
|
66
|
+
@media_api_instance.get_media(nil, '')
|
67
67
|
}.to raise_error(ArgumentError)
|
68
68
|
end
|
69
69
|
|
@@ -93,7 +93,7 @@ describe 'MediaApi' do
|
|
93
93
|
|
94
94
|
it 'causes an ArgumentError for a missing account_id' do
|
95
95
|
expect {
|
96
|
-
|
96
|
+
@media_api_instance.list_media(nil)
|
97
97
|
}.to raise_error(ArgumentError)
|
98
98
|
end
|
99
99
|
end
|
@@ -104,13 +104,13 @@ describe 'MediaApi' do
|
|
104
104
|
stub_request(:put, "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/media/#{media_name}").
|
105
105
|
to_return(status: 204)
|
106
106
|
|
107
|
-
|
107
|
+
_data, status_code = @media_api_instance.upload_media_with_http_info(BW_ACCOUNT_ID, media_name, media_data)
|
108
108
|
expect(status_code).to eq(204)
|
109
109
|
end
|
110
110
|
|
111
111
|
it 'causes an ArgumentError for a missing account_id' do
|
112
112
|
expect {
|
113
|
-
|
113
|
+
@media_api_instance.upload_media(nil, '', '')
|
114
114
|
}.to raise_error(ArgumentError)
|
115
115
|
end
|
116
116
|
|
@@ -114,7 +114,7 @@ describe 'MessagesApi' do
|
|
114
114
|
|
115
115
|
it 'causes an ArgumentError for a missing account_id' do
|
116
116
|
expect {
|
117
|
-
|
117
|
+
@messaging_api_instance.create_message(nil, {})
|
118
118
|
}.to raise_error(ArgumentError)
|
119
119
|
end
|
120
120
|
|
@@ -186,7 +186,7 @@ describe 'MessagesApi' do
|
|
186
186
|
|
187
187
|
it 'causes an ArgumentError for a missing account_id' do
|
188
188
|
expect {
|
189
|
-
|
189
|
+
@messaging_api_instance.list_messages(nil)
|
190
190
|
}.to raise_error(ArgumentError)
|
191
191
|
end
|
192
192
|
end
|