From 898657e4301bbff9cfe70fc1f4976ffe55411323 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 11 Aug 2025 10:41:14 -0400 Subject: [PATCH] SWI-8402 Add New `StartStream` Attributes --- .../bandwidth/sdk/model/bxml/StartStream.java | 84 +++++++++++-------- .../unit/models/bxml/StartStreamVerbTest.java | 4 +- 2 files changed, 51 insertions(+), 37 deletions(-) diff --git a/src/main/java/com/bandwidth/sdk/model/bxml/StartStream.java b/src/main/java/com/bandwidth/sdk/model/bxml/StartStream.java index ca21b0e4..d8148396 100644 --- a/src/main/java/com/bandwidth/sdk/model/bxml/StartStream.java +++ b/src/main/java/com/bandwidth/sdk/model/bxml/StartStream.java @@ -31,43 +31,49 @@ @EqualsAndHashCode /** * - * @param name (str, optional): 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. - * @param mode (str, optional): 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. - * @param tracks (str, optional): The part of the call to send a - * stream from. inbound, outbound or both. Default is - * inbound. - * @param destination (str, optional): 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. See below for more details on the - * websocket packet format. - * @param streamEventUrl (str, optional): URL to send the associated Webhook - * events to during this stream's lifetime. Does not - * accept BXML. May be a relative URL. - * @param streamEventMethod (str, optional): The HTTP method to use for the - * request to streamEventUrl. GET or POST. Default - * value is POST. - * @param username (str, optional): The username to send in the HTTP - * request to streamEventUrl. If specified, the URLs - * must be TLS-encrypted (i.e., https). - * @param password (str, optional): The password to send in the HTTP - * request to streamEventUrl. If specified, the URLs - * must be TLS-encrypted (i.e., https). + * @param name (str, optional): 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. + * @param mode (str, optional): 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. + * @param tracks (str, optional): The part of the call to send a + * stream from. inbound, outbound or both. Default is + * inbound. + * @param destination (str, optional): 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. See below for more details on the + * websocket packet format. + * @param destinationUsername (str, optional): The username to send in the + * `Authorization` header of the initial websocket + * connection to the `destination` URL. + * @param destinationPassword (str, optional): The password to send in the + * `Authorization` header of the initial websocket + * connection to the `destination` URL. + * @param streamEventUrl (str, optional): URL to send the associated Webhook + * events to during this stream's lifetime. Does not + * accept BXML. May be a relative URL. + * @param streamEventMethod (str, optional): The HTTP method to use for the + * request to streamEventUrl. GET or POST. Default + * value is POST. + * @param username (str, optional): The username to send in the HTTP + * request to streamEventUrl. If specified, the URLs + * must be TLS-encrypted (i.e., https). + * @param password (str, optional): The password to send in the HTTP + * request to streamEventUrl. If specified, the URLs + * must be TLS-encrypted (i.e., https). * - * Nested Verbs: - * @param StreamParam: (optional) You may specify up to 12 - * elements nested within a tag. - * These elements define optional user specified - * parameters that will be sent to the destination URL - * when the stream is first started. + * Nested Verbs: + * @param StreamParam: (optional) You may specify up to 12 + * elements nested within a tag. + * These elements define optional user specified + * parameters that will be sent to the destination URL + * when the stream is first started. * */ public class StartStream implements Verb { @@ -87,6 +93,12 @@ public class StartStream implements Verb { @XmlAttribute protected String destination; + @XmlAttribute + protected String destinationUsername; + + @XmlAttribute + protected String destinationPassword; + @XmlAttribute @Getter protected String streamEventUrl; diff --git a/src/test/java/com/bandwidth/sdk/unit/models/bxml/StartStreamVerbTest.java b/src/test/java/com/bandwidth/sdk/unit/models/bxml/StartStreamVerbTest.java index ec57cadd..c724bef8 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/bxml/StartStreamVerbTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/bxml/StartStreamVerbTest.java @@ -40,6 +40,8 @@ public class StartStreamVerbTest { .mode("unidirectional") .tracks(TracksEnum.inbound) .destination("testurl.com") + .destinationUsername("destinationUsername") + .destinationPassword("destinationPassword") .streamEventUrl("eventurl.com") .streamEventMethod("POST") .username("user") @@ -50,7 +52,7 @@ public class StartStreamVerbTest { @Test public void startStreamVerbWorks() throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(Bxml.class); - String expectedBxml = ""; + String expectedBxml = ""; assertThat(new Bxml().with(startStream).toBxml(jaxbContext), is(expectedBxml)); }