Skip to content

Commit 7832605

Browse files
authored
SWI-1630 Define carrierName as Nullable (#56)
1 parent 8e7c90a commit 7832605

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/models/bandwidthMessageItem.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
55
*/
66

7-
import { number, object, optional, Schema, string } from '../schema';
7+
import { number, object, optional, Schema, string, nullable } from '../schema';
88

99
export interface BandwidthMessageItem {
1010
/** The message id */
@@ -28,7 +28,7 @@ export interface BandwidthMessageItem {
2828
/** The ISO 8601 datetime of the message */
2929
receiveTime?: string;
3030
/** The name of the carrier. Not currently supported for MMS, coming soon */
31-
carrierName?: string;
31+
carrierName?: string | null;
3232
}
3333

3434
export const bandwidthMessageItemSchema: Schema<BandwidthMessageItem> = object({
@@ -42,5 +42,5 @@ export const bandwidthMessageItemSchema: Schema<BandwidthMessageItem> = object({
4242
segmentCount: ['segmentCount', optional(number())],
4343
errorCode: ['errorCode', optional(number())],
4444
receiveTime: ['receiveTime', optional(string())],
45-
carrierName: ['carrierName', optional(string())],
45+
carrierName: ['carrierName', nullable(optional(string()))],
4646
});

tests/messaging.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ describe('messaging', () => {
5656
expect(createMessageResponse.result.from).toEqual(fromPhoneNumber);
5757
expect(createMessageResponse.result.text).toEqual(text);
5858
});
59+
60+
it('should get messages', async () => {
61+
const accountId = process.env.BW_ACCOUNT_ID;
62+
const phoneNumber = process.env.BW_NUMBER;
63+
64+
const listMessagesResponse = await controller.getMessages(accountId, undefined, phoneNumber);
65+
expect(listMessagesResponse.result.messages[0].messageId.length).toEqual(29);
66+
expect(listMessagesResponse.result.messages[0].accountId).toEqual(accountId);
67+
expect(listMessagesResponse.result.messages[0].sourceTn).toEqual(phoneNumber);
68+
});
5969

6070

6171
it('should throw an error on an invalid to number', async () => {

0 commit comments

Comments
 (0)