diff --git a/api/openapi.yaml b/api/openapi.yaml index cafcd1e3..e2120313 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -14829,11 +14829,38 @@ components: description: Reason code for denial. example: 511 type: integer + denialStatusCodeNullable: + description: Reason code for denial. + example: 511 + nullable: true + type: integer resubmitAllowed: description: Whether a Toll-Free Verification request qualifies for resubmission via PUT. example: true type: boolean + additionalDenialReason: + properties: + statusCode: + description: Reason code for denial. + example: 511 + type: integer + reason: + description: Explanation for why a verification request was declined. + example: Invalid Information - Can't Validate URL - Website is not accessible + / not available + nullable: false + type: string + resubmitAllowed: + description: Whether a Toll-Free Verification request qualifies for resubmission + via PUT. + example: true + type: boolean + required: + - reason + - resubmitAllowed + - statusCode + type: object blocked: description: Whether a Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. @@ -14952,28 +14979,6 @@ components: description: Indicates whether the content is age-gated. example: false type: boolean - additionalDenialReason: - properties: - statusCode: - description: Reason code for denial. - example: 511 - type: integer - reason: - description: Explanation for why a verification request was declined. - example: Invalid Information - Can't Validate URL - Website is not accessible - / not available - nullable: false - type: string - resubmitAllowed: - description: Whether a Toll-Free Verification request qualifies for resubmission - via PUT. - example: true - type: boolean - required: - - reason - - resubmitAllowed - - statusCode - type: object internalTicketNumber: description: Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number - included in all webhook payloads. @@ -15877,12 +15882,22 @@ components: type: object tfvStatus: example: - internalTicketNumber: acde070d-8c4c-4f0d-9d8a-162843c10333 - phoneNumber: "+18005555555" - blocked: true blockedReason: Toll-free number was used to send spam messages resubmitAllowed: true createdDateTime: 2021-06-08T06:45:13Z + declineReasonDescription: Invalid Information - Can't Validate URL - Website + is not accessible / not available + internalTicketNumber: acde070d-8c4c-4f0d-9d8a-162843c10333 + phoneNumber: "+18005555555" + blocked: true + denialStatusCode: 511 + additionalDenialReasons: + - statusCode: 512 + reason: Reason A + resubmitAllowed: true + - statusCode: 513 + reason: Reason B + resubmitAllowed: true modifiedDateTime: 2021-06-08T06:45:13Z submission: additionalInformation: Any additional information @@ -15917,8 +15932,6 @@ components: state: NC url: https://www.example.com/path/to/resource useCaseSummary: Text summarizing the use case for the toll-free number - declineReasonDescription: Invalid Information - Can't Validate URL - Website - is not accessible / not available cvToken: cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw status: VERIFIED properties: @@ -15944,6 +15957,25 @@ components: / not available nullable: false type: string + denialStatusCode: + description: Reason code for denial. + example: 511 + nullable: true + type: integer + additionalDenialReasons: + description: An optional list of denial reasons in addition to declineReasonDescription + when multiple reasons apply. + example: + - statusCode: 512 + reason: Reason A + resubmitAllowed: true + - statusCode: 513 + reason: Reason B + resubmitAllowed: true + items: + $ref: "#/components/schemas/additionalDenialReason" + nullable: true + type: array resubmitAllowed: description: Whether a Toll-Free Verification request qualifies for resubmission via PUT. diff --git a/bandwidth.yml b/bandwidth.yml index 5927a5e8..5e2bc9b3 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -6034,12 +6034,30 @@ components: description: Reason code for denial. type: integer example: 511 + denialStatusCodeNullable: + description: Reason code for denial. + nullable: true + type: integer + example: 511 resubmitAllowed: description: >- Whether a Toll-Free Verification request qualifies for resubmission via PUT. example: true type: boolean + additionalDenialReason: + type: object + properties: + statusCode: + $ref: '#/components/schemas/denialStatusCode' + reason: + $ref: '#/components/schemas/declineReasonDescription' + resubmitAllowed: + $ref: '#/components/schemas/resubmitAllowed' + required: + - statusCode + - reason + - resubmitAllowed blocked: description: >- Whether a Toll-Free Verification is blocked. This attribute will only be @@ -6194,19 +6212,6 @@ components: type: boolean description: Indicates whether the content is age-gated. example: false - additionalDenialReason: - properties: - statusCode: - $ref: '#/components/schemas/denialStatusCode' - reason: - $ref: '#/components/schemas/declineReasonDescription' - resubmitAllowed: - $ref: '#/components/schemas/resubmitAllowed' - required: - - statusCode - - reason - - resubmitAllowed - type: object internalTicketNumber: type: string description: >- @@ -6402,6 +6407,7 @@ components: description: >- An optional list of denial reasons in addition to declineReasonDescription when multiple reasons apply. + type: array items: $ref: '#/components/schemas/additionalDenialReason' example: @@ -6411,7 +6417,6 @@ components: - statusCode: 513 reason: Reason B resubmitAllowed: true - type: array declineReasonDescription: $ref: '#/components/schemas/declineReasonDescription' denialStatusCode: @@ -6779,6 +6784,23 @@ components: $ref: '#/components/schemas/internalTicketNumber' declineReasonDescription: $ref: '#/components/schemas/declineReasonDescription' + denialStatusCode: + $ref: '#/components/schemas/denialStatusCodeNullable' + additionalDenialReasons: + description: >- + An optional list of denial reasons in addition to + declineReasonDescription when multiple reasons apply. + nullable: true + type: array + items: + $ref: '#/components/schemas/additionalDenialReason' + example: + - statusCode: 512 + reason: Reason A + resubmitAllowed: true + - statusCode: 513 + reason: Reason B + resubmitAllowed: true resubmitAllowed: $ref: '#/components/schemas/resubmitAllowed' createdDateTime: diff --git a/docs/TfvStatus.md b/docs/TfvStatus.md index 61e9c297..b0ca1db7 100644 --- a/docs/TfvStatus.md +++ b/docs/TfvStatus.md @@ -11,6 +11,8 @@ |**status** | **TfvStatusEnum** | | [optional] | |**internalTicketNumber** | **String** | Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number - included in all webhook payloads. | [optional] | |**declineReasonDescription** | **String** | Explanation for why a verification request was declined. | [optional] | +|**denialStatusCode** | **Integer** | Reason code for denial. | [optional] | +|**additionalDenialReasons** | [**List<AdditionalDenialReason>**](AdditionalDenialReason.md) | An optional list of denial reasons in addition to declineReasonDescription when multiple reasons apply. | [optional] | |**resubmitAllowed** | **Boolean** | Whether a Toll-Free Verification request qualifies for resubmission via PUT. | [optional] | |**createdDateTime** | **OffsetDateTime** | Date and time the verification request was created. | [optional] | |**modifiedDateTime** | **OffsetDateTime** | Date and time the verification request was last modified. | [optional] | diff --git a/src/main/java/com/bandwidth/sdk/model/TfvStatus.java b/src/main/java/com/bandwidth/sdk/model/TfvStatus.java index f26df3dc..fe3861dc 100644 --- a/src/main/java/com/bandwidth/sdk/model/TfvStatus.java +++ b/src/main/java/com/bandwidth/sdk/model/TfvStatus.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Locale; +import com.bandwidth.sdk.model.AdditionalDenialReason; import com.bandwidth.sdk.model.TfvStatusEnum; import com.bandwidth.sdk.model.TfvSubmissionInfo; import com.google.gson.TypeAdapter; @@ -24,7 +25,9 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.time.OffsetDateTime; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; @@ -76,6 +79,16 @@ public class TfvStatus { @javax.annotation.Nullable private String declineReasonDescription; + public static final String SERIALIZED_NAME_DENIAL_STATUS_CODE = "denialStatusCode"; + @SerializedName(SERIALIZED_NAME_DENIAL_STATUS_CODE) + @javax.annotation.Nullable + private Integer denialStatusCode; + + public static final String SERIALIZED_NAME_ADDITIONAL_DENIAL_REASONS = "additionalDenialReasons"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_DENIAL_REASONS) + @javax.annotation.Nullable + private List additionalDenialReasons; + public static final String SERIALIZED_NAME_RESUBMIT_ALLOWED = "resubmitAllowed"; @SerializedName(SERIALIZED_NAME_RESUBMIT_ALLOWED) @javax.annotation.Nullable @@ -190,6 +203,52 @@ public void setDeclineReasonDescription(@javax.annotation.Nullable String declin } + public TfvStatus denialStatusCode(@javax.annotation.Nullable Integer denialStatusCode) { + this.denialStatusCode = denialStatusCode; + return this; + } + + /** + * Reason code for denial. + * @return denialStatusCode + */ + @javax.annotation.Nullable + public Integer getDenialStatusCode() { + return denialStatusCode; + } + + public void setDenialStatusCode(@javax.annotation.Nullable Integer denialStatusCode) { + this.denialStatusCode = denialStatusCode; + } + + + public TfvStatus additionalDenialReasons(@javax.annotation.Nullable List additionalDenialReasons) { + this.additionalDenialReasons = additionalDenialReasons; + return this; + } + + public TfvStatus addAdditionalDenialReasonsItem(AdditionalDenialReason additionalDenialReasonsItem) { + if (this.additionalDenialReasons == null) { + this.additionalDenialReasons = new ArrayList<>(); + } + this.additionalDenialReasons.add(additionalDenialReasonsItem); + return this; + } + + /** + * An optional list of denial reasons in addition to declineReasonDescription when multiple reasons apply. + * @return additionalDenialReasons + */ + @javax.annotation.Nullable + public List getAdditionalDenialReasons() { + return additionalDenialReasons; + } + + public void setAdditionalDenialReasons(@javax.annotation.Nullable List additionalDenialReasons) { + this.additionalDenialReasons = additionalDenialReasons; + } + + public TfvStatus resubmitAllowed(@javax.annotation.Nullable Boolean resubmitAllowed) { this.resubmitAllowed = resubmitAllowed; return this; @@ -381,6 +440,8 @@ public boolean equals(Object o) { Objects.equals(this.status, tfvStatus.status) && Objects.equals(this.internalTicketNumber, tfvStatus.internalTicketNumber) && Objects.equals(this.declineReasonDescription, tfvStatus.declineReasonDescription) && + Objects.equals(this.denialStatusCode, tfvStatus.denialStatusCode) && + Objects.equals(this.additionalDenialReasons, tfvStatus.additionalDenialReasons) && Objects.equals(this.resubmitAllowed, tfvStatus.resubmitAllowed) && Objects.equals(this.createdDateTime, tfvStatus.createdDateTime) && Objects.equals(this.modifiedDateTime, tfvStatus.modifiedDateTime) && @@ -397,7 +458,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(phoneNumber, status, internalTicketNumber, declineReasonDescription, resubmitAllowed, createdDateTime, modifiedDateTime, submission, blocked, blockedReason, cvToken, additionalProperties); + return Objects.hash(phoneNumber, status, internalTicketNumber, declineReasonDescription, denialStatusCode, additionalDenialReasons, resubmitAllowed, createdDateTime, modifiedDateTime, submission, blocked, blockedReason, cvToken, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -415,6 +476,8 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" internalTicketNumber: ").append(toIndentedString(internalTicketNumber)).append("\n"); sb.append(" declineReasonDescription: ").append(toIndentedString(declineReasonDescription)).append("\n"); + sb.append(" denialStatusCode: ").append(toIndentedString(denialStatusCode)).append("\n"); + sb.append(" additionalDenialReasons: ").append(toIndentedString(additionalDenialReasons)).append("\n"); sb.append(" resubmitAllowed: ").append(toIndentedString(resubmitAllowed)).append("\n"); sb.append(" createdDateTime: ").append(toIndentedString(createdDateTime)).append("\n"); sb.append(" modifiedDateTime: ").append(toIndentedString(modifiedDateTime)).append("\n"); @@ -444,7 +507,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("phoneNumber", "status", "internalTicketNumber", "declineReasonDescription", "resubmitAllowed", "createdDateTime", "modifiedDateTime", "submission", "blocked", "blockedReason", "cvToken")); + openapiFields = new HashSet(Arrays.asList("phoneNumber", "status", "internalTicketNumber", "declineReasonDescription", "denialStatusCode", "additionalDenialReasons", "resubmitAllowed", "createdDateTime", "modifiedDateTime", "submission", "blocked", "blockedReason", "cvToken")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -476,6 +539,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("declineReasonDescription") != null && !jsonObj.get("declineReasonDescription").isJsonNull()) && !jsonObj.get("declineReasonDescription").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `declineReasonDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("declineReasonDescription").toString())); } + if (jsonObj.get("additionalDenialReasons") != null && !jsonObj.get("additionalDenialReasons").isJsonNull()) { + JsonArray jsonArrayadditionalDenialReasons = jsonObj.getAsJsonArray("additionalDenialReasons"); + if (jsonArrayadditionalDenialReasons != null) { + // ensure the json data is an array + if (!jsonObj.get("additionalDenialReasons").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `additionalDenialReasons` to be an array in the JSON string but got `%s`", jsonObj.get("additionalDenialReasons").toString())); + } + + // validate the optional field `additionalDenialReasons` (array) + for (int i = 0; i < jsonArrayadditionalDenialReasons.size(); i++) { + AdditionalDenialReason.validateJsonElement(jsonArrayadditionalDenialReasons.get(i)); + }; + } + } // validate the optional field `submission` if (jsonObj.get("submission") != null && !jsonObj.get("submission").isJsonNull()) { TfvSubmissionInfo.validateJsonElement(jsonObj.get("submission"));