From cd26c23c59fb33336594e08edb3b17d4b16460ba Mon Sep 17 00:00:00 2001 From: ckoegel Date: Fri, 21 Mar 2025 15:56:02 -0400 Subject: [PATCH] SWI-7429 Add `mode` to `StartStream` Verb --- lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb | 1 + spec/unit/models/bxml/verbs/start_stream_spec.rb | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb index d55bc2ec..7febd694 100644 --- a/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +++ b/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb @@ -9,6 +9,7 @@ def initialize(stream_params = [], attributes = {}) @attribute_map = { name: 'name', # Optional [String]: A name to refer to this stream by. Used when sending . If not provided, it will default to the generated stream id as sent in the Media Stream Started webhook. + mode: 'mode', # Optional [String]: The mode to use for the stream. unidirectional or bidirectional. Specifies whether the audio being streamed over the WebSocket is bidirectional (the service can both read and write audio over the WebSocket) or unidirectional (one-way, read-only). Default is unidirectional. tracks: 'tracks', # Optional [String]: The part of the call to send a stream from. inbound, outbound or both. Default is inbound. destination: 'destination', # Optional [String]: A websocket URI to send the stream to. The audio from the specified tracks will be sent via websocket to this URL as base64-encoded PCMU/G711 audio. stream_event_url: 'streamEventUrl', # Optional [String]: URL to send the associated Webhook events to during this stream's lifetime. Does not accept BXML. May be a relative URL. diff --git a/spec/unit/models/bxml/verbs/start_stream_spec.rb b/spec/unit/models/bxml/verbs/start_stream_spec.rb index be5a03df..4781ade0 100644 --- a/spec/unit/models/bxml/verbs/start_stream_spec.rb +++ b/spec/unit/models/bxml/verbs/start_stream_spec.rb @@ -3,6 +3,7 @@ let(:initial_attributes) { { name: 'initial_name', + mode: 'unidirectional', tracks: 'inbound', destination: 'https://initial.com', stream_event_url: 'https://initial.com', @@ -15,6 +16,7 @@ let(:new_attributes) { { name: 'new_name', + mode: 'bidirectional', tracks: 'outbound', destination: 'https://new.com', stream_event_url: 'https://new.com', @@ -37,13 +39,13 @@ end it 'tests the to_bxml method of the StartStream instance' do - expected = "\n\n" + expected = "\n\n" expect(instance.to_bxml).to eq(expected) end it 'tests the set_attributes method of the StartStream instance' do instance.set_attributes(new_attributes) - expected = "\n\n" + expected = "\n\n" expect(instance.to_bxml).to eq(expected) end end @@ -55,16 +57,16 @@ end it 'tests the to_bxml method of the nested StartStream instance' do - expected = "\n\n \n\n" + expected = "\n\n \n\n" expect(instance_nested.to_bxml).to eq(expected) end it 'tests the add_stream_param method of the nested StartStream instance' do - expected_single = "\n\n \n \n\n" + expected_single = "\n\n \n \n\n" instance_nested.add_stream_params(stream_param_2) expect(instance_nested.to_bxml).to eq(expected_single) - expected_multiple = "\n\n \n \n \n \n\n" + expected_multiple = "\n\n \n \n \n \n\n" instance_nested.add_stream_params([stream_param_2, stream_param_2]) expect(instance_nested.to_bxml).to eq(expected_multiple) end