From 061abec5c7f8c154329275091757f5036d91c745 Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Fri, 19 Jun 2026 17:20:41 +0000 Subject: [PATCH 1/2] Generate SDK with OpenAPI Generator Version --- api/openapi.yaml | 17 ++++--- bandwidth.yml | 20 +++++--- docs/InboundCallbackTypeEnum.md | 2 +- docs/RbmSuggestionResponse.md | 1 + src/main/java/com/bandwidth/sdk/JSON.java | 2 +- .../com/bandwidth/sdk/model/Callback.java | 4 +- .../sdk/model/InboundCallbackTypeEnum.java | 4 +- .../sdk/model/RbmSuggestionResponse.java | 47 +++++++++++++++++-- 8 files changed, 75 insertions(+), 22 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index e2120313..829a814e 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -6480,8 +6480,8 @@ components:

This Inbound Message Webhook is an envelope containing either a received (MO) message to your message-enabled Bandwidth telephone number or a multichannel client's response to a suggestion response or location request. -

The payload type will be one of message-received, suggestion-response, or location-request-response. -

Note that suggestion-response and location-request-response callback types are pertinent only for RBM messages sent from the /messages/multiChannel endpoint. +

The payload type will be one of message-received, suggestion-response, or requested-location-response. +

Note that suggestion-response and requested-location-response callback types are pertinent only for RBM messages sent from the /messages/multiChannel endpoint.

Please visit Webhooks

required: true responses: @@ -7199,7 +7199,7 @@ components: tag: "{\"myTag\": \"myTagValue\"}" updateEndpointBxmlRequestExample: summary: Update Endpoint BXML Request Example - value: + value: endpointDisconnectedEventExample: summary: Endpoint Disconnected Event value: @@ -10641,6 +10641,11 @@ components: maxLength: 2048 title: Post Back Data type: string + pairedMessageId: + description: Corresponding parent message ID (MT). + example: 1752697342534u24xerqdukke523x + nullable: true + type: string type: object rbmLocationResponse: properties: @@ -10668,7 +10673,7 @@ components: message-failed: "#/components/schemas/statusCallback" message-read: "#/components/schemas/statusCallback" message-received: "#/components/schemas/inboundCallback" - request-location-response: "#/components/schemas/inboundCallback" + requested-location-response: "#/components/schemas/inboundCallback" suggestion-response: "#/components/schemas/inboundCallback" propertyName: type oneOf: @@ -10774,11 +10779,11 @@ components: description: |- The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. + - `requested-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. enum: - message-received - - request-location-response + - requested-location-response - suggestion-response example: message-received type: string diff --git a/bandwidth.yml b/bandwidth.yml index 5e2bc9b3..a380e26d 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -2889,6 +2889,11 @@ components: example: Yes, I would like to proceed postbackData: $ref: '#/components/schemas/rbmActionPostbackData' + pairedMessageId: + type: string + nullable: true + description: Corresponding parent message ID (MT). + example: 1752697342534u24xerqdukke523x rbmLocationResponse: type: object properties: @@ -2925,7 +2930,7 @@ components: message-failed: '#/components/schemas/statusCallback' message-read: '#/components/schemas/statusCallback' message-received: '#/components/schemas/inboundCallback' - request-location-response: '#/components/schemas/inboundCallback' + requested-location-response: '#/components/schemas/inboundCallback' suggestion-response: '#/components/schemas/inboundCallback' statusCallback: type: object @@ -3035,14 +3040,15 @@ components: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - - `request-location-response` indicates a response to a location request - sent by the Bandwidth user's client after receiving an RBM message. + - `requested-location-response` indicates a response to a location + request sent by the Bandwidth user's client after receiving an RBM + message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. enum: - message-received - - request-location-response + - requested-location-response - suggestion-response example: message-received statusCallbackMessage: @@ -9154,7 +9160,7 @@ components: tag: '{"myTag": "myTagValue"}' updateEndpointBxmlRequestExample: summary: Update Endpoint BXML Request Example - value: + value: endpointDisconnectedEventExample: summary: Endpoint Disconnected Event value: @@ -9678,10 +9684,10 @@ components:

The payload type will be one of message-received, suggestion-response, or - location-request-response. + requested-location-response.

Note that suggestion-response and - location-request-response callback types are + requested-location-response callback types are pertinent only for RBM messages sent from the /messages/multiChannel endpoint. diff --git a/docs/InboundCallbackTypeEnum.md b/docs/InboundCallbackTypeEnum.md index d2577d84..9b34f428 100644 --- a/docs/InboundCallbackTypeEnum.md +++ b/docs/InboundCallbackTypeEnum.md @@ -7,7 +7,7 @@ * `MESSAGE_RECEIVED` (value: `"message-received"`) -* `REQUEST_LOCATION_RESPONSE` (value: `"request-location-response"`) +* `REQUESTED_LOCATION_RESPONSE` (value: `"requested-location-response"`) * `SUGGESTION_RESPONSE` (value: `"suggestion-response"`) diff --git a/docs/RbmSuggestionResponse.md b/docs/RbmSuggestionResponse.md index e718ac21..39c8dd4f 100644 --- a/docs/RbmSuggestionResponse.md +++ b/docs/RbmSuggestionResponse.md @@ -9,6 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**text** | **String** | The text associated with the suggestion response. | [optional] | |**postbackData** | **byte[]** | Base64 payload the customer receives when the reply is clicked. | [optional] | +|**pairedMessageId** | **String** | Corresponding parent message ID (MT). | [optional] | diff --git a/src/main/java/com/bandwidth/sdk/JSON.java b/src/main/java/com/bandwidth/sdk/JSON.java index f2a30beb..7f32723a 100644 --- a/src/main/java/com/bandwidth/sdk/JSON.java +++ b/src/main/java/com/bandwidth/sdk/JSON.java @@ -71,7 +71,7 @@ public Class getClassForElement(Json classByDiscriminatorValue.put("message-received", com.bandwidth.sdk.model.InboundCallback.class); classByDiscriminatorValue.put("message-sending", com.bandwidth.sdk.model.StatusCallback.class); classByDiscriminatorValue.put("message-sent", com.bandwidth.sdk.model.StatusCallback.class); - classByDiscriminatorValue.put("request-location-response", com.bandwidth.sdk.model.InboundCallback.class); + classByDiscriminatorValue.put("requested-location-response", com.bandwidth.sdk.model.InboundCallback.class); classByDiscriminatorValue.put("suggestion-response", com.bandwidth.sdk.model.InboundCallback.class); classByDiscriminatorValue.put("callback", com.bandwidth.sdk.model.Callback.class); return getClassByDiscriminator(classByDiscriminatorValue, diff --git a/src/main/java/com/bandwidth/sdk/model/Callback.java b/src/main/java/com/bandwidth/sdk/model/Callback.java index 9db016fd..0b570822 100644 --- a/src/main/java/com/bandwidth/sdk/model/Callback.java +++ b/src/main/java/com/bandwidth/sdk/model/Callback.java @@ -140,7 +140,7 @@ public Callback read(JsonReader in) throws IOException { deserialized = adapterStatusCallback.fromJsonTree(jsonObject); newCallback.setActualInstance(deserialized); return newCallback; - case "request-location-response": + case "requested-location-response": deserialized = adapterInboundCallback.fromJsonTree(jsonObject); newCallback.setActualInstance(deserialized); return newCallback; @@ -149,7 +149,7 @@ public Callback read(JsonReader in) throws IOException { newCallback.setActualInstance(deserialized); return newCallback; default: - log.log(Level.WARNING, String.format(Locale.ROOT, "Failed to lookup discriminator value `%s` for Callback. Possible values: message-delivered message-failed message-read message-received message-sending message-sent request-location-response suggestion-response", jsonObject.get("type").getAsString())); + log.log(Level.WARNING, String.format(Locale.ROOT, "Failed to lookup discriminator value `%s` for Callback. Possible values: message-delivered message-failed message-read message-received message-sending message-sent requested-location-response suggestion-response", jsonObject.get("type").getAsString())); } } diff --git a/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java b/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java index 2c09896b..630bc0ae 100644 --- a/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java @@ -26,14 +26,14 @@ import com.google.gson.stream.JsonWriter; /** - * The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. + * The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `requested-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. */ @JsonAdapter(InboundCallbackTypeEnum.Adapter.class) public enum InboundCallbackTypeEnum { MESSAGE_RECEIVED("message-received"), - REQUEST_LOCATION_RESPONSE("request-location-response"), + REQUESTED_LOCATION_RESPONSE("requested-location-response"), SUGGESTION_RESPONSE("suggestion-response"); diff --git a/src/main/java/com/bandwidth/sdk/model/RbmSuggestionResponse.java b/src/main/java/com/bandwidth/sdk/model/RbmSuggestionResponse.java index 578d5fdb..bdb0af9d 100644 --- a/src/main/java/com/bandwidth/sdk/model/RbmSuggestionResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/RbmSuggestionResponse.java @@ -22,6 +22,7 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -62,6 +63,11 @@ public class RbmSuggestionResponse { @javax.annotation.Nullable private byte[] postbackData; + public static final String SERIALIZED_NAME_PAIRED_MESSAGE_ID = "pairedMessageId"; + @SerializedName(SERIALIZED_NAME_PAIRED_MESSAGE_ID) + @javax.annotation.Nullable + private String pairedMessageId; + public RbmSuggestionResponse() { } @@ -102,6 +108,25 @@ public void setPostbackData(@javax.annotation.Nullable byte[] postbackData) { this.postbackData = postbackData; } + + public RbmSuggestionResponse pairedMessageId(@javax.annotation.Nullable String pairedMessageId) { + this.pairedMessageId = pairedMessageId; + return this; + } + + /** + * Corresponding parent message ID (MT). + * @return pairedMessageId + */ + @javax.annotation.Nullable + public String getPairedMessageId() { + return pairedMessageId; + } + + public void setPairedMessageId(@javax.annotation.Nullable String pairedMessageId) { + this.pairedMessageId = pairedMessageId; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -158,13 +183,25 @@ public boolean equals(Object o) { } RbmSuggestionResponse rbmSuggestionResponse = (RbmSuggestionResponse) o; return Objects.equals(this.text, rbmSuggestionResponse.text) && - Arrays.equals(this.postbackData, rbmSuggestionResponse.postbackData)&& + Arrays.equals(this.postbackData, rbmSuggestionResponse.postbackData) && + Objects.equals(this.pairedMessageId, rbmSuggestionResponse.pairedMessageId)&& Objects.equals(this.additionalProperties, rbmSuggestionResponse.additionalProperties); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(text, Arrays.hashCode(postbackData), additionalProperties); + return Objects.hash(text, Arrays.hashCode(postbackData), pairedMessageId, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override @@ -173,6 +210,7 @@ public String toString() { sb.append("class RbmSuggestionResponse {\n"); sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append(" postbackData: ").append(toIndentedString(postbackData)).append("\n"); + sb.append(" pairedMessageId: ").append(toIndentedString(pairedMessageId)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -195,7 +233,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("text", "postbackData")); + openapiFields = new HashSet(Arrays.asList("text", "postbackData", "pairedMessageId")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -217,6 +255,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("text") != null && !jsonObj.get("text").isJsonNull()) && !jsonObj.get("text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString())); } + if ((jsonObj.get("pairedMessageId") != null && !jsonObj.get("pairedMessageId").isJsonNull()) && !jsonObj.get("pairedMessageId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `pairedMessageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pairedMessageId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 865567060de5d3693d4f5cf3f63002b43164fcd0 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Fri, 19 Jun 2026 14:43:11 -0400 Subject: [PATCH 2/2] unit tests --- .../sdk/unit/models/InboundCallbackTypeEnumTest.java | 2 +- .../sdk/unit/models/RbmSuggestionResponseTest.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/bandwidth/sdk/unit/models/InboundCallbackTypeEnumTest.java b/src/test/java/com/bandwidth/sdk/unit/models/InboundCallbackTypeEnumTest.java index aed50cad..bd5d06a7 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/InboundCallbackTypeEnumTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/InboundCallbackTypeEnumTest.java @@ -30,7 +30,7 @@ public class InboundCallbackTypeEnumTest { @Test public void testInboundCallbackTypeEnum() { assertThat(InboundCallbackTypeEnum.MESSAGE_RECEIVED.toString(), equalTo("message-received")); - assertThat(InboundCallbackTypeEnum.REQUEST_LOCATION_RESPONSE.toString(), equalTo("request-location-response")); + assertThat(InboundCallbackTypeEnum.REQUESTED_LOCATION_RESPONSE.toString(), equalTo("requested-location-response")); assertThat(InboundCallbackTypeEnum.SUGGESTION_RESPONSE.toString(), equalTo("suggestion-response")); } diff --git a/src/test/java/com/bandwidth/sdk/unit/models/RbmSuggestionResponseTest.java b/src/test/java/com/bandwidth/sdk/unit/models/RbmSuggestionResponseTest.java index 39241f8f..6cf4c2b1 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/RbmSuggestionResponseTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/RbmSuggestionResponseTest.java @@ -26,7 +26,8 @@ public class RbmSuggestionResponseTest { private final RbmSuggestionResponse model = new RbmSuggestionResponse() .text("text") - .postbackData(new byte[]{1, 2, 3}); + .postbackData(new byte[]{1, 2, 3}) + .pairedMessageId("pairedMessageId"); /** * Model tests for RbmSuggestionResponse @@ -52,4 +53,12 @@ public void postbackDataTest() { assertThat(model.getPostbackData(), instanceOf(byte[].class)); } + /** + * Test the property 'pairedMessageId' + */ + @Test + public void pairedMessageIdTest() { + assertThat(model.getPairedMessageId(), instanceOf(String.class)); + } + }