Skip to content

Commit 51c8b79

Browse files
committed
VAPI-3162-REFER
1 parent 75fc16f commit 51c8b79

5 files changed

Lines changed: 25 additions & 39 deletions

File tree

.openapi-generator/FILES

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ lib/bandwidth-sdk/models/webhook_subscription_request_schema.rb
436436
lib/bandwidth-sdk/models/webhook_subscription_type_enum.rb
437437
lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb
438438
lib/bandwidth-sdk/version.rb
439+
spec/unit/models/refer_call_status_enum_spec.rb
440+
spec/unit/models/refer_complete_callback_spec.rb
439441
spec/unit/models/refer_complete_method_enum_spec.rb
440442
spec/unit/models/refer_spec.rb
441-
spec/unit/models/sip_uri_spec.rb
443+
spec/unit/models/sip_uri_spec.rb

bandwidth.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5115,18 +5115,12 @@ components:
51155115
$ref: '#/components/schemas/callId'
51165116
callUrl:
51175117
$ref: '#/components/schemas/callUrl'
5118-
enqueuedTime:
5119-
$ref: '#/components/schemas/enqueuedTime'
51205118
startTime:
51215119
$ref: '#/components/schemas/startTime'
51225120
answerTime:
51235121
$ref: '#/components/schemas/answerTime'
51245122
tag:
51255123
$ref: '#/components/schemas/tag1'
5126-
referTo:
5127-
type: string
5128-
description: The SIP URI that the call was referred to.
5129-
example: sip:alice@atlanta.example.com
51305124
referCallStatus:
51315125
$ref: '#/components/schemas/referCallStatusEnum'
51325126
referSipResponseCode:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Bandwidth
2+
module Bxml
3+
class Refer < Bandwidth::Bxml::NestableVerb
4+
def initialize(sip_uri, attributes = {})
5+
super('Refer', nil, [sip_uri], attributes)
6+
@attribute_map = {
7+
refer_complete_url: 'referCompleteUrl',
8+
refer_complete_method: 'referCompleteMethod',
9+
refer_complete_fallback_url: 'referCompleteFallbackUrl',
10+
refer_complete_fallback_method: 'referCompleteFallbackMethod',
11+
username: 'username',
12+
password: 'password',
13+
fallback_username: 'fallbackUsername',
14+
fallback_password: 'fallbackPassword',
15+
tag: 'tag'
16+
}
17+
end
18+
end
19+
end
20+
end

lib/bandwidth-sdk/models/refer_complete_callback.rb

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ class ReferCompleteCallback < ApiModelBase
3939
# The URL of the call associated with the event.
4040
attr_accessor :call_url
4141

42-
# (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.
43-
attr_accessor :enqueued_time
44-
4542
# Time the call was started, in ISO 8601 format.
4643
attr_accessor :start_time
4744

@@ -51,9 +48,6 @@ class ReferCompleteCallback < ApiModelBase
5148
# (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
5249
attr_accessor :tag
5350

54-
# The SIP URI that the call was referred to.
55-
attr_accessor :refer_to
56-
5751
attr_accessor :refer_call_status
5852

5953
# The SIP response code received in response to the REFER request. Present when the status of the REFER is known (e.g. 202 Accepted or 405 Method Not Allowed). Absent when the REFER was not attempted.
@@ -96,11 +90,9 @@ def self.attribute_map
9690
:'direction' => :'direction',
9791
:'call_id' => :'callId',
9892
:'call_url' => :'callUrl',
99-
:'enqueued_time' => :'enqueuedTime',
10093
:'start_time' => :'startTime',
10194
:'answer_time' => :'answerTime',
10295
:'tag' => :'tag',
103-
:'refer_to' => :'referTo',
10496
:'refer_call_status' => :'referCallStatus',
10597
:'refer_sip_response_code' => :'referSipResponseCode',
10698
:'notify_sip_response_code' => :'notifySipResponseCode'
@@ -129,11 +121,9 @@ def self.openapi_types
129121
:'direction' => :'CallDirectionEnum',
130122
:'call_id' => :'String',
131123
:'call_url' => :'String',
132-
:'enqueued_time' => :'Time',
133124
:'start_time' => :'Time',
134125
:'answer_time' => :'Time',
135126
:'tag' => :'String',
136-
:'refer_to' => :'String',
137127
:'refer_call_status' => :'ReferCallStatusEnum',
138128
:'refer_sip_response_code' => :'Integer',
139129
:'notify_sip_response_code' => :'Integer'
@@ -143,7 +133,6 @@ def self.openapi_types
143133
# List of attributes with nullable: true
144134
def self.openapi_nullable
145135
Set.new([
146-
:'enqueued_time',
147136
:'answer_time',
148137
:'tag',
149138
:'refer_sip_response_code',
@@ -203,10 +192,6 @@ def initialize(attributes = {})
203192
self.call_url = attributes[:'call_url']
204193
end
205194

206-
if attributes.key?(:'enqueued_time')
207-
self.enqueued_time = attributes[:'enqueued_time']
208-
end
209-
210195
if attributes.key?(:'start_time')
211196
self.start_time = attributes[:'start_time']
212197
end
@@ -219,10 +204,6 @@ def initialize(attributes = {})
219204
self.tag = attributes[:'tag']
220205
end
221206

222-
if attributes.key?(:'refer_to')
223-
self.refer_to = attributes[:'refer_to']
224-
end
225-
226207
if attributes.key?(:'refer_call_status')
227208
self.refer_call_status = attributes[:'refer_call_status']
228209
end
@@ -265,11 +246,9 @@ def ==(o)
265246
direction == o.direction &&
266247
call_id == o.call_id &&
267248
call_url == o.call_url &&
268-
enqueued_time == o.enqueued_time &&
269249
start_time == o.start_time &&
270250
answer_time == o.answer_time &&
271251
tag == o.tag &&
272-
refer_to == o.refer_to &&
273252
refer_call_status == o.refer_call_status &&
274253
refer_sip_response_code == o.refer_sip_response_code &&
275254
notify_sip_response_code == o.notify_sip_response_code
@@ -284,7 +263,7 @@ def eql?(o)
284263
# Calculates hash code according to all attributes.
285264
# @return [Integer] Hash code
286265
def hash
287-
[event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, enqueued_time, start_time, answer_time, tag, refer_to, refer_call_status, refer_sip_response_code, notify_sip_response_code].hash
266+
[event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, start_time, answer_time, tag, refer_call_status, refer_sip_response_code, notify_sip_response_code].hash
288267
end
289268

290269
# Builds the object from hash

spec/unit/models/refer_complete_callback_spec.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
start_time: '2022-06-16T13:15:07.160Z',
1515
answer_time: '2022-06-16T13:15:18.126Z',
1616
tag: 'custom tag',
17-
refer_to: 'sip:alice@atlanta.example.com',
1817
refer_call_status: Bandwidth::ReferCallStatusEnum::SUCCESS
1918
}) }
2019
let(:refer_complete_callback_failure) { Bandwidth::ReferCompleteCallback.new({
@@ -30,7 +29,6 @@
3029
start_time: '2022-06-16T13:15:07.160Z',
3130
answer_time: '2022-06-16T13:15:18.126Z',
3231
tag: 'custom tag',
33-
refer_to: 'sip:alice@atlanta.example.com',
3432
refer_call_status: Bandwidth::ReferCallStatusEnum::FAILURE,
3533
refer_sip_response_code: 405
3634
}) }
@@ -58,7 +56,6 @@
5856
describe '#openapi_nullable' do
5957
it 'expects nullable attributes to be the set of nullable fields' do
6058
expect(Bandwidth::ReferCompleteCallback.openapi_nullable).to eq(Set.new([
61-
:'enqueued_time',
6259
:'answer_time',
6360
:'tag',
6461
:'refer_sip_response_code',
@@ -82,15 +79,13 @@
8279
startTime: '2022-06-16T13:15:07.160Z',
8380
answerTime: '2022-06-16T13:15:18.126Z',
8481
tag: 'custom tag',
85-
referTo: 'sip:alice@atlanta.example.com',
8682
referCallStatus: 'success',
8783
referSipResponseCode: nil,
8884
notifySipResponseCode: nil
8985
})
9086
expect(callback).to be_instance_of(Bandwidth::ReferCompleteCallback)
9187
expect(callback.event_type).to eq('referComplete')
9288
expect(callback.account_id).to eq('9900000')
93-
expect(callback.refer_to).to eq('sip:alice@atlanta.example.com')
9489
expect(callback.refer_call_status).to eq(Bandwidth::ReferCallStatusEnum::SUCCESS)
9590
expect(callback.refer_sip_response_code).to be_nil
9691
expect(callback.notify_sip_response_code).to be_nil
@@ -109,7 +104,6 @@
109104
callUrl: 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
110105
startTime: '2022-06-16T13:15:07.160Z',
111106
answerTime: '2022-06-16T13:15:18.126Z',
112-
referTo: 'sip:alice@atlanta.example.com',
113107
referCallStatus: 'failure',
114108
referSipResponseCode: 405
115109
})
@@ -132,7 +126,6 @@
132126
callUrl: 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
133127
startTime: '2022-06-16T13:15:07.160Z',
134128
answerTime: '2022-06-16T13:15:18.126Z',
135-
referTo: 'sip:alice@atlanta.example.com',
136129
referCallStatus: 'failure',
137130
referSipResponseCode: 202,
138131
notifySipResponseCode: 503
@@ -146,7 +139,7 @@
146139

147140
describe '#to_s' do
148141
it 'returns a string representation of the object' do
149-
expect(refer_complete_callback_success.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=>"inbound", :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", :referTo=>"sip:alice@atlanta.example.com", :referCallStatus=>"success"}')
142+
expect(refer_complete_callback_success.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=>"inbound", :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"}')
150143
end
151144
end
152145

@@ -172,7 +165,6 @@
172165
startTime: '2022-06-16T13:15:07.160Z',
173166
answerTime: '2022-06-16T13:15:18.126Z',
174167
tag: 'custom tag',
175-
referTo: 'sip:alice@atlanta.example.com',
176168
referCallStatus: Bandwidth::ReferCallStatusEnum::SUCCESS
177169
})
178170
end
@@ -191,7 +183,6 @@
191183
startTime: '2022-06-16T13:15:07.160Z',
192184
answerTime: '2022-06-16T13:15:18.126Z',
193185
tag: 'custom tag',
194-
referTo: 'sip:alice@atlanta.example.com',
195186
referCallStatus: Bandwidth::ReferCallStatusEnum::FAILURE,
196187
referSipResponseCode: 405
197188
})

0 commit comments

Comments
 (0)