bandwidth-sdk 11.2.0 → 12.0.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 +29 -25
- data/README.md +14 -8
- data/bandwidth.yml +223 -17
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +612 -209
- data/coverage/index.html +14875 -10424
- data/custom_templates/README.mustache +4 -4
- data/docs/CallRecordingMetadata.md +1 -1
- data/docs/CallTranscription.md +24 -0
- data/docs/CallTranscriptionMetadata.md +20 -0
- data/docs/CallTranscriptionResponse.md +24 -0
- data/docs/RecordingAvailableCallback.md +2 -2
- data/docs/RecordingTranscriptionMetadata.md +24 -0
- data/docs/RecordingTranscriptions.md +18 -0
- data/docs/RecordingsApi.md +49 -49
- data/docs/TranscriptionsApi.md +229 -0
- 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/bxml/verbs/transfer.rb +2 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +1 -1
- 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/recording_available_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/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +6 -2
- data/spec/api/calls_api_spec.rb +4 -4
- data/spec/api/conferences_api_spec.rb +12 -12
- data/spec/api/media_api_spec.rb +6 -6
- data/spec/api/messages_api_spec.rb +2 -2
- data/spec/api/mfa_api_spec.rb +6 -6
- data/spec/api/phone_number_lookup_api_spec.rb +2 -2
- data/spec/api/recordings_api_spec.rb +30 -30
- data/spec/api/statistics_api_spec.rb +1 -1
- data/spec/api/transcriptions_api_spec.rb +130 -0
- data/spec/api_client_spec.rb +2 -2
- data/spec/integration/calls_api_integration_spec.rb +7 -7
- data/spec/integration/conferences_api_integration_spec.rb +9 -9
- data/spec/integration/media_api_integration_spec.rb +7 -7
- data/spec/integration/messages_api_integration_spec.rb +3 -3
- data/spec/integration/mfa_api_integration_spec.rb +3 -3
- data/spec/integration/phone_number_lookup_api_integration_spec.rb +2 -2
- data/spec/integration/recordings_api_integration_spec.rb +14 -14
- data/spec/integration/statistics_api_integration_spec.rb +1 -1
- data/spec/integration/transcriptions_api_integration_spec.rb +84 -0
- data/spec/models/bxml/verbs/transfer_spec.rb +7 -5
- data/spec/spec_helper.rb +1 -1
- metadata +50 -34
@@ -20,8 +20,8 @@ describe 'RecordingsApi' do
|
|
20
20
|
let(:download_call_recording_headers_stub) { { 'content-type' => 'audio/vnd.wave', 'content-length' => "#{download_call_recording_body_stub.length}" } }
|
21
21
|
let(:get_call_recording_headers_stub) { { 'content-type' => 'application/json' } }
|
22
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(:
|
24
|
-
let(:
|
23
|
+
let(:get_recording_transcription_headers_stub) { { 'content-type' => 'application/json' } }
|
24
|
+
let(:get_recording_transcription_body_stub) { "{\"transcripts\":[{\"text\":\"#{text}\",\"confidence\":#{confidence}}]}" }
|
25
25
|
let(:list_account_call_recordings_headers_stub) { { 'content-type' => 'application/json' } }
|
26
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
27
|
let(:list_call_recordings_headers_stub) { { 'content-type' => 'application/json' } }
|
@@ -42,32 +42,32 @@ describe 'RecordingsApi' do
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
# Delete Transcription
|
46
|
-
describe '
|
45
|
+
# Delete Recording Transcription
|
46
|
+
describe 'delete_recording_transcription' do
|
47
47
|
it 'deletes the completed call recording transcription' do
|
48
48
|
stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/transcription").
|
49
49
|
to_return(status: 204)
|
50
50
|
|
51
|
-
|
51
|
+
_data, status_code = @recordings_api_instance.delete_recording_transcription_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
|
52
52
|
|
53
53
|
expect(status_code).to eq(204)
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'causes an ArgumentError for a missing account_id' do
|
57
57
|
expect {
|
58
|
-
|
58
|
+
@recordings_api_instance.delete_recording_transcription(nil, '', '')
|
59
59
|
}.to raise_error(ArgumentError)
|
60
60
|
end
|
61
61
|
|
62
62
|
it 'causes an ArgumentError for a missing call_id' do
|
63
63
|
expect {
|
64
|
-
@recordings_api_instance.
|
64
|
+
@recordings_api_instance.delete_recording_transcription(BW_ACCOUNT_ID, nil, '')
|
65
65
|
}.to raise_error(ArgumentError)
|
66
66
|
end
|
67
67
|
|
68
68
|
it 'causes an ArgumentError for a missing recording_id' do
|
69
69
|
expect {
|
70
|
-
@recordings_api_instance.
|
70
|
+
@recordings_api_instance.delete_recording_transcription(BW_ACCOUNT_ID, '', nil)
|
71
71
|
}.to raise_error(ArgumentError)
|
72
72
|
end
|
73
73
|
end
|
@@ -78,14 +78,14 @@ describe 'RecordingsApi' do
|
|
78
78
|
stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}").
|
79
79
|
to_return(status: 204)
|
80
80
|
|
81
|
-
|
81
|
+
_data, status_code = @recordings_api_instance.delete_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
|
82
82
|
|
83
83
|
expect(status_code).to eq(204)
|
84
84
|
end
|
85
85
|
|
86
86
|
it 'causes an ArgumentError for a missing account_id' do
|
87
87
|
expect {
|
88
|
-
|
88
|
+
@recordings_api_instance.delete_recording(nil, '', '')
|
89
89
|
}.to raise_error(ArgumentError)
|
90
90
|
end
|
91
91
|
|
@@ -108,14 +108,14 @@ describe 'RecordingsApi' do
|
|
108
108
|
stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings/#{recording_id}/media").
|
109
109
|
to_return(status: 204)
|
110
110
|
|
111
|
-
|
111
|
+
_data, status_code = @recordings_api_instance.delete_recording_media_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
|
112
112
|
|
113
113
|
expect(status_code).to eq(204)
|
114
114
|
end
|
115
115
|
|
116
116
|
it 'causes an ArgumentError for a missing account_id' do
|
117
117
|
expect {
|
118
|
-
|
118
|
+
@recordings_api_instance.delete_recording_media(nil, '', '')
|
119
119
|
}.to raise_error(ArgumentError)
|
120
120
|
end
|
121
121
|
|
@@ -147,7 +147,7 @@ describe 'RecordingsApi' do
|
|
147
147
|
|
148
148
|
it 'causes an ArgumentError for a missing account_id' do
|
149
149
|
expect {
|
150
|
-
|
150
|
+
@recordings_api_instance.download_call_recording(nil, '', '')
|
151
151
|
}.to raise_error(ArgumentError)
|
152
152
|
end
|
153
153
|
|
@@ -193,7 +193,7 @@ describe 'RecordingsApi' do
|
|
193
193
|
|
194
194
|
it 'causes an ArgumentError for a missing account_id' do
|
195
195
|
expect {
|
196
|
-
|
196
|
+
@recordings_api_instance.get_call_recording(nil, '', '')
|
197
197
|
}.to raise_error(ArgumentError)
|
198
198
|
end
|
199
199
|
|
@@ -210,16 +210,16 @@ describe 'RecordingsApi' do
|
|
210
210
|
end
|
211
211
|
end
|
212
212
|
|
213
|
-
# Get Transcription
|
214
|
-
describe '
|
213
|
+
# Get Recording Transcription
|
214
|
+
describe 'get_recording_transcription' do
|
215
215
|
it 'gets the completed call recording transcription' do
|
216
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:
|
217
|
+
to_return(status: 200, headers: get_recording_transcription_headers_stub, body: get_recording_transcription_body_stub)
|
218
218
|
|
219
|
-
data, status_code
|
219
|
+
data, status_code = @recordings_api_instance.get_recording_transcription_with_http_info(BW_ACCOUNT_ID, call_id, recording_id)
|
220
220
|
|
221
221
|
expect(status_code).to eq(200)
|
222
|
-
expect(data).to be_instance_of(Bandwidth::
|
222
|
+
expect(data).to be_instance_of(Bandwidth::RecordingTranscriptions)
|
223
223
|
expect(data.transcripts).to be_instance_of(Array)
|
224
224
|
expect(data.transcripts[0]).to be_instance_of(Bandwidth::Transcription)
|
225
225
|
expect(data.transcripts[0].text).to eq(text)
|
@@ -228,19 +228,19 @@ describe 'RecordingsApi' do
|
|
228
228
|
|
229
229
|
it 'causes an ArgumentError for a missing account_id' do
|
230
230
|
expect {
|
231
|
-
|
231
|
+
@recordings_api_instance.get_recording_transcription(nil, '', '')
|
232
232
|
}.to raise_error(ArgumentError)
|
233
233
|
end
|
234
234
|
|
235
235
|
it 'causes an ArgumentError for a missing call_id' do
|
236
236
|
expect {
|
237
|
-
@recordings_api_instance.
|
237
|
+
@recordings_api_instance.get_recording_transcription(BW_ACCOUNT_ID, nil, '')
|
238
238
|
}.to raise_error(ArgumentError)
|
239
239
|
end
|
240
240
|
|
241
241
|
it 'causes an ArgumentError for a missing recording_id' do
|
242
242
|
expect {
|
243
|
-
@recordings_api_instance.
|
243
|
+
@recordings_api_instance.get_recording_transcription(BW_ACCOUNT_ID, '', nil)
|
244
244
|
}.to raise_error(ArgumentError)
|
245
245
|
end
|
246
246
|
end
|
@@ -251,7 +251,7 @@ describe 'RecordingsApi' do
|
|
251
251
|
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/recordings").
|
252
252
|
to_return(status: 200, headers: list_account_call_recordings_headers_stub, body: list_account_call_recordings_body_stub)
|
253
253
|
|
254
|
-
data, status_code
|
254
|
+
data, status_code = @recordings_api_instance.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID)
|
255
255
|
|
256
256
|
expect(status_code).to eq(200)
|
257
257
|
expect(data).to be_instance_of(Array)
|
@@ -274,7 +274,7 @@ describe 'RecordingsApi' do
|
|
274
274
|
|
275
275
|
it 'causes an ArgumentError for a missing account_id' do
|
276
276
|
expect {
|
277
|
-
|
277
|
+
@recordings_api_instance.list_account_call_recordings(nil)
|
278
278
|
}.to raise_error(ArgumentError)
|
279
279
|
end
|
280
280
|
end
|
@@ -285,7 +285,7 @@ describe 'RecordingsApi' do
|
|
285
285
|
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/recordings").
|
286
286
|
to_return(status: 200, headers: list_call_recordings_headers_stub, body: list_call_recordings_body_stub)
|
287
287
|
|
288
|
-
data, status_code
|
288
|
+
data, status_code = @recordings_api_instance.list_call_recordings_with_http_info(BW_ACCOUNT_ID, call_id)
|
289
289
|
|
290
290
|
expect(status_code).to eq(200)
|
291
291
|
expect(data).to be_instance_of(Array)
|
@@ -307,7 +307,7 @@ describe 'RecordingsApi' do
|
|
307
307
|
|
308
308
|
it 'causes an ArgumentError for a missing account_id' do
|
309
309
|
expect {
|
310
|
-
|
310
|
+
@recordings_api_instance.list_call_recordings(nil, '')
|
311
311
|
}.to raise_error(ArgumentError)
|
312
312
|
end
|
313
313
|
|
@@ -329,14 +329,14 @@ describe 'RecordingsApi' do
|
|
329
329
|
tag: test_id
|
330
330
|
)
|
331
331
|
|
332
|
-
|
332
|
+
_data, status_code = @recordings_api_instance.transcribe_call_recording_with_http_info(BW_ACCOUNT_ID, call_id, recording_id, transcribe_recording)
|
333
333
|
|
334
334
|
expect(status_code).to eq(204)
|
335
335
|
end
|
336
336
|
|
337
337
|
it 'causes an ArgumentError for a missing account_id' do
|
338
338
|
expect {
|
339
|
-
|
339
|
+
@recordings_api_instance.transcribe_call_recording(nil, '', '', '')
|
340
340
|
}.to raise_error(ArgumentError)
|
341
341
|
end
|
342
342
|
|
@@ -369,14 +369,14 @@ describe 'RecordingsApi' do
|
|
369
369
|
state: Bandwidth::RecordingStateEnum::PAUSED
|
370
370
|
)
|
371
371
|
|
372
|
-
|
372
|
+
_data, status_code = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, call_id, pause_recording)
|
373
373
|
|
374
374
|
expect(status_code).to eq(200)
|
375
375
|
end
|
376
376
|
|
377
377
|
it 'causes an ArgumentError for a missing account_id' do
|
378
378
|
expect {
|
379
|
-
|
379
|
+
@recordings_api_instance.update_call_recording_state(nil, '', {})
|
380
380
|
}.to raise_error(ArgumentError)
|
381
381
|
end
|
382
382
|
|
@@ -0,0 +1,130 @@
|
|
1
|
+
# Unit tests for Bandwidth::TranscriptionsApi
|
2
|
+
describe 'TranscriptionsApi' do
|
3
|
+
# transcription info
|
4
|
+
let(:call_id) { 'c-3f758f24-40c0bd9f-0a8e-4ab6-88d4-c88a2e961c7d' }
|
5
|
+
let(:transcription_id) { 't-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b' }
|
6
|
+
let(:transcription_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/transcriptions/#{transcription_id}" }
|
7
|
+
let(:detected_language) { 'en-US' }
|
8
|
+
let(:track) { 'inbound' }
|
9
|
+
let(:text) { 'Hello World! This is an example.' }
|
10
|
+
let(:confidence) { 0.9 }
|
11
|
+
|
12
|
+
# stubs
|
13
|
+
let(:list_real_time_transcriptions_headers_stub) { { 'content-type' => 'application/json' } }
|
14
|
+
let(:list_real_time_transcriptions_body_stub) { "[{\"transcriptionId\":\"#{transcription_id}\",\"transcriptionUrl\":\"#{transcription_url}\"}]" }
|
15
|
+
let(:get_real_time_transcription_headers_stub) { { 'content-type' => 'application/json' } }
|
16
|
+
let(:get_real_time_transcription_body_stub) { "{\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"transcriptionId\":\"#{transcription_id}\",\"tracks\":[{\"detectedLanguage\":\"#{detected_language}\",\"track\":\"#{track}\",\"text\":\"#{text}\",\"confidence\":#{confidence}}]}" }
|
17
|
+
|
18
|
+
before(:all) do
|
19
|
+
Bandwidth.configure do |config|
|
20
|
+
config.debugging = true
|
21
|
+
end
|
22
|
+
@transcriptions_api_instance = Bandwidth::TranscriptionsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
describe 'test an instance of TranscriptionsApi' do
|
26
|
+
it 'should create an instance of TranscriptionsApi' do
|
27
|
+
expect(@transcriptions_api_instance).to be_instance_of(Bandwidth::TranscriptionsApi)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# Delete Call Transcription
|
32
|
+
describe 'delete_real_time_transcription' do
|
33
|
+
it 'deletes the specified call transcription' do
|
34
|
+
stub_request(:delete, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/transcriptions/#{transcription_id}").
|
35
|
+
to_return(status: 204)
|
36
|
+
|
37
|
+
_data, status_code = @transcriptions_api_instance.delete_real_time_transcription_with_http_info(BW_ACCOUNT_ID, call_id, transcription_id)
|
38
|
+
|
39
|
+
expect(status_code).to eq(204)
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'causes an ArgumentError for a missing account_id' do
|
43
|
+
expect {
|
44
|
+
@transcriptions_api_instance.delete_real_time_transcription(nil, '', '')
|
45
|
+
}.to raise_error(ArgumentError)
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'causes an ArgumentError for a missing call_id' do
|
49
|
+
expect {
|
50
|
+
@transcriptions_api_instance.delete_real_time_transcription(BW_ACCOUNT_ID, nil, '')
|
51
|
+
}.to raise_error(ArgumentError)
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'causes an ArgumentError for a missing transcription_id' do
|
55
|
+
expect {
|
56
|
+
@transcriptions_api_instance.delete_real_time_transcription(BW_ACCOUNT_ID, '', nil)
|
57
|
+
}.to raise_error(ArgumentError)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# List Call Transcriptions
|
62
|
+
describe 'list_real_time_transcriptions' do
|
63
|
+
it 'lists call transcriptions' do
|
64
|
+
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/transcriptions").
|
65
|
+
to_return(status: 200, headers: list_real_time_transcriptions_headers_stub, body: list_real_time_transcriptions_body_stub)
|
66
|
+
|
67
|
+
data, status_code, headers = @transcriptions_api_instance.list_real_time_transcriptions_with_http_info(BW_ACCOUNT_ID, call_id)
|
68
|
+
|
69
|
+
expect(status_code).to eq(200)
|
70
|
+
expect(headers).to eq(list_real_time_transcriptions_headers_stub)
|
71
|
+
expect(data).to be_instance_of(Array)
|
72
|
+
expect(data[0]).to be_instance_of(Bandwidth::CallTranscriptionMetadata)
|
73
|
+
expect(data[0].transcription_id).to eq(transcription_id)
|
74
|
+
expect(data[0].transcription_url).to eq(transcription_url)
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'causes an ArgumentError for a missing account_id' do
|
78
|
+
expect {
|
79
|
+
@transcriptions_api_instance.list_real_time_transcriptions(nil, '')
|
80
|
+
}.to raise_error(ArgumentError)
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'causes an ArgumentError for a missing call_id' do
|
84
|
+
expect {
|
85
|
+
@transcriptions_api_instance.list_real_time_transcriptions(BW_ACCOUNT_ID, nil)
|
86
|
+
}.to raise_error(ArgumentError)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# Get Call Transcription
|
91
|
+
describe 'get_real_time_transcription' do
|
92
|
+
it 'gets the specified call transcription' do
|
93
|
+
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/transcriptions/#{transcription_id}").
|
94
|
+
to_return(status: 200, headers: get_real_time_transcription_headers_stub, body: get_real_time_transcription_body_stub)
|
95
|
+
|
96
|
+
data, status_code, headers = @transcriptions_api_instance.get_real_time_transcription_with_http_info(BW_ACCOUNT_ID, call_id, transcription_id)
|
97
|
+
|
98
|
+
expect(status_code).to eq(200)
|
99
|
+
expect(headers).to eq(get_real_time_transcription_headers_stub)
|
100
|
+
expect(data).to be_instance_of(Bandwidth::CallTranscriptionResponse)
|
101
|
+
expect(data.account_id).to eq(BW_ACCOUNT_ID)
|
102
|
+
expect(data.call_id).to eq(call_id)
|
103
|
+
expect(data.transcription_id).to eq(transcription_id)
|
104
|
+
expect(data.tracks).to be_instance_of(Array)
|
105
|
+
expect(data.tracks[0]).to be_instance_of(Bandwidth::CallTranscription)
|
106
|
+
expect(data.tracks[0].detected_language).to eq(detected_language)
|
107
|
+
expect(data.tracks[0].track).to eq(track)
|
108
|
+
expect(data.tracks[0].text).to eq(text)
|
109
|
+
expect(data.tracks[0].confidence).to eq(confidence)
|
110
|
+
end
|
111
|
+
|
112
|
+
it 'causes an ArgumentError for a missing account_id' do
|
113
|
+
expect {
|
114
|
+
@transcriptions_api_instance.get_real_time_transcription(nil, '', '')
|
115
|
+
}.to raise_error(ArgumentError)
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'causes an ArgumentError for a missing call_id' do
|
119
|
+
expect {
|
120
|
+
@transcriptions_api_instance.get_real_time_transcription(BW_ACCOUNT_ID, nil, '')
|
121
|
+
}.to raise_error(ArgumentError)
|
122
|
+
end
|
123
|
+
|
124
|
+
it 'causes an ArgumentError for a missing transcription_id' do
|
125
|
+
expect {
|
126
|
+
@transcriptions_api_instance.get_real_time_transcription(BW_ACCOUNT_ID, '', nil)
|
127
|
+
}.to raise_error(ArgumentError)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
data/spec/api_client_spec.rb
CHANGED
@@ -111,7 +111,7 @@ describe Bandwidth::ApiClient do
|
|
111
111
|
auth_names: ['Basic'],
|
112
112
|
return_type: nil
|
113
113
|
}
|
114
|
-
data, status_code
|
114
|
+
data, status_code = api_client.call_api(:POST, 'path', opts)
|
115
115
|
|
116
116
|
expect(status_code).to eq(204)
|
117
117
|
expect(data).to be nil
|
@@ -130,7 +130,7 @@ describe Bandwidth::ApiClient do
|
|
130
130
|
auth_names: ['Basic'],
|
131
131
|
return_type: nil
|
132
132
|
}
|
133
|
-
data, status_code
|
133
|
+
data, status_code = api_client.call_api(:POST, 'path', opts)
|
134
134
|
|
135
135
|
expect(status_code).to eq(204)
|
136
136
|
expect(data).to be nil
|
@@ -58,7 +58,7 @@ describe 'CallsApi Integration Tests' do
|
|
58
58
|
callback_timeout: callback_timeout
|
59
59
|
)
|
60
60
|
|
61
|
-
data, status_code
|
61
|
+
data, status_code = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
|
62
62
|
|
63
63
|
expect(status_code).to eq(201)
|
64
64
|
expect(data).to be_instance_of(Bandwidth::CreateCallResponse)
|
@@ -84,7 +84,7 @@ describe 'CallsApi Integration Tests' do
|
|
84
84
|
# Get Calls
|
85
85
|
describe '#list_calls' do
|
86
86
|
it 'gets a list of calls' do
|
87
|
-
data, status_code
|
87
|
+
data, status_code = @calls_api_instance.list_calls_with_http_info(BW_ACCOUNT_ID)
|
88
88
|
|
89
89
|
expect(status_code).to eq(200)
|
90
90
|
expect(data).to be_instance_of(Array)
|
@@ -98,7 +98,7 @@ describe 'CallsApi Integration Tests' do
|
|
98
98
|
describe 'get_call_state' do
|
99
99
|
it 'gets the call state' do
|
100
100
|
sleep(40) # wait 40s for voice API to update call status
|
101
|
-
data, status_code
|
101
|
+
data, status_code = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
|
102
102
|
|
103
103
|
expect(status_code).to eq(200)
|
104
104
|
expect(data).to be_instance_of(Bandwidth::CallState)
|
@@ -123,11 +123,11 @@ describe 'CallsApi Integration Tests' do
|
|
123
123
|
update_call_id = create_manteca_call(@calls_api_instance)
|
124
124
|
sleep(SLEEP_TIME_S)
|
125
125
|
|
126
|
-
|
126
|
+
_update_data, update_status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, update_call_body)
|
127
127
|
expect(update_status_code).to eq(200)
|
128
128
|
sleep(SLEEP_TIME_S)
|
129
129
|
|
130
|
-
|
130
|
+
_complete_data, complete_status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
|
131
131
|
expect(complete_status_code).to eq(200)
|
132
132
|
end
|
133
133
|
end
|
@@ -139,11 +139,11 @@ describe 'CallsApi Integration Tests' do
|
|
139
139
|
sleep(SLEEP_TIME_S)
|
140
140
|
|
141
141
|
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>'
|
142
|
-
|
142
|
+
_update_data, update_status_code = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, update_call_id, update_bxml)
|
143
143
|
expect(update_status_code).to eq(204)
|
144
144
|
sleep(SLEEP_TIME_S)
|
145
145
|
|
146
|
-
|
146
|
+
_complete_data, complete_status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
|
147
147
|
expect(complete_status_code).to eq(200)
|
148
148
|
end
|
149
149
|
end
|
@@ -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)
|