Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6480,8 +6480,8 @@ components:
<p>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.
<p>The payload type will be one of <code>message-received</code>, <code>suggestion-response</code>, or <code>location-request-response</code>.
<p>Note that <code>suggestion-response</code> and <code>location-request-response</code> callback types are pertinent only for RBM messages sent from the <code>/messages/multiChannel</code> endpoint.
<p>The payload type will be one of <code>message-received</code>, <code>suggestion-response</code>, or <code>requested-location-response</code>.
<p>Note that <code>suggestion-response</code> and <code>requested-location-response</code> callback types are pertinent only for RBM messages sent from the <code>/messages/multiChannel</code> endpoint.
</p><p>Please visit <a href='/docs/messaging/webhooks/'>Webhooks</a></p>
required: true
responses:
Expand Down Expand Up @@ -7199,7 +7199,7 @@ components:
tag: "{\"myTag\": \"myTagValue\"}"
updateEndpointBxmlRequestExample:
summary: Update Endpoint BXML Request Example
value: <Bxml><StartRecording /></Bxml>
value: <Response><StartRecording /></Response>
endpointDisconnectedEventExample:
summary: Endpoint Disconnected Event
value:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
20 changes: 13 additions & 7 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -9154,7 +9160,7 @@ components:
tag: '{"myTag": "myTagValue"}'
updateEndpointBxmlRequestExample:
summary: Update Endpoint BXML Request Example
value: <Bxml><StartRecording /></Bxml>
value: <Response><StartRecording /></Response>
endpointDisconnectedEventExample:
summary: Endpoint Disconnected Event
value:
Expand Down Expand Up @@ -9678,10 +9684,10 @@ components:

<p>The payload type will be one of <code>message-received</code>,
<code>suggestion-response</code>, or
<code>location-request-response</code>.
<code>requested-location-response</code>.

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

Expand Down
2 changes: 1 addition & 1 deletion docs/InboundCallbackTypeEnum.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`)

Expand Down
1 change: 1 addition & 0 deletions docs/RbmSuggestionResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -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] |



2 changes: 1 addition & 1 deletion src/main/java/com/bandwidth/sdk/JSON.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public Class<? extends com.bandwidth.sdk.model.Callback> 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,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/bandwidth/sdk/model/Callback.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
import com.google.gson.stream.JsonWriter;

/**
* The possible inbound callback types originating from MO messages or multichannel message client responses: - &#x60;message-received&#x60; indicates an MO message from a Bandwidth user&#39;s client to a Bandwidth number. - &#x60;request-location-response&#x60; indicates a response to a location request sent by the Bandwidth user&#39;s client after receiving an RBM message. - &#x60;suggestion-response&#x60; indicates a response to a suggestion sent by the Bandwidth user&#39;s client after receiving an RBM message.
* The possible inbound callback types originating from MO messages or multichannel message client responses: - &#x60;message-received&#x60; indicates an MO message from a Bandwidth user&#39;s client to a Bandwidth number. - &#x60;requested-location-response&#x60; indicates a response to a location request sent by the Bandwidth user&#39;s client after receiving an RBM message. - &#x60;suggestion-response&#x60; indicates a response to a suggestion sent by the Bandwidth user&#39;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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> 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 <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}

@Override
Expand All @@ -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();
Expand All @@ -195,7 +233,7 @@ private String toIndentedString(Object o) {

static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>(Arrays.asList("text", "postbackData"));
openapiFields = new HashSet<String>(Arrays.asList("text", "postbackData", "pairedMessageId"));

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>(0);
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));
}

}