diff --git a/api/openapi.yaml b/api/openapi.yaml index 81ea4dab..126f69b7 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -8456,6 +8456,13 @@ components: example: 4405 nullable: true type: integer + carrierName: + description: "The name of the Authorized Message Provider (AMP) that handled\ + \ this message. In the US, this is the carrier that the message was sent\ + \ to." + example: AT&T + nullable: true + type: string required: - description - message @@ -13173,8 +13180,6 @@ components: - VERIFIED - UNVERIFIED - PENDING - - PARTIALLY_VERIFIED - - INVALID_STATUS example: VERIFIED type: string sharedSecretKey: diff --git a/bandwidth.yml b/bandwidth.yml index e41dd6a6..e180a94b 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -2494,6 +2494,14 @@ components: description: Optional error code, applicable only when type is `message-failed`. nullable: true example: 4405 + carrierName: + type: string + description: >- + The name of the Authorized Message Provider (AMP) that handled this + message. In the US, this is the carrier that the message was sent + to. + nullable: true + example: AT&T required: - time - type @@ -5849,8 +5857,6 @@ components: - VERIFIED - UNVERIFIED - PENDING - - PARTIALLY_VERIFIED - - INVALID_STATUS example: VERIFIED sharedSecretKey: description: >- diff --git a/docs/MessageCallback.md b/docs/MessageCallback.md index e9af0c2b..6cb0487b 100644 --- a/docs/MessageCallback.md +++ b/docs/MessageCallback.md @@ -14,6 +14,7 @@ Message Callback Schema |**description** | **String** | A detailed description of the event described by the callback. | | |**message** | [**MessageCallbackMessage**](MessageCallbackMessage.md) | | | |**errorCode** | **Integer** | Optional error code, applicable only when type is `message-failed`. | [optional] | +|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. | [optional] | diff --git a/docs/TfvStatusEnum.md b/docs/TfvStatusEnum.md index 0d0e14e6..121b716f 100644 --- a/docs/TfvStatusEnum.md +++ b/docs/TfvStatusEnum.md @@ -11,9 +11,5 @@ * `PENDING` (value: `"PENDING"`) -* `PARTIALLY_VERIFIED` (value: `"PARTIALLY_VERIFIED"`) - -* `INVALID_STATUS` (value: `"INVALID_STATUS"`) - diff --git a/src/main/java/com/bandwidth/sdk/model/MessageCallback.java b/src/main/java/com/bandwidth/sdk/model/MessageCallback.java index 59430ef5..8d44ecb3 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageCallback.java @@ -84,6 +84,11 @@ public class MessageCallback { @javax.annotation.Nullable private Integer errorCode; + public static final String SERIALIZED_NAME_CARRIER_NAME = "carrierName"; + @SerializedName(SERIALIZED_NAME_CARRIER_NAME) + @javax.annotation.Nullable + private String carrierName; + public MessageCallback() { } @@ -200,6 +205,25 @@ public void setErrorCode(@javax.annotation.Nullable Integer errorCode) { this.errorCode = errorCode; } + + public MessageCallback carrierName(@javax.annotation.Nullable String carrierName) { + this.carrierName = carrierName; + return this; + } + + /** + * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. + * @return carrierName + */ + @javax.annotation.Nullable + public String getCarrierName() { + return carrierName; + } + + public void setCarrierName(@javax.annotation.Nullable String carrierName) { + this.carrierName = carrierName; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -260,7 +284,8 @@ public boolean equals(Object o) { Objects.equals(this.to, messageCallback.to) && Objects.equals(this.description, messageCallback.description) && Objects.equals(this.message, messageCallback.message) && - Objects.equals(this.errorCode, messageCallback.errorCode)&& + Objects.equals(this.errorCode, messageCallback.errorCode) && + Objects.equals(this.carrierName, messageCallback.carrierName)&& Objects.equals(this.additionalProperties, messageCallback.additionalProperties); } @@ -270,7 +295,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(time, type, to, description, message, errorCode, additionalProperties); + return Objects.hash(time, type, to, description, message, errorCode, carrierName, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -290,6 +315,7 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" carrierName: ").append(toIndentedString(carrierName)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -319,6 +345,7 @@ private String toIndentedString(Object o) { openapiFields.add("description"); openapiFields.add("message"); openapiFields.add("errorCode"); + openapiFields.add("carrierName"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -359,6 +386,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `message` MessageCallbackMessage.validateJsonElement(jsonObj.get("message")); + if ((jsonObj.get("carrierName") != null && !jsonObj.get("carrierName").isJsonNull()) && !jsonObj.get("carrierName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `carrierName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carrierName").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/bandwidth/sdk/model/TfvStatusEnum.java b/src/main/java/com/bandwidth/sdk/model/TfvStatusEnum.java index fc021fb4..d17c8b50 100644 --- a/src/main/java/com/bandwidth/sdk/model/TfvStatusEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/TfvStatusEnum.java @@ -33,11 +33,7 @@ public enum TfvStatusEnum { UNVERIFIED("UNVERIFIED"), - PENDING("PENDING"), - - PARTIALLY_VERIFIED("PARTIALLY_VERIFIED"), - - INVALID_STATUS("INVALID_STATUS"); + PENDING("PENDING"); private String value; diff --git a/src/test/java/com/bandwidth/sdk/unit/models/MessageCallbackTest.java b/src/test/java/com/bandwidth/sdk/unit/models/MessageCallbackTest.java index 6caffe24..6f913dec 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/MessageCallbackTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/MessageCallbackTest.java @@ -32,7 +32,8 @@ public class MessageCallbackTest { .to("+1234567890") .description("description") .message(new MessageCallbackMessage()) - .errorCode(123); + .errorCode(123) + .carrierName("carrierName"); /** * Model tests for MessageCallback @@ -90,4 +91,12 @@ public void errorCodeTest() { assertThat(model.getErrorCode(), instanceOf(Integer.class)); } + /** + * Test the property 'carrierName' + */ + @Test + public void carrierNameTest() { + assertThat(model.getCarrierName(), instanceOf(String.class)); + } + } diff --git a/src/test/java/com/bandwidth/sdk/unit/models/TfvStatusEnumTest.java b/src/test/java/com/bandwidth/sdk/unit/models/TfvStatusEnumTest.java index ada6887c..d20c71a2 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/TfvStatusEnumTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/TfvStatusEnumTest.java @@ -31,8 +31,6 @@ public void testTfvStatusEnum() { assertThat(TfvStatusEnum.VERIFIED.toString(), equalTo("VERIFIED")); assertThat(TfvStatusEnum.UNVERIFIED.toString(), equalTo("UNVERIFIED")); assertThat(TfvStatusEnum.PENDING.toString(), equalTo("PENDING")); - assertThat(TfvStatusEnum.PARTIALLY_VERIFIED.toString(), equalTo("PARTIALLY_VERIFIED")); - assertThat(TfvStatusEnum.INVALID_STATUS.toString(), equalTo("INVALID_STATUS")); } }