Skip to content

VAPI-3162-REFER - #211

Open
atelegu wants to merge 18 commits into
mainfrom
VAPI-3162-REFER
Open

VAPI-3162-REFER#211
atelegu wants to merge 18 commits into
mainfrom
VAPI-3162-REFER

Conversation

@atelegu

@atelegu atelegu commented Jun 19, 2026

Copy link
Copy Markdown

Adds the <Refer> BXML verb.

  • lib/bandwidth-sdk/models/bxml/verbs/refer.rb: new Bxml::Refer verb, takes sip_uri untyped/shared - same pattern Transfer already uses with Bxml::SipUri, no separate Refer-only SipUri type and no cross-field validation restricting which SipUri attributes are legal per verb (matches csharp-sdk#201, which dropped this as over-engineering).
  • Spec added at spec/unit/models/bxml/verbs/refer_spec.rb.
  • ReferCompleteCallback model is out of scope here - lands separately once VAPI-3440 merges. Deleted an orphaned Bandwidth::SipUri REST/JSON model (lib/bandwidth-sdk/models/sip_uri.rb) and its bandwidth.yml schema that had no remaining consumer once that callback work was descoped.

Tests: bundle exec rspec spec/unit/models/bxml/verbs/refer_spec.rb passes; no new failures in spec/unit.

VAPI-3436

@atelegu
atelegu requested review from a team as code owners June 19, 2026 07:36
@bwappsec

bwappsec commented Jun 19, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@stampercasey stampercasey left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review from Claude Code — see inline comments for individual findings. Two blockers; the callback model and enums are solid.

Comment thread lib/bandwidth-sdk.rb Outdated
Comment thread lib/bandwidth-sdk/models/refer_complete_callback.rb Outdated
Comment thread lib/bandwidth-sdk/models/sip_uri.rb Outdated
Comment thread lib/bandwidth-sdk/models/refer_complete_callback.rb Outdated
Comment thread spec/unit/models/refer_complete_callback_spec.rb Outdated
Comment thread spec/unit/models/refer_spec.rb Outdated
Comment thread .openapi-generator/FILES Outdated
@atelegu
atelegu requested a review from stampercasey June 22, 2026 09:21
stampercasey
stampercasey previously approved these changes Jun 22, 2026
The referComplete callback model will land later via a separate
api-specs-driven PR once VAPI-3440 merges. This also removes the
top-level Bandwidth::Refer model (and its ReferCompleteMethodEnum/
ReferCallStatusEnum helpers), which duplicated Bxml::Refer at the
openapi-generator layer and had no equivalent for any other BXML
verb (e.g. Transfer has no top-level Bandwidth::Transfer model).
Adds a spec for Bxml::Refer covering construction with a bare
SipUri and correct BXML rendering.
Bandwidth::SipUri (JSON model layer) and its bandwidth.yml schema were
left over from the deleted top-level Refer/ReferCompleteCallback models
and had no remaining consumer. .openapi-generator/FILES still listed
refer.rb, refer_call_status_enum.rb, refer_complete_callback.rb,
refer_complete_method_enum.rb, and their specs after those files were
already deleted.
Comment thread .openapi-generator/FILES

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is autogenerated, it shouldn't have any changes

Comment on lines +8 to +9
super('Refer', nil, [sip_uri], attributes)
@attribute_map = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
super('Refer', nil, [sip_uri], attributes)
@attribute_map = {
super('Refer', nil, [sip_uri], attributes)
@attribute_map = {

Comment on lines +10 to +12
refer_complete_url: 'referCompleteUrl',
refer_complete_method: 'referCompleteMethod',
tag: 'tag'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get annotations for these, we typically copy the description from the docs page and define, their optionality and type, see the other verbs for how it looks

end
end

describe 'test an instance of Refer with a bare SipUri' do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test is unnecessary

end
end
end
end No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
end
end

# Initializer
# @param sip_uri [SipUri] The SIP URI to REFER the call to. Uses the same SipUri verb shared with Transfer.
# @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
def initialize(sip_uri, attributes = {})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def initialize(sip_uri, attributes = {})
def initialize(sip_uri = [], attributes = {})

# @param sip_uri [SipUri] The SIP URI to REFER the call to. Uses the same SipUri verb shared with Transfer.
# @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
def initialize(sip_uri, attributes = {})
super('Refer', nil, [sip_uri], attributes)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
super('Refer', nil, [sip_uri], attributes)
super('Refer', nil, sip_uri, attributes)

this is casted to an array in the super constructor, no need to here

refer_complete_method: 'referCompleteMethod',
tag: 'tag'
}
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
end
end
# <description>
# @param sip_uri [SipUri] <description>
def set_sip_uri(sip_uri)
# set @nested_verbs to array of sip_uri
end

other nestable verbs have functions to update their nested verbs, we should add one here. It doesn't need to match the others in the way they append to the list, it can probably just set @nested_verbs to an array of supplied SipUri.


let(:sip_uri) { Bandwidth::Bxml::SipUri.new('sip:alice@atlanta.example.com') }

let(:instance) { Bandwidth::Bxml::Refer.new(sip_uri, initial_attributes) }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the updates to how sip_uri is handled in the verb, we can make 2 instances of this and test similar to how we do for Gather with an instance and an instance_nested

…tions

Default sip_uri to an empty array and drop the array-wrapping in super()
(parent already casts), add YARD annotations for each attribute matching
Transfer's style, add a set_sip_uri setter, and restructure the spec to
use instance/instance_nested like Gather's spec. Also fixed a trailing
newline drift in .openapi-generator/FILES.
@stampercasey
stampercasey requested a review from ckoegel August 4, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants