Skip to content

Commit 94da011

Browse files
committed
Merge branch 'main' of https://github.com/Bandwidth/java-sdk into SWI-8529
2 parents 8292263 + 9138d71 commit 94da011

File tree

13 files changed

+201
-15
lines changed

13 files changed

+201
-15
lines changed

api/openapi.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7949,6 +7949,7 @@ components:
79497949
- sms
79507950
- mms
79517951
- rcs
7952+
- rcs
79527953
example: sms
79537954
type: string
79547955
productTypeEnum:
@@ -7965,6 +7966,20 @@ components:
79657966
- RBM_CONVERSATIONAL
79667967
example: P2P
79677968
type: string
7969+
productTypeEnum:
7970+
description: The type of product associated with the message.
7971+
enum:
7972+
- LOCAL_A2P
7973+
- P2P
7974+
- SHORT_CODE_REACH
7975+
- TOLL_FREE
7976+
- HOSTED_SHORT_CODE
7977+
- ALPHA_NUMERIC
7978+
- RBM_MEDIA
7979+
- RBM_RICH
7980+
- RBM_CONVERSATIONAL
7981+
example: P2P
7982+
type: string
79687983
fieldError:
79697984
example:
79707985
fieldName: from
@@ -7989,6 +8004,9 @@ components:
79898004
nextPageToken: GL83PD3C
79908005
prevPage: https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902
79918006
messages:
8007+
- callingNumberCountryA3: USA
8008+
product: P2P
8009+
sourceTn: "+15554443333"
79928010
- callingNumberCountryA3: USA
79938011
product: P2P
79948012
sourceTn: "+15554443333"
@@ -7997,6 +8015,7 @@ components:
79978015
messageId: 1589228074636lm4k2je7j7jklbn2
79988016
errorCode: 9902
79998017
calledNumberCountryA3: USA
8018+
calledNumberCountryA3: USA
80008019
destinationTn: "+15554442222"
80018020
segmentCount: 1
80028021
messageStatus: RECEIVED
@@ -8009,9 +8028,14 @@ components:
80098028
recipientCount: 1
80108029
campaignClass: T
80118030
bwLatency: 20
8031+
bwLatency: 20
80128032
attachmentCount: 1
80138033
location: 123ID
8034+
location: 123ID
80148035
messageSize: 27
8036+
- callingNumberCountryA3: USA
8037+
product: P2P
8038+
sourceTn: "+15554443333"
80158039
- callingNumberCountryA3: USA
80168040
product: P2P
80178041
sourceTn: "+15554443333"
@@ -8020,6 +8044,7 @@ components:
80208044
messageId: 1589228074636lm4k2je7j7jklbn2
80218045
errorCode: 9902
80228046
calledNumberCountryA3: USA
8047+
calledNumberCountryA3: USA
80238048
destinationTn: "+15554442222"
80248049
segmentCount: 1
80258050
messageStatus: RECEIVED
@@ -8032,8 +8057,10 @@ components:
80328057
recipientCount: 1
80338058
campaignClass: T
80348059
bwLatency: 20
8060+
bwLatency: 20
80358061
attachmentCount: 1
80368062
location: 123ID
8063+
location: 123ID
80378064
messageSize: 27
80388065
totalCount: 100
80398066
properties:
@@ -8052,6 +8079,8 @@ components:
80528079
type: object
80538080
listMessageItem:
80548081
example:
8082+
callingNumberCountryA3: USA
8083+
product: P2P
80558084
callingNumberCountryA3: USA
80568085
product: P2P
80578086
sourceTn: "+15554443333"
@@ -8060,6 +8089,7 @@ components:
80608089
messageId: 1589228074636lm4k2je7j7jklbn2
80618090
errorCode: 9902
80628091
calledNumberCountryA3: USA
8092+
calledNumberCountryA3: USA
80638093
destinationTn: "+15554442222"
80648094
segmentCount: 1
80658095
messageStatus: RECEIVED
@@ -8072,8 +8102,10 @@ components:
80728102
recipientCount: 1
80738103
campaignClass: T
80748104
bwLatency: 20
8105+
bwLatency: 20
80758106
attachmentCount: 1
80768107
location: 123ID
8108+
location: 123ID
80778109
messageSize: 27
80788110
properties:
80798111
messageId:

bandwidth.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,6 +1729,7 @@ components:
17291729
- sms
17301730
- mms
17311731
- rcs
1732+
- rcs
17321733
example: sms
17331734
productTypeEnum:
17341735
type: string
@@ -1744,6 +1745,20 @@ components:
17441745
- RBM_RICH
17451746
- RBM_CONVERSATIONAL
17461747
example: P2P
1748+
productTypeEnum:
1749+
type: string
1750+
description: The type of product associated with the message.
1751+
enum:
1752+
- LOCAL_A2P
1753+
- P2P
1754+
- SHORT_CODE_REACH
1755+
- TOLL_FREE
1756+
- HOSTED_SHORT_CODE
1757+
- ALPHA_NUMERIC
1758+
- RBM_MEDIA
1759+
- RBM_RICH
1760+
- RBM_CONVERSATIONAL
1761+
example: P2P
17471762
fieldError:
17481763
type: object
17491764
properties:

custom_templates/pom.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,13 +500,13 @@
500500
{{#swagger2AnnotationLibrary}}
501501
<swagger-annotations-version>2.2.15</swagger-annotations-version>
502502
{{/swagger2AnnotationLibrary}}
503-
<okhttp-version>4.12.0</okhttp-version>
503+
<okhttp-version>5.0.0</okhttp-version>
504504
<gson-version>2.10.1</gson-version>
505505
<version.commons-io>2.14.0</version.commons-io>
506506
<commons-lang3-version>3.18.0</commons-lang3-version>
507507
<jaxb.version>4.0.0</jaxb.version>
508508
{{#openApiNullable}}
509-
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
509+
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
510510
{{/openApiNullable}}
511511
{{#joda}}
512512
<jodatime-version>2.12.0</jodatime-version>

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,12 @@
412412
<maven.compiler.source>${java.version}</maven.compiler.source>
413413
<maven.compiler.target>${java.version}</maven.compiler.target>
414414
<gson-fire-version>1.9.0</gson-fire-version>
415-
<okhttp-version>4.12.0</okhttp-version>
415+
<okhttp-version>5.0.0</okhttp-version>
416416
<gson-version>2.10.1</gson-version>
417417
<version.commons-io>2.14.0</version.commons-io>
418418
<commons-lang3-version>3.18.0</commons-lang3-version>
419419
<jaxb.version>4.0.0</jaxb.version>
420-
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
420+
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
421421
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
422422
<beanvalidation-version>2.0.2</beanvalidation-version>
423423
<junit-version>5.10.3</junit-version>

src/main/java/com/bandwidth/sdk/api/MessagesApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.bandwidth.sdk.model.MessagesList;
3737
import com.bandwidth.sdk.model.MessagingRequestError;
3838
import com.bandwidth.sdk.model.ProductTypeEnum;
39+
import com.bandwidth.sdk.model.ProductTypeEnum;
3940

4041
import java.lang.reflect.Type;
4142
import java.util.ArrayList;

src/main/java/com/bandwidth/sdk/model/ListMessageItem.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
842842
if ((jsonObj.get("location") != null && !jsonObj.get("location").isJsonNull()) && !jsonObj.get("location").isJsonPrimitive()) {
843843
throw new IllegalArgumentException(String.format("Expected the field `location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("location").toString()));
844844
}
845+
if ((jsonObj.get("callingNumberCountryA3") != null && !jsonObj.get("callingNumberCountryA3").isJsonNull()) && !jsonObj.get("callingNumberCountryA3").isJsonPrimitive()) {
846+
throw new IllegalArgumentException(String.format("Expected the field `callingNumberCountryA3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("callingNumberCountryA3").toString()));
847+
}
848+
if ((jsonObj.get("calledNumberCountryA3") != null && !jsonObj.get("calledNumberCountryA3").isJsonNull()) && !jsonObj.get("calledNumberCountryA3").isJsonPrimitive()) {
849+
throw new IllegalArgumentException(String.format("Expected the field `calledNumberCountryA3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("calledNumberCountryA3").toString()));
850+
}
851+
if ((jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) && !jsonObj.get("product").isJsonPrimitive()) {
852+
throw new IllegalArgumentException(String.format("Expected the field `product` to be a primitive type in the JSON string but got `%s`", jsonObj.get("product").toString()));
853+
}
854+
if ((jsonObj.get("location") != null && !jsonObj.get("location").isJsonNull()) && !jsonObj.get("location").isJsonPrimitive()) {
855+
throw new IllegalArgumentException(String.format("Expected the field `location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("location").toString()));
856+
}
845857
}
846858

847859
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

src/main/java/com/bandwidth/sdk/model/bxml/StopStream.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*
2626
* @param name (str, optional): The name of the stream to stop.
2727
* This is either the user selected name when sending the <StartStream> verb, or the system generated name returned in the Media Stream Started webhook if <StartStream> was sent with no name attribute.
28+
* @param wait (bool, optional): If true, the BXML interpreter will wait for the stream to stop before processing the next verb.
2829
*/
2930
public class StopStream implements Verb {
3031

@@ -33,6 +34,14 @@ public class StopStream implements Verb {
3334
@XmlAttribute
3435
protected String name;
3536

37+
@XmlAttribute
38+
protected Boolean wait;
39+
40+
// Original constructor for backwards compatibility
41+
public StopStream(String name) {
42+
this.name = name;
43+
}
44+
3645
@Override
3746
public String getVerbName() {
3847
return TYPE_NAME;

src/test/java/com/bandwidth/sdk/smoke/MessagesApiTest.java

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import com.bandwidth.sdk.model.MessageTypeEnum;
1414
import com.bandwidth.sdk.model.MessagesList;
1515
import com.bandwidth.sdk.model.PriorityEnum;
16+
import com.bandwidth.sdk.model.ProductTypeEnum;
17+
1618
import org.junit.jupiter.api.Assertions;
1719
import org.junit.jupiter.api.Test;
1820

@@ -50,6 +52,16 @@ public class MessagesApiTest {
5052
String fromDateTime = null;
5153
String toDateTime = null;
5254
String campaignId = null;
55+
Integer fromBwLatency = null;
56+
Boolean bwQueued = null;
57+
ProductTypeEnum product = null;
58+
String location = null;
59+
String callingNumberCountryA3 = null;
60+
String calledNumberCountryA3 = null;
61+
Integer fromSegmentCount = null;
62+
Integer toSegmentCount = null;
63+
Integer fromMessageSize = null;
64+
Integer toMessageSize = null;
5365
String sort = "sourceTn:desc";
5466
String pageToken = null;
5567
Integer limit = 50;
@@ -72,9 +84,9 @@ public void listMessagesTest() throws ApiException {
7284
Basic.setUsername(BW_USERNAME);
7385
Basic.setPassword(BW_PASSWORD);
7486
MessagesList response = api.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus,
75-
messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort,
76-
pageToken,
77-
limit, false);
87+
messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, fromBwLatency,
88+
bwQueued, product, location, callingNumberCountryA3, calledNumberCountryA3, fromSegmentCount, toSegmentCount,
89+
fromMessageSize, toMessageSize, sort, pageToken, limit, false);
7890

7991
assertThat(response, instanceOf(MessagesList.class));
8092
assertThat(response.getTotalCount(), greaterThan(0));
@@ -99,9 +111,11 @@ public void listMessageBadRequestTest() {
99111
String pageToken = "gdEewhcJLQRB5"; // Bad Token
100112

101113
ApiException exception = Assertions.assertThrows(ApiException.class,
102-
() -> api.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection,
103-
carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort, pageToken,
104-
limit, false));
114+
() -> api.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus,
115+
messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime,
116+
campaignId, fromBwLatency, bwQueued, product, location, callingNumberCountryA3,
117+
calledNumberCountryA3, fromSegmentCount, toSegmentCount, fromMessageSize,
118+
toMessageSize, sort, pageToken, limit, false));
105119
assertThat(exception.getCode(), is(400));
106120

107121
}
@@ -113,9 +127,11 @@ public void listMessageUnauthorizedTest() {
113127
Basic.setPassword("bad_password");
114128

115129
ApiException exception = Assertions.assertThrows(ApiException.class,
116-
() -> api.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection,
117-
carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort, pageToken,
118-
limit, false));
130+
() -> api.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus,
131+
messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime,
132+
campaignId, fromBwLatency, bwQueued, product, location, callingNumberCountryA3,
133+
calledNumberCountryA3, fromSegmentCount, toSegmentCount, fromMessageSize,
134+
toMessageSize, sort, pageToken, limit, false));
119135
assertThat(exception.getCode(), is(401));
120136
}
121137

src/test/java/com/bandwidth/sdk/unit/api/MessagesApiTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void testCreateMessage() throws ApiException {
8383
public void testListMessages() throws ApiException {
8484
ApiResponse<MessagesList> response = api.listMessagesWithHttpInfo(
8585
BW_ACCOUNT_ID, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
86-
null);
86+
null, null, null, null, null, null, null, null, null, null, null);
8787

8888
assertThat(response.getStatusCode(), is(200));
8989
assertThat(response.getData(), instanceOf(MessagesList.class));
@@ -113,5 +113,10 @@ public void testListMessages() throws ApiException {
113113
assertThat(response.getData().getMessages().get(0).getRecipientCount(), instanceOf(Integer.class));
114114
assertThat(response.getData().getMessages().get(0).getCampaignClass(), instanceOf(String.class));
115115
assertThat(response.getData().getMessages().get(0).getCampaignId(), instanceOf(String.class));
116+
assertThat(response.getData().getMessages().get(0).getBwLatency(), instanceOf(Integer.class));
117+
assertThat(response.getData().getMessages().get(0).getCallingNumberCountryA3(), instanceOf(String.class));
118+
assertThat(response.getData().getMessages().get(0).getCalledNumberCountryA3(), instanceOf(String.class));
119+
assertThat(response.getData().getMessages().get(0).getProduct(), instanceOf(String.class));
120+
assertThat(response.getData().getMessages().get(0).getLocation(), instanceOf(String.class));
116121
}
117122
}

src/test/java/com/bandwidth/sdk/unit/models/ListMessageItemTest.java

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ public class ListMessageItemTest {
4444
.attachmentCount(10)
4545
.recipientCount(10)
4646
.campaignClass("campaignClass")
47-
.campaignId("campaignId");
47+
.campaignId("campaignId")
48+
.bwLatency(100)
49+
.callingNumberCountryA3("USA")
50+
.calledNumberCountryA3("USA")
51+
.product("product")
52+
.location("location");
4853

4954
/**
5055
* Model tests for ListMessageItem
@@ -190,4 +195,44 @@ public void campaignIdTest() {
190195
assertThat(model.getCampaignId(), instanceOf(String.class));
191196
}
192197

198+
/**
199+
* Test the property 'bwLatency'
200+
*/
201+
@Test
202+
public void bwLatencyTest() {
203+
assertThat(model.getBwLatency(), instanceOf(Integer.class));
204+
}
205+
206+
/**
207+
* Test the property 'callingNumberCountryA3'
208+
*/
209+
@Test
210+
public void callingNumberCountryA3Test() {
211+
assertThat(model.getCallingNumberCountryA3(), instanceOf(String.class));
212+
}
213+
214+
/**
215+
* Test the property 'calledNumberCountryA3'
216+
*/
217+
@Test
218+
public void calledNumberCountryA3Test() {
219+
assertThat(model.getCalledNumberCountryA3(), instanceOf(String.class));
220+
}
221+
222+
/**
223+
* Test the property 'product'
224+
*/
225+
@Test
226+
public void productTest() {
227+
assertThat(model.getProduct(), instanceOf(String.class));
228+
}
229+
230+
/**
231+
* Test the property 'location'
232+
*/
233+
@Test
234+
public void locationTest() {
235+
assertThat(model.getLocation(), instanceOf(String.class));
236+
}
237+
193238
}

0 commit comments

Comments
 (0)