bandwidth-sdk 18.1.4 → 18.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/README.md +2 -0
- data/bandwidth.yml +63 -2
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +737 -135
- data/coverage/index.html +13402 -6908
- data/custom_templates/configuration.mustache +6 -2
- data/docs/AnswerCallback.md +1 -1
- data/docs/BridgeCompleteCallback.md +1 -1
- data/docs/BridgeTargetCompleteCallback.md +1 -1
- data/docs/ConferenceCompletedCallback.md +1 -1
- data/docs/ConferenceCreatedCallback.md +1 -1
- data/docs/ConferenceMemberExitCallback.md +1 -1
- data/docs/ConferenceMemberJoinCallback.md +1 -1
- data/docs/ConferenceRecordingAvailableCallback.md +1 -1
- data/docs/ConferenceRedirectCallback.md +1 -1
- data/docs/DisconnectCallback.md +1 -1
- data/docs/DtmfCallback.md +1 -1
- data/docs/GatherCallback.md +1 -1
- data/docs/InitiateCallback.md +1 -1
- data/docs/MachineDetectionCompleteCallback.md +1 -1
- data/docs/RbmActionBase.md +1 -1
- data/docs/RbmSuggestionResponse.md +1 -1
- data/docs/RecordingAvailableCallback.md +1 -1
- data/docs/RecordingCompleteCallback.md +1 -1
- data/docs/RedirectCallback.md +1 -1
- data/docs/ReferCallStatusEnum.md +15 -0
- data/docs/ReferCompleteCallback.md +46 -0
- data/docs/TranscriptionAvailableCallback.md +1 -1
- data/docs/TransferAnswerCallback.md +1 -1
- data/docs/TransferCompleteCallback.md +1 -1
- data/docs/TransferDisconnectCallback.md +1 -1
- data/lib/bandwidth-sdk/configuration.rb +6 -2
- data/lib/bandwidth-sdk/models/answer_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/bxml/verbs/refer.rb +24 -0
- data/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb +3 -1
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/gather_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/initiate_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/redirect_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/refer_call_status_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/refer_complete_callback.rb +309 -0
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +1 -1
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +3 -0
- data/spec/unit/api/calls_api_spec.rb +1 -2
- data/spec/unit/api/conferences_api_spec.rb +1 -2
- data/spec/unit/api/endpoints_api_spec.rb +1 -2
- data/spec/unit/api/media_api_spec.rb +1 -2
- data/spec/unit/api/messages_api_spec.rb +1 -2
- data/spec/unit/api/mfa_api_spec.rb +1 -2
- data/spec/unit/api/multi_channel_api_spec.rb +1 -2
- data/spec/unit/api/phone_number_lookup_api_spec.rb +1 -2
- data/spec/unit/api/recordings_api_spec.rb +1 -2
- data/spec/unit/api/statistics_api_spec.rb +1 -2
- data/spec/unit/api/toll_free_verification_api_spec.rb +1 -2
- data/spec/unit/api/transcriptions_api_spec.rb +1 -2
- data/spec/unit/models/bxml/verbs/refer_spec.rb +54 -0
- data/spec/unit/models/refer_call_status_enum_spec.rb +31 -0
- data/spec/unit/models/refer_complete_callback_spec.rb +123 -0
- metadata +12 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Unit tests for Bandwidth::ReferCallStatusEnum
|
|
2
|
+
describe Bandwidth::ReferCallStatusEnum do
|
|
3
|
+
describe 'constants' do
|
|
4
|
+
it 'defines SUCCESS' do
|
|
5
|
+
expect(Bandwidth::ReferCallStatusEnum::SUCCESS).to eq('success')
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it 'defines FAILURE' do
|
|
9
|
+
expect(Bandwidth::ReferCallStatusEnum::FAILURE).to eq('failure')
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
describe '.all_vars' do
|
|
14
|
+
it 'returns every valid enum value' do
|
|
15
|
+
expect(Bandwidth::ReferCallStatusEnum.all_vars).to eq(['success', 'failure'])
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
describe '.build_from_hash' do
|
|
20
|
+
it 'returns the value when it matches a valid enum value' do
|
|
21
|
+
expect(Bandwidth::ReferCallStatusEnum.build_from_hash('success')).to eq('success')
|
|
22
|
+
expect(Bandwidth::ReferCallStatusEnum.build_from_hash('failure')).to eq('failure')
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it 'raises an error for an invalid enum value' do
|
|
26
|
+
expect {
|
|
27
|
+
Bandwidth::ReferCallStatusEnum.build_from_hash('invalid')
|
|
28
|
+
}.to raise_error(RuntimeError)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Unit tests for Bandwidth::ReferCompleteCallback
|
|
2
|
+
describe Bandwidth::ReferCompleteCallback do
|
|
3
|
+
let(:refer_complete_callback_default) { Bandwidth::ReferCompleteCallback.new }
|
|
4
|
+
let(:refer_complete_callback_values) { Bandwidth::ReferCompleteCallback.new({
|
|
5
|
+
event_type: 'referComplete',
|
|
6
|
+
event_time: '2022-06-16T13:15:07.160Z',
|
|
7
|
+
account_id: '9900000',
|
|
8
|
+
application_id: '04e88489-df02-4e34-a0ee-27a91849555f',
|
|
9
|
+
from: '+19195554321',
|
|
10
|
+
to: '+19195551234',
|
|
11
|
+
direction: Bandwidth::CallDirectionEnum::OUTBOUND,
|
|
12
|
+
call_id: 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
|
|
13
|
+
call_url: 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
|
|
14
|
+
start_time: '2022-06-16T13:15:07.160Z',
|
|
15
|
+
answer_time: '2022-06-16T13:15:18.126Z',
|
|
16
|
+
tag: 'custom tag',
|
|
17
|
+
refer_call_status: Bandwidth::ReferCallStatusEnum::SUCCESS,
|
|
18
|
+
refer_sip_response_code: 202,
|
|
19
|
+
notify_sip_response_code: 200
|
|
20
|
+
}) }
|
|
21
|
+
|
|
22
|
+
describe '#initialize' do
|
|
23
|
+
it 'causes an ArgumentError by passing an Array to the initialize method' do
|
|
24
|
+
expect {
|
|
25
|
+
Bandwidth::ReferCompleteCallback.new([])
|
|
26
|
+
}.to raise_error(ArgumentError)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'causes an ArgumentError by passing an invalid attribute to the initialize method' do
|
|
30
|
+
expect {
|
|
31
|
+
Bandwidth::ReferCompleteCallback.new({ invalid: true })
|
|
32
|
+
}.to raise_error(ArgumentError)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe '#acceptable_attributes' do
|
|
37
|
+
it 'expects acceptable JSON attributes to be those in the attribute map' do
|
|
38
|
+
expect(Bandwidth::ReferCompleteCallback.acceptable_attributes).to eq(Bandwidth::ReferCompleteCallback.attribute_map.values)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe '#openapi_nullable' do
|
|
43
|
+
it 'expects nullable attributes to be the set of nullable fields' do
|
|
44
|
+
expect(Bandwidth::ReferCompleteCallback.openapi_nullable).to eq(Set.new([
|
|
45
|
+
:'answer_time',
|
|
46
|
+
:'tag'
|
|
47
|
+
]))
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
describe '#build_from_hash' do
|
|
52
|
+
it 'validates instance of ReferCompleteCallback created by the build_from_hash method' do
|
|
53
|
+
refer_complete_callback_from_hash = Bandwidth::ReferCompleteCallback.build_from_hash({
|
|
54
|
+
eventType: 'referComplete',
|
|
55
|
+
eventTime: '2022-06-16T13:15:07.160Z',
|
|
56
|
+
accountId: '9900000',
|
|
57
|
+
applicationId: '04e88489-df02-4e34-a0ee-27a91849555f',
|
|
58
|
+
from: '+19195554321',
|
|
59
|
+
to: '+19195551234',
|
|
60
|
+
direction: Bandwidth::CallDirectionEnum::OUTBOUND,
|
|
61
|
+
callId: 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
|
|
62
|
+
callUrl: 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
|
|
63
|
+
startTime: '2022-06-16T13:15:07.160Z',
|
|
64
|
+
answerTime: '2022-06-16T13:15:18.126Z',
|
|
65
|
+
tag: 'custom tag',
|
|
66
|
+
referCallStatus: Bandwidth::ReferCallStatusEnum::SUCCESS,
|
|
67
|
+
referSipResponseCode: 202,
|
|
68
|
+
notifySipResponseCode: 200
|
|
69
|
+
})
|
|
70
|
+
expect(refer_complete_callback_from_hash).to be_instance_of(Bandwidth::ReferCompleteCallback)
|
|
71
|
+
expect(refer_complete_callback_from_hash.event_type).to eq('referComplete')
|
|
72
|
+
expect(refer_complete_callback_from_hash.event_time).to eq(Time.parse('2022-06-16T13:15:07.160Z'))
|
|
73
|
+
expect(refer_complete_callback_from_hash.account_id).to eq('9900000')
|
|
74
|
+
expect(refer_complete_callback_from_hash.application_id).to eq('04e88489-df02-4e34-a0ee-27a91849555f')
|
|
75
|
+
expect(refer_complete_callback_from_hash.from).to eq('+19195554321')
|
|
76
|
+
expect(refer_complete_callback_from_hash.to).to eq('+19195551234')
|
|
77
|
+
expect(refer_complete_callback_from_hash.direction).to eq(Bandwidth::CallDirectionEnum::OUTBOUND)
|
|
78
|
+
expect(refer_complete_callback_from_hash.call_id).to eq('c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85')
|
|
79
|
+
expect(refer_complete_callback_from_hash.call_url).to eq('https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85')
|
|
80
|
+
expect(refer_complete_callback_from_hash.start_time).to eq(Time.parse('2022-06-16T13:15:07.160Z'))
|
|
81
|
+
expect(refer_complete_callback_from_hash.answer_time).to eq(Time.parse('2022-06-16T13:15:18.126Z'))
|
|
82
|
+
expect(refer_complete_callback_from_hash.tag).to eq('custom tag')
|
|
83
|
+
expect(refer_complete_callback_from_hash.refer_call_status).to eq(Bandwidth::ReferCallStatusEnum::SUCCESS)
|
|
84
|
+
expect(refer_complete_callback_from_hash.refer_sip_response_code).to eq(202)
|
|
85
|
+
expect(refer_complete_callback_from_hash.notify_sip_response_code).to eq(200)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
describe '#to_s' do
|
|
90
|
+
it 'returns a string representation of the object' do
|
|
91
|
+
expect(refer_complete_callback_values.to_s).to eq({ :eventType => 'referComplete', :eventTime => '2022-06-16T13:15:07.160Z', :accountId => '9900000', :applicationId => '04e88489-df02-4e34-a0ee-27a91849555f', :from => '+19195554321', :to => '+19195551234', :direction => 'outbound', :callId => 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', :callUrl => 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', :startTime => '2022-06-16T13:15:07.160Z', :answerTime => '2022-06-16T13:15:18.126Z', :tag => 'custom tag', :referCallStatus => 'success', :referSipResponseCode => 202, :notifySipResponseCode => 200 }.to_s)
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
describe '#eq? #==' do
|
|
96
|
+
it 'returns true/false when comparing objects' do
|
|
97
|
+
expect(refer_complete_callback_default.eql?(Bandwidth::ReferCompleteCallback.new)).to be true
|
|
98
|
+
expect(refer_complete_callback_default.eql?(refer_complete_callback_values)).to be false
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
describe '#to_body #to_hash' do
|
|
103
|
+
it 'returns a hash representation of the object' do
|
|
104
|
+
expect(refer_complete_callback_values.to_body).to eq({
|
|
105
|
+
eventType: 'referComplete',
|
|
106
|
+
eventTime: '2022-06-16T13:15:07.160Z',
|
|
107
|
+
accountId: '9900000',
|
|
108
|
+
applicationId: '04e88489-df02-4e34-a0ee-27a91849555f',
|
|
109
|
+
from: '+19195554321',
|
|
110
|
+
to: '+19195551234',
|
|
111
|
+
direction: Bandwidth::CallDirectionEnum::OUTBOUND,
|
|
112
|
+
callId: 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
|
|
113
|
+
callUrl: 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
|
|
114
|
+
startTime: '2022-06-16T13:15:07.160Z',
|
|
115
|
+
answerTime: '2022-06-16T13:15:18.126Z',
|
|
116
|
+
tag: 'custom tag',
|
|
117
|
+
referCallStatus: Bandwidth::ReferCallStatusEnum::SUCCESS,
|
|
118
|
+
referSipResponseCode: 202,
|
|
119
|
+
notifySipResponseCode: 200
|
|
120
|
+
})
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bandwidth-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 18.
|
|
4
|
+
version: 18.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bandwidth
|
|
@@ -319,6 +319,8 @@ files:
|
|
|
319
319
|
- docs/RecordingsApi.md
|
|
320
320
|
- docs/RedirectCallback.md
|
|
321
321
|
- docs/RedirectMethodEnum.md
|
|
322
|
+
- docs/ReferCallStatusEnum.md
|
|
323
|
+
- docs/ReferCompleteCallback.md
|
|
322
324
|
- docs/SipConnectionMetadata.md
|
|
323
325
|
- docs/SipCredentials.md
|
|
324
326
|
- docs/SmsMessageContent.md
|
|
@@ -414,6 +416,7 @@ files:
|
|
|
414
416
|
- lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb
|
|
415
417
|
- lib/bandwidth-sdk/models/bxml/verbs/record.rb
|
|
416
418
|
- lib/bandwidth-sdk/models/bxml/verbs/redirect.rb
|
|
419
|
+
- lib/bandwidth-sdk/models/bxml/verbs/refer.rb
|
|
417
420
|
- lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb
|
|
418
421
|
- lib/bandwidth-sdk/models/bxml/verbs/ring.rb
|
|
419
422
|
- lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb
|
|
@@ -574,6 +577,8 @@ files:
|
|
|
574
577
|
- lib/bandwidth-sdk/models/recording_transcriptions.rb
|
|
575
578
|
- lib/bandwidth-sdk/models/redirect_callback.rb
|
|
576
579
|
- lib/bandwidth-sdk/models/redirect_method_enum.rb
|
|
580
|
+
- lib/bandwidth-sdk/models/refer_call_status_enum.rb
|
|
581
|
+
- lib/bandwidth-sdk/models/refer_complete_callback.rb
|
|
577
582
|
- lib/bandwidth-sdk/models/sip_connection_metadata.rb
|
|
578
583
|
- lib/bandwidth-sdk/models/sip_credentials.rb
|
|
579
584
|
- lib/bandwidth-sdk/models/sms_message_content.rb
|
|
@@ -679,6 +684,7 @@ files:
|
|
|
679
684
|
- spec/unit/models/bxml/verbs/play_audio_spec.rb
|
|
680
685
|
- spec/unit/models/bxml/verbs/record_spec.rb
|
|
681
686
|
- spec/unit/models/bxml/verbs/redirect_spec.rb
|
|
687
|
+
- spec/unit/models/bxml/verbs/refer_spec.rb
|
|
682
688
|
- spec/unit/models/bxml/verbs/resume_recording_spec.rb
|
|
683
689
|
- spec/unit/models/bxml/verbs/ring_spec.rb
|
|
684
690
|
- spec/unit/models/bxml/verbs/send_dtmf_spec.rb
|
|
@@ -838,6 +844,8 @@ files:
|
|
|
838
844
|
- spec/unit/models/recording_transcriptions_spec.rb
|
|
839
845
|
- spec/unit/models/redirect_callback_spec.rb
|
|
840
846
|
- spec/unit/models/redirect_method_enum_spec.rb
|
|
847
|
+
- spec/unit/models/refer_call_status_enum_spec.rb
|
|
848
|
+
- spec/unit/models/refer_complete_callback_spec.rb
|
|
841
849
|
- spec/unit/models/sip_connection_metadata_spec.rb
|
|
842
850
|
- spec/unit/models/sip_credentials_spec.rb
|
|
843
851
|
- spec/unit/models/sms_message_content_spec.rb
|
|
@@ -962,6 +970,7 @@ test_files:
|
|
|
962
970
|
- spec/unit/models/bxml/verbs/play_audio_spec.rb
|
|
963
971
|
- spec/unit/models/bxml/verbs/record_spec.rb
|
|
964
972
|
- spec/unit/models/bxml/verbs/redirect_spec.rb
|
|
973
|
+
- spec/unit/models/bxml/verbs/refer_spec.rb
|
|
965
974
|
- spec/unit/models/bxml/verbs/resume_recording_spec.rb
|
|
966
975
|
- spec/unit/models/bxml/verbs/ring_spec.rb
|
|
967
976
|
- spec/unit/models/bxml/verbs/send_dtmf_spec.rb
|
|
@@ -1121,6 +1130,8 @@ test_files:
|
|
|
1121
1130
|
- spec/unit/models/recording_transcriptions_spec.rb
|
|
1122
1131
|
- spec/unit/models/redirect_callback_spec.rb
|
|
1123
1132
|
- spec/unit/models/redirect_method_enum_spec.rb
|
|
1133
|
+
- spec/unit/models/refer_call_status_enum_spec.rb
|
|
1134
|
+
- spec/unit/models/refer_complete_callback_spec.rb
|
|
1124
1135
|
- spec/unit/models/sip_connection_metadata_spec.rb
|
|
1125
1136
|
- spec/unit/models/sip_credentials_spec.rb
|
|
1126
1137
|
- spec/unit/models/sms_message_content_spec.rb
|