bandwidth-sdk 12.1.0 → 13.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 +1 -2
- data/Gemfile.lock +11 -20
- data/README.md +2 -0
- data/bandwidth-sdk.gemspec +3 -1
- data/bandwidth.yml +28 -22
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +489 -756
- data/coverage/index.html +5225 -8162
- data/custom_templates/Gemfile.mustache +1 -2
- data/custom_templates/gemspec.mustache +2 -0
- data/docs/AnswerCallback.md +1 -1
- data/docs/BridgeCompleteCallback.md +1 -1
- data/docs/BridgeTargetCompleteCallback.md +1 -1
- data/docs/CallRecordingMetadata.md +2 -2
- data/docs/CallState.md +1 -1
- data/docs/CallTranscription.md +6 -6
- data/docs/CallTranscriptionDetectedLanguageEnum.md +15 -0
- data/docs/CallTranscriptionResponse.md +2 -2
- data/docs/CallTranscriptionTrackEnum.md +15 -0
- data/docs/ConferenceRecordingAvailableCallback.md +1 -1
- data/docs/ConferenceRecordingMetadata.md +1 -1
- 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/MessagingCodeResponse.md +1 -1
- data/docs/RecordingAvailableCallback.md +2 -2
- data/docs/RecordingCompleteCallback.md +2 -2
- data/docs/RecordingTranscriptionMetadata.md +1 -1
- data/docs/RedirectCallback.md +2 -2
- data/docs/TranscriptionAvailableCallback.md +2 -2
- data/docs/TranscriptionsApi.md +1 -1
- data/docs/TransferAnswerCallback.md +2 -2
- data/docs/TransferCompleteCallback.md +2 -2
- data/docs/TransferDisconnectCallback.md +2 -2
- data/lib/bandwidth-sdk/api/calls_api.rb +1 -1
- data/lib/bandwidth-sdk/api/conferences_api.rb +1 -1
- data/lib/bandwidth-sdk/api/media_api.rb +1 -1
- data/lib/bandwidth-sdk/api/messages_api.rb +1 -1
- data/lib/bandwidth-sdk/api/mfa_api.rb +1 -1
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +1 -1
- data/lib/bandwidth-sdk/api/recordings_api.rb +1 -1
- data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
- data/lib/bandwidth-sdk/api/transcriptions_api.rb +3 -3
- data/lib/bandwidth-sdk/api_client.rb +44 -41
- data/lib/bandwidth-sdk/api_error.rb +1 -1
- data/lib/bandwidth-sdk/configuration.rb +11 -1
- data/lib/bandwidth-sdk/models/account_statistics.rb +2 -2
- data/lib/bandwidth-sdk/models/answer_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/bxml/root.rb +0 -6
- data/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +0 -6
- data/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +0 -6
- data/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +0 -6
- data/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +0 -6
- data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +2 -2
- data/lib/bandwidth-sdk/models/call_state.rb +2 -2
- data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_transcription.rb +11 -37
- data/lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb +41 -0
- data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +2 -2
- data/lib/bandwidth-sdk/models/call_transcription_response.rb +2 -2
- data/lib/bandwidth-sdk/models/call_transcription_track_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/code_request.rb +2 -2
- data/lib/bandwidth-sdk/models/conference.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_member.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/create_call.rb +2 -2
- data/lib/bandwidth-sdk/models/create_call_response.rb +2 -2
- data/lib/bandwidth-sdk/models/create_lookup_response.rb +2 -2
- data/lib/bandwidth-sdk/models/create_message_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/deferred_result.rb +2 -2
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/diversion.rb +2 -2
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/field_error.rb +2 -2
- data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/gather_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/inbound_message_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +2 -2
- data/lib/bandwidth-sdk/models/initiate_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/list_message_item.rb +2 -2
- data/lib/bandwidth-sdk/models/lookup_request.rb +2 -2
- data/lib/bandwidth-sdk/models/lookup_result.rb +2 -2
- data/lib/bandwidth-sdk/models/lookup_status.rb +2 -2
- data/lib/bandwidth-sdk/models/lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +2 -2
- data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_result.rb +2 -2
- data/lib/bandwidth-sdk/models/media.rb +2 -2
- data/lib/bandwidth-sdk/models/message.rb +2 -2
- data/lib/bandwidth-sdk/models/message_delivered_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +2 -2
- data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_failed_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +2 -2
- data/lib/bandwidth-sdk/models/message_request.rb +2 -2
- data/lib/bandwidth-sdk/models/message_sending_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +2 -2
- data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/messages_list.rb +2 -2
- data/lib/bandwidth-sdk/models/messaging_code_response.rb +2 -2
- data/lib/bandwidth-sdk/models/messaging_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/mfa_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/page_info.rb +2 -2
- data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +3 -3
- data/lib/bandwidth-sdk/models/recording_transcriptions.rb +2 -2
- data/lib/bandwidth-sdk/models/redirect_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/stir_shaken.rb +2 -2
- data/lib/bandwidth-sdk/models/tag.rb +2 -2
- data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/transcribe_recording.rb +2 -2
- data/lib/bandwidth-sdk/models/transcription.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/models/update_call.rb +2 -2
- data/lib/bandwidth-sdk/models/update_call_recording.rb +2 -2
- data/lib/bandwidth-sdk/models/update_conference.rb +2 -2
- data/lib/bandwidth-sdk/models/update_conference_member.rb +2 -2
- data/lib/bandwidth-sdk/models/verify_code_request.rb +2 -2
- data/lib/bandwidth-sdk/models/verify_code_response.rb +2 -2
- data/lib/bandwidth-sdk/models/voice_api_error.rb +2 -2
- data/lib/bandwidth-sdk/models/voice_code_response.rb +2 -2
- data/lib/bandwidth-sdk/version.rb +2 -2
- data/lib/bandwidth-sdk.rb +3 -1
- data/openapitools.json +1 -1
- data/spec/call_utils.rb +1 -1
- data/spec/smoke/calls_api_spec.rb +1 -6
- data/spec/smoke/conferences_api_spec.rb +0 -5
- data/spec/smoke/media_api_spec.rb +0 -5
- data/spec/smoke/messages_api_spec.rb +0 -5
- data/spec/smoke/mfa_api_spec.rb +0 -5
- data/spec/smoke/phone_number_lookup_api_spec.rb +0 -5
- data/spec/smoke/recordings_api_spec.rb +0 -5
- data/spec/smoke/statistics_api_spec.rb +0 -5
- data/spec/smoke/transcriptions_api_spec.rb +0 -5
- data/spec/spec_helper.rb +11 -4
- data/spec/unit/api/calls_api_spec.rb +98 -128
- data/spec/unit/api/conferences_api_spec.rb +63 -126
- data/spec/unit/api/media_api_spec.rb +17 -32
- data/spec/unit/api/messages_api_spec.rb +46 -136
- data/spec/unit/api/mfa_api_spec.rb +8 -24
- data/spec/unit/api/phone_number_lookup_api_spec.rb +23 -37
- data/spec/unit/api/recordings_api_spec.rb +83 -110
- data/spec/unit/api/statistics_api_spec.rb +7 -15
- data/spec/unit/api/transcriptions_api_spec.rb +18 -37
- data/spec/unit/client/api_client_spec.rb +4 -4
- metadata +62 -44
@@ -1,47 +1,14 @@
|
|
1
1
|
# Unit tests for Bandwidth::CallsApi
|
2
2
|
describe 'CallsApi' do
|
3
|
-
|
4
|
-
let(:call_id) { 'c-15ac29a2-006c67ad-060f-4b98-b148-b753d6e5e2ce' }
|
5
|
-
let(:enqueued_time) { '2023-06-23T18:43:51.248Z' }
|
6
|
-
let(:call_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}" }
|
7
|
-
let(:call_timeout) { 30.0 }
|
8
|
-
let(:callback_timeout) { 15.0 }
|
9
|
-
let(:privacy) { false }
|
10
|
-
let(:display_name) { 'Ruby SDK' }
|
11
|
-
let(:answer_method) { Bandwidth::CallbackMethodEnum::POST }
|
12
|
-
let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' }
|
13
|
-
let(:answer_fallback_url) { BASE_CALLBACK_URL + '/callbacks/answer' }
|
14
|
-
let(:answer_fallback_method) { Bandwidth::CallbackMethodEnum::POST }
|
15
|
-
let(:disconnect_method) { Bandwidth::CallbackMethodEnum::GET }
|
16
|
-
let(:disconnect_url) { BASE_CALLBACK_URL + '/callbacks/disconnect' }
|
17
|
-
let(:priority) { 5 }
|
18
|
-
let(:direction) { Bandwidth::CallDirectionEnum::OUTBOUND }
|
19
|
-
let(:state) { 'disconnected' }
|
20
|
-
let(:stir_shaken) { {} }
|
21
|
-
let(:start_time) { '2023-06-23T19:11:06.049Z' }
|
22
|
-
let(:end_time) { '2023-06-23T19:11:06.175Z' }
|
23
|
-
let(:disconnect_cause) { 'rejected' }
|
24
|
-
let(:error_message) { 'Destination not found' }
|
25
|
-
let(:error_id) { '779941c4-6482-461d-b370-177b4ad0b5a7' }
|
26
|
-
let(:last_update) { '2023-06-23T19:11:06.175Z' }
|
27
|
-
let(:tag) { 'test tag' }
|
3
|
+
let(:call_id) { 'c-1234' }
|
28
4
|
|
29
|
-
# stubs
|
30
|
-
let(:create_call_headers_stub) { { 'content-type' => 'application/json' } }
|
31
|
-
let(:create_call_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"enqueuedTime\":\"#{enqueued_time}\",\"callUrl\":\"#{call_url}\",\"callTimeout\":#{call_timeout},\"callbackTimeout\":#{callback_timeout},\"tag\":\"#{tag}\",\"answerMethod\":\"#{answer_method}\",\"answerUrl\":\"#{answer_url}\",\"answerFallbackUrl\":\"#{answer_fallback_url}\",\"answerFallbackMethod\":\"#{answer_fallback_method}\",\"disconnectMethod\":\"#{disconnect_method}\",\"disconnectUrl\":\"#{disconnect_url}\",\"priority\":#{priority}}" }
|
32
|
-
let(:create_call_bad_request_stub) { '{"type":"validation","description":"Invalid to: must be a valid SIP URI or an E164 TN"}' }
|
33
|
-
let(:get_calls_headers_stub) { { 'content-type' => 'application/json' } }
|
34
|
-
let(:get_calls_body_stub) { "[{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"direction\":\"#{direction}\",\"state\":\"#{state}\",\"stirShaken\":#{stir_shaken},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"disconnectCause\":\"#{disconnect_cause}\",\"errorMessage\":\"#{error_message}\",\"errorId\":\"#{error_id}\",\"lastUpdate\":\"#{last_update}\"}]" }
|
35
|
-
let(:get_call_state_headers_stub) { { 'content-type' => 'application/json' } }
|
36
|
-
let(:get_call_state_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"direction\":\"#{direction}\",\"state\":\"#{state}\",\"stirShaken\":#{stir_shaken},\"enqueuedTime\":\"#{enqueued_time}\",\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"disconnectCause\":\"#{disconnect_cause}\",\"errorMessage\":\"#{error_message}\",\"errorId\":\"#{error_id}\",\"lastUpdate\":\"#{last_update}\"}" }
|
37
|
-
let(:get_call_state_not_found_stub) { '{"type":"validation","description":"Call does-not-exist was not found."}' }
|
38
|
-
let(:get_call_state_unauthorized_stub) { '{"type":"authentication-error","description":"The credentials provided were invalid"}' }
|
39
|
-
let(:get_call_state_forbidden_stub) { '{"type":"authorization-error","description":"Access is denied"}' }
|
40
|
-
let(:update_call_headers_stub) { { 'content-length' => '0' } }
|
41
|
-
|
42
5
|
before(:all) do
|
43
6
|
Bandwidth.configure do |config|
|
44
7
|
config.debugging = true
|
8
|
+
config.username = BW_USERNAME
|
9
|
+
config.password = BW_PASSWORD
|
10
|
+
config.ignore_operation_servers = true
|
11
|
+
config.host = '127.0.0.1:4010'
|
45
12
|
end
|
46
13
|
@calls_api_instance = Bandwidth::CallsApi.new
|
47
14
|
end
|
@@ -55,59 +22,70 @@ describe 'CallsApi' do
|
|
55
22
|
# Create Call
|
56
23
|
describe '#create_call' do
|
57
24
|
it 'creates a call with amd' do
|
58
|
-
stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls").
|
59
|
-
to_return(status: 201, headers: create_call_headers_stub, body: create_call_body_stub)
|
60
|
-
|
61
25
|
amd_config = Bandwidth::MachineDetectionConfiguration.new(
|
62
|
-
mode:
|
63
|
-
detection_timeout:
|
64
|
-
silence_timeout:
|
65
|
-
speech_threshold:
|
26
|
+
mode: Bandwidth::MachineDetectionModeEnum::ASYNC,
|
27
|
+
detection_timeout: 15.0,
|
28
|
+
silence_timeout: 10.0,
|
29
|
+
speech_threshold: 10.0,
|
66
30
|
speech_end_threshold: 5.0,
|
67
|
-
|
68
|
-
|
69
|
-
|
31
|
+
machine_speech_end_threshold: 5.0,
|
32
|
+
delay_result: false,
|
33
|
+
callback_url: 'https://myServer.com/bandwidth/webhooks/machineDetectionComplete',
|
34
|
+
callback_method: Bandwidth::CallbackMethodEnum::POST,
|
35
|
+
username: 'mySecretUsername',
|
36
|
+
password: 'mySecretPassword1!',
|
37
|
+
fallback_url: 'https://myFallbackServer.com/bandwidth/webhooks/machineDetectionComplete',
|
38
|
+
fallback_method: Bandwidth::CallbackMethodEnum::POST,
|
39
|
+
fallback_username: 'mySecretUsername',
|
40
|
+
fallback_password: 'mySecretPassword1!',
|
70
41
|
)
|
71
42
|
|
72
43
|
call_body = Bandwidth::CreateCall.new(
|
73
|
-
application_id: BW_VOICE_APPLICATION_ID,
|
74
44
|
to: USER_NUMBER,
|
75
45
|
from: BW_NUMBER,
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
46
|
+
application_id: BW_VOICE_APPLICATION_ID,
|
47
|
+
answer_url: BASE_CALLBACK_URL,
|
48
|
+
answer_method: Bandwidth::CallbackMethodEnum::POST,
|
49
|
+
username: 'mySecretUsername',
|
50
|
+
password: 'mySecretPassword1!',
|
51
|
+
answer_fallback_url: 'https://www.myFallbackServer.com/webhooks/answer',
|
52
|
+
answer_fallback_method: Bandwidth::CallbackMethodEnum::POST,
|
53
|
+
fallback_username: 'mySecretUsername',
|
54
|
+
fallback_password: 'mySecretPassword1!',
|
55
|
+
disconnect_url: 'https://myServer.com/bandwidth/webhooks/disconnectUrl',
|
56
|
+
disconnect_method: Bandwidth::CallbackMethodEnum::POST,
|
57
|
+
call_timeout: 30.0,
|
58
|
+
callback_timeout: 15.0,
|
83
59
|
machine_detection: amd_config,
|
84
|
-
|
85
|
-
|
86
|
-
tag: tag
|
60
|
+
priority: 5,
|
61
|
+
tag: 'tag_example',
|
87
62
|
)
|
88
63
|
|
89
|
-
data, status_code
|
64
|
+
data, status_code = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
|
90
65
|
|
91
66
|
expect(status_code).to eq(201)
|
92
|
-
expect(headers).to eq(create_call_headers_stub)
|
93
67
|
expect(data).to be_instance_of(Bandwidth::CreateCallResponse)
|
94
|
-
expect(data.application_id).to eq(
|
95
|
-
expect(data.account_id).to eq(
|
96
|
-
expect(data.call_id).to eq(
|
97
|
-
expect(data.to).to eq(
|
98
|
-
expect(data.from).to eq(
|
99
|
-
expect(data.enqueued_time).to
|
100
|
-
expect(data.call_url).to
|
101
|
-
expect(data.call_timeout).to
|
102
|
-
expect(data.callback_timeout).to
|
103
|
-
expect(data.tag).to
|
104
|
-
expect(data.answer_method).to
|
105
|
-
expect(data.answer_url).to
|
106
|
-
expect(data.answer_fallback_method).to
|
107
|
-
expect(data.answer_fallback_url).to
|
108
|
-
expect(data.disconnect_method).to
|
109
|
-
expect(data.disconnect_url).to
|
110
|
-
expect(data.
|
68
|
+
expect(data.application_id.length).to eq(36)
|
69
|
+
expect(data.account_id.length).to eq(7)
|
70
|
+
expect(data.call_id.length).to eq(47)
|
71
|
+
expect(data.to.length).to eq(12)
|
72
|
+
expect(data.from.length).to eq(12)
|
73
|
+
expect(data.enqueued_time).to be_instance_of(Time)
|
74
|
+
expect(data.call_url).to start_with('http')
|
75
|
+
expect(data.call_timeout).to be_instance_of(Float)
|
76
|
+
expect(data.callback_timeout).to be_instance_of(Float)
|
77
|
+
expect(data.tag).to be_instance_of(String)
|
78
|
+
expect(data.answer_method).to be_one_of(Bandwidth::CallbackMethodEnum.all_vars)
|
79
|
+
expect(data.answer_url).to start_with('http')
|
80
|
+
expect(data.answer_fallback_method).to be_one_of(Bandwidth::CallbackMethodEnum.all_vars)
|
81
|
+
expect(data.answer_fallback_url).to start_with('http')
|
82
|
+
expect(data.disconnect_method).to be_one_of(Bandwidth::CallbackMethodEnum.all_vars)
|
83
|
+
expect(data.disconnect_url).to start_with('http')
|
84
|
+
expect(data.username).to be_instance_of(String)
|
85
|
+
expect(data.password).to be_instance_of(String)
|
86
|
+
expect(data.fallback_username).to be_instance_of(String)
|
87
|
+
expect(data.fallback_password).to be_instance_of(String)
|
88
|
+
expect(data.priority).to be_instance_of(Integer)
|
111
89
|
end
|
112
90
|
|
113
91
|
it 'causes an ArgumentError for a missing account_id' do
|
@@ -126,58 +104,57 @@ describe 'CallsApi' do
|
|
126
104
|
# Get Calls
|
127
105
|
describe '#list_calls' do
|
128
106
|
it 'gets a list of calls' do
|
129
|
-
|
130
|
-
to_return(status: 200, headers: get_calls_headers_stub, body: get_calls_body_stub)
|
131
|
-
|
132
|
-
data, status_code, headers = @calls_api_instance.list_calls_with_http_info(BW_ACCOUNT_ID)
|
107
|
+
data, status_code = @calls_api_instance.list_calls_with_http_info(BW_ACCOUNT_ID)
|
133
108
|
|
134
109
|
expect(status_code).to eq(200)
|
135
|
-
expect(headers).to eq(get_calls_headers_stub)
|
136
110
|
expect(data).to be_instance_of(Array)
|
137
111
|
expect(data[0]).to be_instance_of(Bandwidth::CallState)
|
138
|
-
expect(data[0].application_id).to eq(
|
139
|
-
expect(data[0].account_id).to eq(
|
140
|
-
expect(data[0].call_id).to eq(
|
141
|
-
expect(data[0].
|
142
|
-
expect(data[0].
|
143
|
-
expect(data[0].
|
144
|
-
expect(data[0].
|
145
|
-
expect(data[0].state).to
|
146
|
-
expect(data[0].
|
147
|
-
expect(data[0].
|
148
|
-
expect(data[0].
|
149
|
-
expect(data[0].
|
150
|
-
expect(data[0].
|
151
|
-
expect(data[0].
|
112
|
+
expect(data[0].application_id.length).to eq(36)
|
113
|
+
expect(data[0].account_id.length).to eq(7)
|
114
|
+
expect(data[0].call_id.length).to eq(47)
|
115
|
+
expect(data[0].parent_call_id.length).to eq(47)
|
116
|
+
expect(data[0].to.length).to eq(12)
|
117
|
+
expect(data[0].from.length).to eq(12)
|
118
|
+
expect(data[0].direction).to be_one_of(Bandwidth::CallDirectionEnum.all_vars)
|
119
|
+
expect(data[0].state).to be_instance_of(String)
|
120
|
+
expect(data[0].stir_shaken).to be_instance_of(Hash)
|
121
|
+
expect(data[0].identity).to be_instance_of(String)
|
122
|
+
expect(data[0].enqueued_time).to be_instance_of(Time)
|
123
|
+
expect(data[0].start_time).to be_instance_of(Time)
|
124
|
+
expect(data[0].answer_time).to be_instance_of(Time)
|
125
|
+
expect(data[0].end_time).to be_instance_of(Time)
|
126
|
+
expect(data[0].disconnect_cause).to be_instance_of(String)
|
127
|
+
expect(data[0]).to respond_to(:error_message)
|
128
|
+
expect(data[0]).to respond_to(:error_id)
|
129
|
+
expect(data[0].last_update).to be_instance_of(Time)
|
152
130
|
end
|
153
131
|
end
|
154
132
|
|
155
|
-
# Get Call State Information
|
133
|
+
# # Get Call State Information
|
156
134
|
describe '#get_call_state' do
|
157
135
|
it 'gets the call state' do
|
158
|
-
|
159
|
-
to_return(status: 200, headers: get_call_state_headers_stub, body: get_call_state_body_stub)
|
160
|
-
|
161
|
-
data, status_code, headers = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, call_id)
|
136
|
+
data, status_code = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, call_id)
|
162
137
|
|
163
138
|
expect(status_code).to eq(200)
|
164
|
-
expect(headers).to eq(get_call_state_headers_stub)
|
165
139
|
expect(data).to be_instance_of(Bandwidth::CallState)
|
166
|
-
expect(data.application_id).to eq(
|
167
|
-
expect(data.account_id).to eq(
|
168
|
-
expect(data.call_id).to eq(
|
169
|
-
expect(data.
|
170
|
-
expect(data.
|
171
|
-
expect(data.
|
172
|
-
expect(data.
|
173
|
-
expect(data.state).to
|
174
|
-
expect(data.
|
175
|
-
expect(data.
|
176
|
-
expect(data.
|
177
|
-
expect(data.
|
178
|
-
expect(data.
|
179
|
-
expect(data.
|
180
|
-
expect(data.
|
140
|
+
expect(data.application_id.length).to eq(36)
|
141
|
+
expect(data.account_id.length).to eq(7)
|
142
|
+
expect(data.call_id.length).to eq(47)
|
143
|
+
expect(data.parent_call_id.length).to eq(47)
|
144
|
+
expect(data.to.length).to eq(12)
|
145
|
+
expect(data.from.length).to eq(12)
|
146
|
+
expect(data.direction).to be_one_of(Bandwidth::CallDirectionEnum.all_vars)
|
147
|
+
expect(data.state).to be_instance_of(String)
|
148
|
+
expect(data.stir_shaken).to be_instance_of(Hash)
|
149
|
+
expect(data.identity).to be_instance_of(String)
|
150
|
+
expect(data.enqueued_time).to be_instance_of(Time)
|
151
|
+
expect(data.start_time).to be_instance_of(Time)
|
152
|
+
expect(data.answer_time).to be_instance_of(Time)
|
153
|
+
expect(data.end_time).to be_instance_of(Time)
|
154
|
+
expect(data.disconnect_cause).to be_instance_of(String)
|
155
|
+
expect(data).to respond_to(:error_message)
|
156
|
+
expect(data).to respond_to(:error_id)
|
157
|
+
expect(data.last_update).to be_instance_of(Time)
|
181
158
|
end
|
182
159
|
|
183
160
|
it 'causes an ArgumentError for a missing account_id' do
|
@@ -193,21 +170,17 @@ describe 'CallsApi' do
|
|
193
170
|
end
|
194
171
|
end
|
195
172
|
|
196
|
-
# Update Call
|
173
|
+
# # Update Call
|
197
174
|
describe '#update_call' do
|
198
175
|
it 'creates and updates a call' do
|
199
|
-
stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}").
|
200
|
-
to_return(status: 200, headers: update_call_headers_stub)
|
201
|
-
|
202
176
|
update_call_body = Bandwidth::UpdateCall.new(
|
203
177
|
state: Bandwidth::CallStateEnum::ACTIVE,
|
204
178
|
redirect_url: MANTECA_BASE_URL + '/bxml/pause'
|
205
179
|
)
|
206
180
|
|
207
|
-
_data, status_code
|
181
|
+
_data, status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, update_call_body)
|
208
182
|
|
209
183
|
expect(status_code).to eq(200)
|
210
|
-
expect(headers).to eq(update_call_headers_stub)
|
211
184
|
end
|
212
185
|
|
213
186
|
it 'causes an ArgumentError for a missing account_id' do
|
@@ -232,10 +205,7 @@ describe 'CallsApi' do
|
|
232
205
|
# Update Call BXML
|
233
206
|
describe '#update_call_bxml' do
|
234
207
|
it 'updates a call using bxml' do
|
235
|
-
|
236
|
-
to_return(status: 204)
|
237
|
-
|
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>'
|
208
|
+
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>"
|
239
209
|
|
240
210
|
_data, status_code = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, update_bxml)
|
241
211
|
|
@@ -1,41 +1,16 @@
|
|
1
1
|
# Unit tests for Bandwidth::ConferencesApi
|
2
2
|
describe 'ConferencesApi' do
|
3
|
-
|
4
|
-
let(:
|
5
|
-
let(:
|
6
|
-
|
7
|
-
let(:conference_event_url) { 'https://amazonaws.com/prod/conferenceEvents' }
|
8
|
-
let(:conference_event_method) { 'POST' }
|
9
|
-
let(:call_id) { 'c-3f758f24-cd77b08f-97c2-4311-965a-a1ac8ed8f340' }
|
10
|
-
let(:recording_id) { 'r-fbe05094-7bf4b314-91fe-4bdd-a39b-500cdc873d3a' }
|
11
|
-
let(:start_time) { '2023-06-26T14:58:51.195Z' }
|
12
|
-
let(:end_time) { '2023-06-26T14:58:57.502Z' }
|
13
|
-
let(:duration) { 'PT6.3S' }
|
14
|
-
let(:channels) { 1 }
|
15
|
-
let(:file_format) { Bandwidth::FileFormatEnum::WAV }
|
16
|
-
let(:status) { 'complete' }
|
17
|
-
let(:member_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/members/#{call_id}" }
|
18
|
-
let(:media_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/recordings/#{recording_id}/media" }
|
19
|
-
let(:active_members) { "[{\"callId\":\"#{call_id}\",\"conferenceId\":\"#{conference_id}\",\"memberUrl\":\"#{member_url}\",\"mute\":false,\"hold\":false,\"callIdsToCoach\":[]}]" }
|
20
|
-
|
21
|
-
# stubs
|
22
|
-
let(:list_conferences_headers_stub) { { 'content-type' => 'application/json' } }
|
23
|
-
let(:list_conferences_body_stub) { "[{\"id\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"createdTime\":\"#{created_time}\",\"conferenceEventUrl\":\"#{conference_event_url}\",\"conferenceEventMethod\":\"#{conference_event_method}\",\"tag\":\"#{test_id}\"}]" }
|
24
|
-
let(:get_conference_headers_stub) { { 'content-type' => 'application/json' } }
|
25
|
-
let(:get_conference_body_stub) { "{\"id\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"createdTime\":\"#{created_time}\",\"conferenceEventUrl\":\"#{conference_event_url}\",\"conferenceEventMethod\":\"#{conference_event_method}\",\"tag\":\"#{test_id}\",\"activeMembers\":#{active_members}}" }
|
26
|
-
let(:get_conference_member_headers_stub) { { 'content-type' => 'application/json' } }
|
27
|
-
let(:get_conference_member_body_stub) { "{\"callId\":\"#{call_id}\",\"conferenceId\":\"#{conference_id}\",\"memberUrl\":\"#{member_url}\",\"mute\":false,\"hold\":false,\"callIdsToCoach\":[]}" }
|
28
|
-
let(:list_conference_recordings_headers_stub) { { 'content-type' => 'application/json' } }
|
29
|
-
let(:list_conference_recordings_body_stub) { "[{\"accountId\":\"#{BW_ACCOUNT_ID}\",\"conferenceId\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"recordingId\":\"#{recording_id}\",\"duration\":\"#{duration}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}]" }
|
30
|
-
let(:get_conference_recording_headers_stub) { { 'content-type' => 'application/json' } }
|
31
|
-
let(:get_conference_recording_body_stub) { "{\"accountId\":\"#{BW_ACCOUNT_ID}\",\"conferenceId\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"recordingId\":\"#{recording_id}\",\"duration\":\"#{duration}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}" }
|
32
|
-
let(:download_conference_recording_body_stub) { 'RIFFWAVEfmtLISTINFOISFTLavf58.45.100data' }
|
33
|
-
let(:download_conference_recording_headers_stub) { { 'content-type' => 'audio/vnd.wave', 'content-length' => "#{download_conference_recording_body_stub.length}" } }
|
34
|
-
|
3
|
+
let(:call_id) { 'c-1234' }
|
4
|
+
let(:conference_id) { 'c-4321' }
|
5
|
+
let(:recording_id) { 'r-1234' }
|
6
|
+
|
35
7
|
before(:all) do
|
36
8
|
Bandwidth.configure do |config|
|
37
|
-
config.return_binary_data = true
|
38
9
|
config.debugging = true
|
10
|
+
config.username = BW_USERNAME
|
11
|
+
config.password = BW_PASSWORD
|
12
|
+
config.ignore_operation_servers = true
|
13
|
+
config.host = '127.0.0.1:4010'
|
39
14
|
end
|
40
15
|
@conferences_api_instance = Bandwidth::ConferencesApi.new
|
41
16
|
end
|
@@ -48,16 +23,13 @@ describe 'ConferencesApi' do
|
|
48
23
|
|
49
24
|
# Download Conference Recording
|
50
25
|
describe 'download_conference_recording test' do
|
51
|
-
it '
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
data, status_code, headers = @conferences_api_instance.download_conference_recording_with_http_info(BW_ACCOUNT_ID, conference_id, recording_id)
|
26
|
+
it 'download a conference recording' do
|
27
|
+
data, status_code = @conferences_api_instance.download_conference_recording_with_http_info(
|
28
|
+
BW_ACCOUNT_ID, conference_id, recording_id, { header_params: { 'Accept' => 'audio/vnd.wave' } })
|
56
29
|
|
57
30
|
expect(status_code).to eq(200)
|
58
|
-
expect(
|
59
|
-
|
60
|
-
end
|
31
|
+
# expect(data).to be_instance_of(String)
|
32
|
+
end if false # skip for now due to an issue with setting the Accept header
|
61
33
|
|
62
34
|
it 'causes an ArgumentError for a missing account_id' do
|
63
35
|
expect {
|
@@ -81,28 +53,17 @@ describe 'ConferencesApi' do
|
|
81
53
|
# Get Conference Information
|
82
54
|
describe 'get_conference' do
|
83
55
|
it 'get a conference by id' do
|
84
|
-
|
85
|
-
to_return(status: 200, headers: get_conference_headers_stub, body: get_conference_body_stub)
|
86
|
-
|
87
|
-
data, status_code, headers = @conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, conference_id)
|
56
|
+
data, status_code = @conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, conference_id)
|
88
57
|
|
89
58
|
expect(status_code).to eq(200)
|
90
|
-
expect(headers).to eq(get_conference_headers_stub)
|
91
59
|
expect(data).to be_instance_of(Bandwidth::Conference)
|
92
|
-
expect(data.id).to eq(
|
93
|
-
expect(data.name).to
|
94
|
-
expect(data.
|
95
|
-
expect(data.
|
96
|
-
expect(data.conference_event_url).to
|
97
|
-
expect(data.conference_event_method).to
|
98
|
-
expect(data.
|
99
|
-
expect(data.active_members[0]).to be_instance_of(Bandwidth::ConferenceMember)
|
100
|
-
expect(data.active_members[0].call_id).to eq(call_id)
|
101
|
-
expect(data.active_members[0].conference_id).to eq(conference_id)
|
102
|
-
expect(data.active_members[0].member_url).to eq(member_url)
|
103
|
-
expect(data.active_members[0].mute).to be false
|
104
|
-
expect(data.active_members[0].hold).to be false
|
105
|
-
expect(data.active_members[0].call_ids_to_coach).to eq([])
|
60
|
+
expect(data.id.length).to eq(50)
|
61
|
+
expect(data.name).to be_instance_of(String)
|
62
|
+
expect(data.created_time).to be_instance_of(Time)
|
63
|
+
expect(data.completed_time).to be_instance_of(Time)
|
64
|
+
expect(data.conference_event_url).to start_with('http')
|
65
|
+
expect(data.conference_event_method).to be_one_of(Bandwidth::CallbackMethodEnum.all_vars)
|
66
|
+
expect(data.tag).to be_instance_of(String)
|
106
67
|
end
|
107
68
|
|
108
69
|
it 'causes an ArgumentError for a missing account_id' do
|
@@ -121,20 +82,16 @@ describe 'ConferencesApi' do
|
|
121
82
|
# Get Conference Member
|
122
83
|
describe 'get_conference_member' do
|
123
84
|
it 'gets a conference member by call id' do
|
124
|
-
|
125
|
-
to_return(status: 200, headers: get_conference_member_headers_stub, body: get_conference_member_body_stub)
|
126
|
-
|
127
|
-
data, status_code, headers = @conferences_api_instance.get_conference_member_with_http_info(BW_ACCOUNT_ID, conference_id, call_id)
|
85
|
+
data, status_code = @conferences_api_instance.get_conference_member_with_http_info(BW_ACCOUNT_ID, conference_id, call_id)
|
128
86
|
|
129
87
|
expect(status_code).to eq(200)
|
130
|
-
expect(headers).to eq(get_conference_member_headers_stub)
|
131
88
|
expect(data).to be_instance_of(Bandwidth::ConferenceMember)
|
132
|
-
expect(data.
|
133
|
-
expect(data.
|
134
|
-
expect(data.member_url).to
|
135
|
-
expect(data.mute).to
|
136
|
-
expect(data.hold).to
|
137
|
-
expect(data.call_ids_to_coach).to
|
89
|
+
expect(data.call_id.length).to eq(47)
|
90
|
+
expect(data.conference_id.length).to eq(50)
|
91
|
+
expect(data.member_url).to start_with('http')
|
92
|
+
expect(data.mute).to be_one_of([true, false])
|
93
|
+
expect(data.hold).to be_one_of([true, false])
|
94
|
+
expect(data.call_ids_to_coach).to be_instance_of(Array)
|
138
95
|
end
|
139
96
|
|
140
97
|
it 'causes an ArgumentError for a missing account_id' do
|
@@ -159,25 +116,21 @@ describe 'ConferencesApi' do
|
|
159
116
|
# Get Conference Recording Information
|
160
117
|
describe 'get_conference_recording' do
|
161
118
|
it 'gets a conference recording by id' do
|
162
|
-
|
163
|
-
to_return(status: 200, headers: get_conference_recording_headers_stub, body: get_conference_recording_body_stub)
|
164
|
-
|
165
|
-
data, status_code, headers = @conferences_api_instance.get_conference_recording_with_http_info(BW_ACCOUNT_ID, conference_id, recording_id)
|
119
|
+
data, status_code = @conferences_api_instance.get_conference_recording_with_http_info(BW_ACCOUNT_ID, conference_id, recording_id)
|
166
120
|
|
167
121
|
expect(status_code).to eq(200)
|
168
|
-
expect(headers).to eq(get_conference_recording_headers_stub)
|
169
122
|
expect(data).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
|
170
|
-
expect(data.account_id).to eq(
|
171
|
-
expect(data.conference_id).to eq(
|
172
|
-
expect(data.name).to
|
173
|
-
expect(data.recording_id).to eq(
|
174
|
-
expect(data.duration).to
|
175
|
-
expect(data.channels).to
|
176
|
-
expect(data.start_time).to
|
177
|
-
expect(data.end_time).to
|
178
|
-
expect(data.file_format).to
|
179
|
-
expect(data.status).to
|
180
|
-
expect(data.media_url).to
|
123
|
+
expect(data.account_id.length).to eq(7)
|
124
|
+
expect(data.conference_id.length).to eq(50)
|
125
|
+
expect(data.name).to be_instance_of(String)
|
126
|
+
expect(data.recording_id.length).to eq(47)
|
127
|
+
expect(data.duration).to start_with('PT')
|
128
|
+
expect(data.channels).to be_instance_of(Integer)
|
129
|
+
expect(data.start_time).to be_instance_of(Time)
|
130
|
+
expect(data.end_time).to be_instance_of(Time)
|
131
|
+
expect(data.file_format).to be_one_of(Bandwidth::FileFormatEnum.all_vars)
|
132
|
+
expect(data.status).to be_instance_of(String)
|
133
|
+
expect(data.media_url).to start_with('http')
|
181
134
|
end
|
182
135
|
|
183
136
|
it 'causes an ArgumentError for a missing account_id' do
|
@@ -199,29 +152,25 @@ describe 'ConferencesApi' do
|
|
199
152
|
end
|
200
153
|
end
|
201
154
|
|
202
|
-
#
|
155
|
+
# List Conference Recordings
|
203
156
|
describe 'list_conference_recordings' do
|
204
157
|
it 'lists recordings for a conference' do
|
205
|
-
|
206
|
-
to_return(status: 200, headers: list_conference_recordings_headers_stub, body: list_conference_recordings_body_stub)
|
207
|
-
|
208
|
-
data, status_code, headers = @conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, conference_id)
|
158
|
+
data, status_code = @conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, conference_id)
|
209
159
|
|
210
160
|
expect(status_code).to eq(200)
|
211
|
-
expect(headers).to eq(list_conference_recordings_headers_stub)
|
212
161
|
expect(data).to be_instance_of(Array)
|
213
162
|
expect(data[0]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
|
214
|
-
expect(data[0].account_id).to eq(
|
215
|
-
expect(data[0].conference_id).to eq(
|
216
|
-
expect(data[0].name).to
|
217
|
-
expect(data[0].recording_id).to eq(
|
218
|
-
expect(data[0].duration).to
|
219
|
-
expect(data[0].channels).to
|
220
|
-
expect(data[0].start_time).to
|
221
|
-
expect(data[0].end_time).to
|
222
|
-
expect(data[0].file_format).to
|
223
|
-
expect(data[0].status).to
|
224
|
-
expect(data[0].media_url).to
|
163
|
+
expect(data[0].account_id.length).to eq(7)
|
164
|
+
expect(data[0].conference_id.length).to eq(50)
|
165
|
+
expect(data[0].name).to be_instance_of(String)
|
166
|
+
expect(data[0].recording_id.length).to eq(47)
|
167
|
+
expect(data[0].duration).to start_with('PT')
|
168
|
+
expect(data[0].channels).to be_instance_of(Integer)
|
169
|
+
expect(data[0].start_time).to be_instance_of(Time)
|
170
|
+
expect(data[0].end_time).to be_instance_of(Time)
|
171
|
+
expect(data[0].file_format).to be_one_of(Bandwidth::FileFormatEnum.all_vars)
|
172
|
+
expect(data[0].status).to be_instance_of(String)
|
173
|
+
expect(data[0].media_url).to start_with('http')
|
225
174
|
end
|
226
175
|
|
227
176
|
it 'causes an ArgumentError for a missing account_id' do
|
@@ -237,28 +186,25 @@ describe 'ConferencesApi' do
|
|
237
186
|
end
|
238
187
|
end
|
239
188
|
|
240
|
-
#
|
189
|
+
# List Conferences
|
241
190
|
describe 'list_conferences' do
|
242
191
|
it 'list all conferences' do
|
243
|
-
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences?name=#{test_id}").
|
244
|
-
to_return(status: 200, headers: list_conferences_headers_stub, body: list_conferences_body_stub)
|
245
|
-
|
246
192
|
conference_opts = {
|
247
|
-
name:
|
193
|
+
name: call_id
|
248
194
|
}
|
249
195
|
|
250
|
-
data, status_code
|
196
|
+
data, status_code = @conferences_api_instance.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts)
|
251
197
|
|
252
198
|
expect(status_code).to eq(200)
|
253
|
-
expect(headers).to eq(list_conferences_headers_stub)
|
254
199
|
expect(data).to be_instance_of(Array)
|
255
200
|
expect(data[0]).to be_instance_of(Bandwidth::Conference)
|
256
|
-
expect(data[0].id).to eq(
|
257
|
-
expect(data[0].name).to
|
258
|
-
expect(data[0].
|
259
|
-
expect(data[0].
|
260
|
-
expect(data[0].conference_event_url).to
|
261
|
-
expect(data[0].conference_event_method).to
|
201
|
+
expect(data[0].id.length).to eq(50)
|
202
|
+
expect(data[0].name).to be_instance_of(String)
|
203
|
+
expect(data[0].created_time).to be_instance_of(Time)
|
204
|
+
expect(data[0].completed_time).to be_instance_of(Time)
|
205
|
+
expect(data[0].conference_event_url).to start_with('http')
|
206
|
+
expect(data[0].conference_event_method).to be_one_of(Bandwidth::CallbackMethodEnum.all_vars)
|
207
|
+
expect(data[0].tag).to be_instance_of(String)
|
262
208
|
end
|
263
209
|
|
264
210
|
it 'causes an ArgumentError for a missing account_id' do
|
@@ -283,9 +229,6 @@ describe 'ConferencesApi' do
|
|
283
229
|
# Update Conference
|
284
230
|
describe 'update_conference' do
|
285
231
|
it 'updates a conference' do
|
286
|
-
stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}").
|
287
|
-
to_return(status: 204)
|
288
|
-
|
289
232
|
update_conference_body = Bandwidth::UpdateConference.new(
|
290
233
|
status: Bandwidth::ConferenceStateEnum::ACTIVE,
|
291
234
|
redirect_url: BASE_CALLBACK_URL + '/bxml/pause',
|
@@ -324,9 +267,6 @@ describe 'ConferencesApi' do
|
|
324
267
|
# Update Conference BXML
|
325
268
|
describe 'update_conference_bxml' do
|
326
269
|
it 'updates a conference using bxml' do
|
327
|
-
stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/bxml").
|
328
|
-
to_return(status: 204)
|
329
|
-
|
330
270
|
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
271
|
|
332
272
|
_data, status_code = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, conference_id, update_bxml)
|
@@ -355,9 +295,6 @@ describe 'ConferencesApi' do
|
|
355
295
|
# Update Conference Member
|
356
296
|
describe 'update_conference_member' do
|
357
297
|
it 'updates a conference member by call id' do
|
358
|
-
stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/members/#{call_id}").
|
359
|
-
to_return(status: 204)
|
360
|
-
|
361
298
|
update_conference_member = Bandwidth::UpdateConferenceMember.new(
|
362
299
|
mute: false
|
363
300
|
)
|