VAPI-3162-REFER - #211
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
stampercasey
left a comment
There was a problem hiding this comment.
Review from Claude Code — see inline comments for individual findings. Two blockers; the callback model and enums are solid.
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.
There was a problem hiding this comment.
this file is autogenerated, it shouldn't have any changes
| super('Refer', nil, [sip_uri], attributes) | ||
| @attribute_map = { |
There was a problem hiding this comment.
| super('Refer', nil, [sip_uri], attributes) | |
| @attribute_map = { | |
| super('Refer', nil, [sip_uri], attributes) | |
| @attribute_map = { |
| refer_complete_url: 'referCompleteUrl', | ||
| refer_complete_method: 'referCompleteMethod', | ||
| tag: 'tag' |
There was a problem hiding this comment.
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 |
| end | ||
| end | ||
| end | ||
| end No newline at end of file |
| # 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 = {}) |
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
| 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 |
There was a problem hiding this comment.
| 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) } |
There was a problem hiding this comment.
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.
Adds the
<Refer>BXML verb.lib/bandwidth-sdk/models/bxml/verbs/refer.rb: newBxml::Referverb, takessip_uriuntyped/shared - same patternTransferalready uses withBxml::SipUri, no separate Refer-only SipUri type and no cross-field validation restricting whichSipUriattributes are legal per verb (matches csharp-sdk#201, which dropped this as over-engineering).spec/unit/models/bxml/verbs/refer_spec.rb.ReferCompleteCallbackmodel is out of scope here - lands separately once VAPI-3440 merges. Deleted an orphanedBandwidth::SipUriREST/JSON model (lib/bandwidth-sdk/models/sip_uri.rb) and itsbandwidth.ymlschema that had no remaining consumer once that callback work was descoped.Tests:
bundle exec rspec spec/unit/models/bxml/verbs/refer_spec.rbpasses; no new failures inspec/unit.VAPI-3436