bandwidth-sdk 12.0.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 +13 -22
- data/README.md +3 -1
- data/Rakefile +4 -12
- data/bandwidth-sdk.gemspec +3 -1
- data/bandwidth.yml +48 -33
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +1333 -1598
- data/coverage/index.html +6890 -9805
- data/custom_templates/Gemfile.mustache +1 -2
- data/custom_templates/gemspec.mustache +2 -0
- data/docs/AnswerCallback.md +2 -2
- data/docs/BridgeCompleteCallback.md +2 -2
- data/docs/BridgeTargetCompleteCallback.md +2 -2
- data/docs/CallRecordingMetadata.md +4 -4
- 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/CallsApi.md +1 -1
- data/docs/ConferenceMemberExitCallback.md +1 -1
- data/docs/ConferenceMemberJoinCallback.md +1 -1
- data/docs/ConferenceRecordingAvailableCallback.md +1 -1
- data/docs/ConferenceRecordingMetadata.md +1 -1
- data/docs/CreateCall.md +5 -3
- data/docs/DisconnectCallback.md +2 -2
- data/docs/DtmfCallback.md +4 -4
- data/docs/GatherCallback.md +4 -4
- data/docs/InitiateCallback.md +2 -2
- data/docs/MachineDetectionCompleteCallback.md +2 -2
- data/docs/MessagingCodeResponse.md +1 -1
- data/docs/RecordingAvailableCallback.md +4 -4
- data/docs/RecordingCompleteCallback.md +4 -4
- data/docs/RecordingTranscriptionMetadata.md +1 -1
- data/docs/RedirectCallback.md +4 -4
- data/docs/TranscriptionAvailableCallback.md +4 -4
- data/docs/TranscriptionsApi.md +1 -1
- data/docs/TransferAnswerCallback.md +4 -4
- data/docs/TransferCompleteCallback.md +4 -4
- data/docs/TransferDisconnectCallback.md +4 -4
- 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 +3 -3
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +3 -3
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +3 -3
- 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 +4 -4
- 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 +3 -3
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +3 -3
- 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 +16 -5
- 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 +3 -3
- data/lib/bandwidth-sdk/models/diversion.rb +2 -2
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +4 -4
- 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 +4 -4
- 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 +3 -3
- 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 +3 -3
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +3 -3
- 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 +4 -4
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +4 -4
- 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 +4 -4
- 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 +4 -4
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +4 -4
- 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/{integration/calls_api_integration_spec.rb → smoke/calls_api_spec.rb} +3 -6
- data/spec/{integration/conferences_api_integration_spec.rb → smoke/conferences_api_spec.rb} +0 -5
- data/spec/{integration/media_api_integration_spec.rb → smoke/media_api_spec.rb} +0 -5
- data/spec/{integration/messages_api_integration_spec.rb → smoke/messages_api_spec.rb} +0 -5
- data/spec/{integration/mfa_api_integration_spec.rb → smoke/mfa_api_spec.rb} +0 -5
- data/spec/{integration/phone_number_lookup_api_integration_spec.rb → smoke/phone_number_lookup_api_spec.rb} +0 -5
- data/spec/{integration/recordings_api_integration_spec.rb → smoke/recordings_api_spec.rb} +0 -5
- data/spec/{integration/statistics_api_integration_spec.rb → smoke/statistics_api_spec.rb} +0 -5
- data/spec/{integration/transcriptions_api_integration_spec.rb → smoke/transcriptions_api_spec.rb} +0 -5
- data/spec/spec_helper.rb +13 -6
- data/spec/unit/api/calls_api_spec.rb +233 -0
- data/spec/unit/api/conferences_api_spec.rb +330 -0
- data/spec/{api → unit/api}/media_api_spec.rb +17 -32
- data/spec/unit/api/messages_api_spec.rb +103 -0
- data/spec/{api → unit/api}/mfa_api_spec.rb +8 -24
- data/spec/unit/api/phone_number_lookup_api_spec.rb +86 -0
- data/spec/{api → unit/api}/recordings_api_spec.rb +83 -110
- data/spec/unit/api/statistics_api_spec.rb +37 -0
- data/spec/{api → unit/api}/transcriptions_api_spec.rb +18 -37
- data/spec/{api_client_spec.rb → unit/client/api_client_spec.rb} +4 -4
- metadata +136 -118
- data/spec/api/calls_api_spec.rb +0 -261
- data/spec/api/conferences_api_spec.rb +0 -393
- data/spec/api/messages_api_spec.rb +0 -193
- data/spec/api/phone_number_lookup_api_spec.rb +0 -100
- data/spec/api/statistics_api_spec.rb +0 -45
- /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
@@ -1,100 +0,0 @@
|
|
1
|
-
# Unit tests for Bandwidth::PhoneNumberLookupApi
|
2
|
-
describe 'PhoneNumberLookupApi' do
|
3
|
-
# lookup info
|
4
|
-
let(:request_id) { '21e6d818-eaa9-4ca9-b1d8-d6085f5c79d4' }
|
5
|
-
let(:status_in_progress) { Bandwidth::LookupStatusEnum::IN_PROGRESS }
|
6
|
-
let(:status_complete) { Bandwidth::LookupStatusEnum::COMPLETE }
|
7
|
-
let(:response_code) { 0 }
|
8
|
-
let(:message) { 'NOERROR' }
|
9
|
-
let(:formatted) { "(#{BW_NUMBER[2..4]}) #{BW_NUMBER[5..7]}-#{BW_NUMBER[7..-1]}" }
|
10
|
-
let(:country) { 'US' }
|
11
|
-
let(:line_type) { 'Mobile' }
|
12
|
-
let(:line_provider) { 'AdHoc P2P - Bandwidth - SVR' }
|
13
|
-
|
14
|
-
# stubs
|
15
|
-
let(:create_lookup_headers_stub) { { 'content-type' => 'application/json' } }
|
16
|
-
let(:create_lookup_body_stub) { "{\"requestId\":\"#{request_id}\",\"status\":\"#{status_in_progress}\"}" }
|
17
|
-
let(:get_lookup_status_headers_stub) { { 'content-type' => 'application/json' } }
|
18
|
-
let(:get_lookup_status_body_stub) { "{\"requestId\":\"#{request_id}\",\"status\":\"#{status_complete}\",\"result\":[{\"Response Code\":#{response_code},\"Message\":\"#{message}\",\"E.164 Format\":\"#{BW_NUMBER}\",\"Formatted\":\"#{formatted}\",\"Country\":\"#{country}\",\"Line Type\":\"#{line_type}\",\"Line Provider\":\"#{line_provider}\"}]}" }
|
19
|
-
|
20
|
-
before(:all) do
|
21
|
-
Bandwidth.configure do |config|
|
22
|
-
config.debugging = true
|
23
|
-
end
|
24
|
-
@phone_number_lookup_api_instance = Bandwidth::PhoneNumberLookupApi.new
|
25
|
-
end
|
26
|
-
|
27
|
-
describe 'test an instance of PhoneNumberLookupApi' do
|
28
|
-
it 'should create an instance of PhoneNumberLookupApi' do
|
29
|
-
expect(@phone_number_lookup_api_instance).to be_instance_of(Bandwidth::PhoneNumberLookupApi)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
# Create Lookup
|
34
|
-
describe 'create_lookup' do
|
35
|
-
it 'creates a tn lookup request' do
|
36
|
-
stub_request(:post, "https://numbers.bandwidth.com/api/v1/accounts/#{BW_ACCOUNT_ID}/tnlookup").
|
37
|
-
to_return(status: 202, headers: create_lookup_headers_stub, body: create_lookup_body_stub)
|
38
|
-
|
39
|
-
tn_body = Bandwidth::LookupRequest.new(
|
40
|
-
tns: [BW_NUMBER]
|
41
|
-
)
|
42
|
-
data, status_code, headers = @phone_number_lookup_api_instance.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body)
|
43
|
-
|
44
|
-
expect(status_code).to eq(202)
|
45
|
-
expect(headers).to eq(create_lookup_headers_stub)
|
46
|
-
expect(data).to be_instance_of(Bandwidth::CreateLookupResponse)
|
47
|
-
expect(data.request_id).to eq(request_id)
|
48
|
-
expect(data.status).to eq(status_in_progress)
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'causes an ArgumentError for a missing account_id' do
|
52
|
-
expect {
|
53
|
-
@phone_number_lookup_api_instance.create_lookup(nil, {})
|
54
|
-
}.to raise_error(ArgumentError)
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'causes an ArgumentError for a missing lookup_request' do
|
58
|
-
expect {
|
59
|
-
@phone_number_lookup_api_instance.create_lookup(BW_ACCOUNT_ID, nil)
|
60
|
-
}.to raise_error(ArgumentError)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
# Get Lookup Status
|
65
|
-
describe 'get_lookup_status' do
|
66
|
-
it 'gets lookup status' do
|
67
|
-
stub_request(:get, "https://numbers.bandwidth.com/api/v1/accounts/#{BW_ACCOUNT_ID}/tnlookup/#{request_id}").
|
68
|
-
to_return(status: 200, headers: get_lookup_status_headers_stub, body: get_lookup_status_body_stub)
|
69
|
-
|
70
|
-
data, status_code, headers = @phone_number_lookup_api_instance.get_lookup_status_with_http_info(BW_ACCOUNT_ID, request_id)
|
71
|
-
|
72
|
-
expect(status_code).to eq(200)
|
73
|
-
expect(headers).to eq(get_lookup_status_headers_stub)
|
74
|
-
expect(data).to be_instance_of(Bandwidth::LookupStatus)
|
75
|
-
expect(data.request_id).to eq(request_id)
|
76
|
-
expect(data.status).to eq(status_complete)
|
77
|
-
expect(data.result).to be_instance_of(Array)
|
78
|
-
expect(data.result[0]).to be_instance_of(Bandwidth::LookupResult)
|
79
|
-
expect(data.result[0].response_code).to eq(response_code)
|
80
|
-
expect(data.result[0].message).to eq(message)
|
81
|
-
expect(data.result[0].e_164_format).to eq(BW_NUMBER)
|
82
|
-
expect(data.result[0].formatted).to eq(formatted)
|
83
|
-
expect(data.result[0].country).to eq(country)
|
84
|
-
expect(data.result[0].line_type).to eq(line_type)
|
85
|
-
expect(data.result[0].line_provider).to eq(line_provider)
|
86
|
-
end
|
87
|
-
|
88
|
-
it 'causes an ArgumentError for a missing account_id' do
|
89
|
-
expect {
|
90
|
-
@phone_number_lookup_api_instance.get_lookup_status(nil, '')
|
91
|
-
}.to raise_error(ArgumentError)
|
92
|
-
end
|
93
|
-
|
94
|
-
it 'causes an ArgumentError for a missing request_id' do
|
95
|
-
expect {
|
96
|
-
@phone_number_lookup_api_instance.get_lookup_status(BW_ACCOUNT_ID, nil)
|
97
|
-
}.to raise_error(ArgumentError)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# Unit tests for Bandwidth::StatisticsApi
|
2
|
-
describe 'StatisticsApi' do
|
3
|
-
# statistics info
|
4
|
-
let(:current_call_queue_size) { 0 }
|
5
|
-
let(:max_call_queue_size) { 7500 }
|
6
|
-
|
7
|
-
# stubs
|
8
|
-
let(:get_statistics_headers_stub) { { 'content-type' => 'application/json' } }
|
9
|
-
let(:get_statistics_body_stub) { "{\"currentCallQueueSize\":#{current_call_queue_size},\"maxCallQueueSize\":#{max_call_queue_size}}" }
|
10
|
-
|
11
|
-
before(:all) do
|
12
|
-
Bandwidth.configure do |config|
|
13
|
-
config.debugging = true
|
14
|
-
end
|
15
|
-
@statistics_api_instance = Bandwidth::StatisticsApi.new
|
16
|
-
end
|
17
|
-
|
18
|
-
describe 'test an instance of StatisticsApi' do
|
19
|
-
it 'should create an instance of StatisticsApi' do
|
20
|
-
expect(@statistics_api_instance).to be_instance_of(Bandwidth::StatisticsApi)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
# Get Account Statistics
|
25
|
-
describe 'get_statistics' do
|
26
|
-
it 'gets account statistics' do
|
27
|
-
stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/statistics").
|
28
|
-
to_return(status: 200, headers: get_statistics_headers_stub, body: get_statistics_body_stub)
|
29
|
-
|
30
|
-
data, status_code, headers = @statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID)
|
31
|
-
|
32
|
-
expect(status_code).to eq(200)
|
33
|
-
expect(headers).to eq(get_statistics_headers_stub)
|
34
|
-
expect(data).to be_instance_of(Bandwidth::AccountStatistics)
|
35
|
-
expect(data.current_call_queue_size).to eq(current_call_queue_size)
|
36
|
-
expect(data.max_call_queue_size).to eq(max_call_queue_size)
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'causes an ArgumentError for a missing account_id' do
|
40
|
-
expect {
|
41
|
-
@statistics_api_instance.get_statistics(nil)
|
42
|
-
}.to raise_error(ArgumentError)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|