Skip to content

Commit 4d7a65d

Browse files
band-swi-release-engineering[bot]DX-Bandwidthckoegel
authored
SWI-7822 Update SDK Based on Recent Spec Changes (#187)
* Generate SDK with OpenAPI Generator Version * unit tests --------- Co-authored-by: DX-Bandwidth <dx@bandwidth.com> Co-authored-by: ckoegel <ckoegel1006@gmail.com>
1 parent e839d47 commit 4d7a65d

File tree

8 files changed

+59
-18
lines changed

8 files changed

+59
-18
lines changed

api/openapi.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8456,6 +8456,13 @@ components:
84568456
example: 4405
84578457
nullable: true
84588458
type: integer
8459+
carrierName:
8460+
description: "The name of the Authorized Message Provider (AMP) that handled\
8461+
\ this message. In the US, this is the carrier that the message was sent\
8462+
\ to."
8463+
example: AT&T
8464+
nullable: true
8465+
type: string
84598466
required:
84608467
- description
84618468
- message
@@ -13173,8 +13180,6 @@ components:
1317313180
- VERIFIED
1317413181
- UNVERIFIED
1317513182
- PENDING
13176-
- PARTIALLY_VERIFIED
13177-
- INVALID_STATUS
1317813183
example: VERIFIED
1317913184
type: string
1318013185
sharedSecretKey:

bandwidth.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2494,6 +2494,14 @@ components:
24942494
description: Optional error code, applicable only when type is `message-failed`.
24952495
nullable: true
24962496
example: 4405
2497+
carrierName:
2498+
type: string
2499+
description: >-
2500+
The name of the Authorized Message Provider (AMP) that handled this
2501+
message. In the US, this is the carrier that the message was sent
2502+
to.
2503+
nullable: true
2504+
example: AT&T
24972505
required:
24982506
- time
24992507
- type
@@ -5849,8 +5857,6 @@ components:
58495857
- VERIFIED
58505858
- UNVERIFIED
58515859
- PENDING
5852-
- PARTIALLY_VERIFIED
5853-
- INVALID_STATUS
58545860
example: VERIFIED
58555861
sharedSecretKey:
58565862
description: >-

docs/MessageCallback.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Message Callback Schema
1414
|**description** | **String** | A detailed description of the event described by the callback. | |
1515
|**message** | [**MessageCallbackMessage**](MessageCallbackMessage.md) | | |
1616
|**errorCode** | **Integer** | Optional error code, applicable only when type is &#x60;message-failed&#x60;. | [optional] |
17+
|**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] |
1718

1819

1920

docs/TfvStatusEnum.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,5 @@
1111

1212
* `PENDING` (value: `"PENDING"`)
1313

14-
* `PARTIALLY_VERIFIED` (value: `"PARTIALLY_VERIFIED"`)
15-
16-
* `INVALID_STATUS` (value: `"INVALID_STATUS"`)
17-
1814

1915

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

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ public class MessageCallback {
8484
@javax.annotation.Nullable
8585
private Integer errorCode;
8686

87+
public static final String SERIALIZED_NAME_CARRIER_NAME = "carrierName";
88+
@SerializedName(SERIALIZED_NAME_CARRIER_NAME)
89+
@javax.annotation.Nullable
90+
private String carrierName;
91+
8792
public MessageCallback() {
8893
}
8994

@@ -200,6 +205,25 @@ public void setErrorCode(@javax.annotation.Nullable Integer errorCode) {
200205
this.errorCode = errorCode;
201206
}
202207

208+
209+
public MessageCallback carrierName(@javax.annotation.Nullable String carrierName) {
210+
this.carrierName = carrierName;
211+
return this;
212+
}
213+
214+
/**
215+
* 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.
216+
* @return carrierName
217+
*/
218+
@javax.annotation.Nullable
219+
public String getCarrierName() {
220+
return carrierName;
221+
}
222+
223+
public void setCarrierName(@javax.annotation.Nullable String carrierName) {
224+
this.carrierName = carrierName;
225+
}
226+
203227
/**
204228
* A container for additional, undeclared properties.
205229
* This is a holder for any undeclared properties as specified with
@@ -260,7 +284,8 @@ public boolean equals(Object o) {
260284
Objects.equals(this.to, messageCallback.to) &&
261285
Objects.equals(this.description, messageCallback.description) &&
262286
Objects.equals(this.message, messageCallback.message) &&
263-
Objects.equals(this.errorCode, messageCallback.errorCode)&&
287+
Objects.equals(this.errorCode, messageCallback.errorCode) &&
288+
Objects.equals(this.carrierName, messageCallback.carrierName)&&
264289
Objects.equals(this.additionalProperties, messageCallback.additionalProperties);
265290
}
266291

@@ -270,7 +295,7 @@ private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b)
270295

271296
@Override
272297
public int hashCode() {
273-
return Objects.hash(time, type, to, description, message, errorCode, additionalProperties);
298+
return Objects.hash(time, type, to, description, message, errorCode, carrierName, additionalProperties);
274299
}
275300

276301
private static <T> int hashCodeNullable(JsonNullable<T> a) {
@@ -290,6 +315,7 @@ public String toString() {
290315
sb.append(" description: ").append(toIndentedString(description)).append("\n");
291316
sb.append(" message: ").append(toIndentedString(message)).append("\n");
292317
sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n");
318+
sb.append(" carrierName: ").append(toIndentedString(carrierName)).append("\n");
293319
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
294320
sb.append("}");
295321
return sb.toString();
@@ -319,6 +345,7 @@ private String toIndentedString(Object o) {
319345
openapiFields.add("description");
320346
openapiFields.add("message");
321347
openapiFields.add("errorCode");
348+
openapiFields.add("carrierName");
322349

323350
// a set of required properties/fields (JSON key names)
324351
openapiRequiredFields = new HashSet<String>();
@@ -359,6 +386,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
359386
}
360387
// validate the required field `message`
361388
MessageCallbackMessage.validateJsonElement(jsonObj.get("message"));
389+
if ((jsonObj.get("carrierName") != null && !jsonObj.get("carrierName").isJsonNull()) && !jsonObj.get("carrierName").isJsonPrimitive()) {
390+
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()));
391+
}
362392
}
363393

364394
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ public enum TfvStatusEnum {
3333

3434
UNVERIFIED("UNVERIFIED"),
3535

36-
PENDING("PENDING"),
37-
38-
PARTIALLY_VERIFIED("PARTIALLY_VERIFIED"),
39-
40-
INVALID_STATUS("INVALID_STATUS");
36+
PENDING("PENDING");
4137

4238
private String value;
4339

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public class MessageCallbackTest {
3232
.to("+1234567890")
3333
.description("description")
3434
.message(new MessageCallbackMessage())
35-
.errorCode(123);
35+
.errorCode(123)
36+
.carrierName("carrierName");
3637

3738
/**
3839
* Model tests for MessageCallback
@@ -90,4 +91,12 @@ public void errorCodeTest() {
9091
assertThat(model.getErrorCode(), instanceOf(Integer.class));
9192
}
9293

94+
/**
95+
* Test the property 'carrierName'
96+
*/
97+
@Test
98+
public void carrierNameTest() {
99+
assertThat(model.getCarrierName(), instanceOf(String.class));
100+
}
101+
93102
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public void testTfvStatusEnum() {
3131
assertThat(TfvStatusEnum.VERIFIED.toString(), equalTo("VERIFIED"));
3232
assertThat(TfvStatusEnum.UNVERIFIED.toString(), equalTo("UNVERIFIED"));
3333
assertThat(TfvStatusEnum.PENDING.toString(), equalTo("PENDING"));
34-
assertThat(TfvStatusEnum.PARTIALLY_VERIFIED.toString(), equalTo("PARTIALLY_VERIFIED"));
35-
assertThat(TfvStatusEnum.INVALID_STATUS.toString(), equalTo("INVALID_STATUS"));
3634
}
3735

3836
}

0 commit comments

Comments
 (0)