diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ab8d54cd..01b9a974 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -99,6 +99,7 @@ docs/OptInWorkflow.md docs/PageInfo.md docs/PhoneNumberLookupApi.md docs/PriorityEnum.md +docs/ProductTypeEnum.md docs/RbmActionBase.md docs/RbmActionDial.md docs/RbmActionOpenUrl.md @@ -292,6 +293,7 @@ src/main/java/com/bandwidth/sdk/model/MultiChannelMessageResponseDataChannelList src/main/java/com/bandwidth/sdk/model/OptInWorkflow.java src/main/java/com/bandwidth/sdk/model/PageInfo.java src/main/java/com/bandwidth/sdk/model/PriorityEnum.java +src/main/java/com/bandwidth/sdk/model/ProductTypeEnum.java src/main/java/com/bandwidth/sdk/model/RbmActionBase.java src/main/java/com/bandwidth/sdk/model/RbmActionDial.java src/main/java/com/bandwidth/sdk/model/RbmActionOpenUrl.java diff --git a/README.md b/README.md index 826d40b1..125327d7 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,7 @@ Class | Method | HTTP request | Description - [OptInWorkflow](docs/OptInWorkflow.md) - [PageInfo](docs/PageInfo.md) - [PriorityEnum](docs/PriorityEnum.md) + - [ProductTypeEnum](docs/ProductTypeEnum.md) - [RbmActionBase](docs/RbmActionBase.md) - [RbmActionDial](docs/RbmActionDial.md) - [RbmActionOpenUrl](docs/RbmActionOpenUrl.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 7b15df9f..56a7dab2 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -521,6 +521,98 @@ paths: schema: type: string style: form + - description: The minimum Bandwidth latency of the message in seconds. Only + available for accounts with the Advanced Quality Metrics feature enabled. + example: 5 + explode: true + in: query + name: fromBwLatency + required: false + schema: + type: integer + style: form + - description: A boolean value indicating whether the message is queued in the + Bandwidth network. + example: true + explode: true + in: query + name: bwQueued + required: false + schema: + type: boolean + style: form + - description: Messaging product associated with the message. + example: P2P + explode: true + in: query + name: product + required: false + schema: + $ref: '#/components/schemas/productTypeEnum' + style: form + - description: Location Id associated with the message. + example: 123ABC + explode: true + in: query + name: location + required: false + schema: + type: string + style: form + - description: Calling number country in A3 format. + example: USA + explode: true + in: query + name: callingNumberCountryA3 + required: false + schema: + type: string + style: form + - description: Called number country in A3 format. + example: USA + explode: true + in: query + name: calledNumberCountryA3 + required: false + schema: + type: string + style: form + - description: Segment count (start range). + example: 1 + explode: true + in: query + name: fromSegmentCount + required: false + schema: + type: integer + style: form + - description: Segment count (end range). + example: 3 + explode: true + in: query + name: toSegmentCount + required: false + schema: + type: integer + style: form + - description: Message size (start range). + example: 100 + explode: true + in: query + name: fromMessageSize + required: false + schema: + type: integer + style: form + - description: Message size (end range). + example: 120 + explode: true + in: query + name: toMessageSize + required: false + schema: + type: integer + style: form - description: The field and direction to sort by combined with a colon. Direction is either asc or desc. example: sourceTn:desc @@ -6359,6 +6451,108 @@ components: schema: type: string style: form + fromBwLatency: + description: The minimum Bandwidth latency of the message in seconds. Only available + for accounts with the Advanced Quality Metrics feature enabled. + example: 5 + explode: true + in: query + name: fromBwLatency + required: false + schema: + type: integer + style: form + bwQueued: + description: A boolean value indicating whether the message is queued in the + Bandwidth network. + example: true + explode: true + in: query + name: bwQueued + required: false + schema: + type: boolean + style: form + product: + description: Messaging product associated with the message. + example: P2P + explode: true + in: query + name: product + required: false + schema: + $ref: '#/components/schemas/productTypeEnum' + style: form + location: + description: Location Id associated with the message. + example: 123ABC + explode: true + in: query + name: location + required: false + schema: + type: string + style: form + callingNumberCountryA3: + description: Calling number country in A3 format. + example: USA + explode: true + in: query + name: callingNumberCountryA3 + required: false + schema: + type: string + style: form + calledNumberCountryA3: + description: Called number country in A3 format. + example: USA + explode: true + in: query + name: calledNumberCountryA3 + required: false + schema: + type: string + style: form + fromSegmentCount: + description: Segment count (start range). + example: 1 + explode: true + in: query + name: fromSegmentCount + required: false + schema: + type: integer + style: form + toSegmentCount: + description: Segment count (end range). + example: 3 + explode: true + in: query + name: toSegmentCount + required: false + schema: + type: integer + style: form + fromMessageSize: + description: Message size (start range). + example: 100 + explode: true + in: query + name: fromMessageSize + required: false + schema: + type: integer + style: form + toMessageSize: + description: Message size (end range). + example: 120 + explode: true + in: query + name: toMessageSize + required: false + schema: + type: integer + style: form sort: description: The field and direction to sort by combined with a colon. Direction is either asc or desc. @@ -7708,8 +7902,23 @@ components: enum: - sms - mms + - rcs example: sms type: string + productTypeEnum: + description: The type of product associated with the message. + enum: + - LOCAL_A2P + - P2P + - SHORT_CODE_REACH + - TOLL_FREE + - HOSTED_SHORT_CODE + - ALPHA_NUMERIC + - RBM_MEDIA + - RBM_RICH + - RBM_CONVERSATIONAL + example: P2P + type: string fieldError: example: fieldName: from @@ -7734,11 +7943,14 @@ components: nextPageToken: GL83PD3C prevPage: https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902 messages: - - sourceTn: "+15554443333" + - callingNumberCountryA3: USA + product: P2P + sourceTn: "+15554443333" messageLength: 18 campaignId: CJEUMDK messageId: 1589228074636lm4k2je7j7jklbn2 errorCode: 9902 + calledNumberCountryA3: USA destinationTn: "+15554442222" segmentCount: 1 messageStatus: RECEIVED @@ -7749,13 +7961,18 @@ components: carrierName: other recipientCount: 1 campaignClass: T + bwLatency: 20 attachmentCount: 1 + location: 123ID messageSize: 27 - - sourceTn: "+15554443333" + - callingNumberCountryA3: USA + product: P2P + sourceTn: "+15554443333" messageLength: 18 campaignId: CJEUMDK messageId: 1589228074636lm4k2je7j7jklbn2 errorCode: 9902 + calledNumberCountryA3: USA destinationTn: "+15554442222" segmentCount: 1 messageStatus: RECEIVED @@ -7766,7 +7983,9 @@ components: carrierName: other recipientCount: 1 campaignClass: T + bwLatency: 20 attachmentCount: 1 + location: 123ID messageSize: 27 totalCount: 100 properties: @@ -7785,11 +8004,14 @@ components: type: object listMessageItem: example: + callingNumberCountryA3: USA + product: P2P sourceTn: "+15554443333" messageLength: 18 campaignId: CJEUMDK messageId: 1589228074636lm4k2je7j7jklbn2 errorCode: 9902 + calledNumberCountryA3: USA destinationTn: "+15554442222" segmentCount: 1 messageStatus: RECEIVED @@ -7800,7 +8022,9 @@ components: carrierName: other recipientCount: 1 campaignClass: T + bwLatency: 20 attachmentCount: 1 + location: 123ID messageSize: 27 properties: messageId: @@ -7874,6 +8098,32 @@ components: example: CJEUMDK nullable: true type: string + bwLatency: + description: The Bandwidth latency of the message in seconds. Only available + for accounts with the Advanced Quality Metrics feature enabled. + example: 20 + nullable: true + type: integer + callingNumberCountryA3: + description: The A3 country code of the calling number. + example: USA + nullable: true + type: string + calledNumberCountryA3: + description: The A3 country code of the called number. + example: USA + nullable: true + type: string + product: + description: The messaging product associated with the message. + example: P2P + nullable: true + type: string + location: + description: The location ID associated with this message. + example: 123ID + nullable: true + type: string title: listMessageItem type: object pageInfo: diff --git a/bandwidth.yml b/bandwidth.yml index 4b3681cb..65afd419 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -179,6 +179,16 @@ paths: - $ref: '#/components/parameters/fromDateTime' - $ref: '#/components/parameters/toDateTime' - $ref: '#/components/parameters/campaignId' + - $ref: '#/components/parameters/fromBwLatency' + - $ref: '#/components/parameters/bwQueued' + - $ref: '#/components/parameters/product' + - $ref: '#/components/parameters/location' + - $ref: '#/components/parameters/callingNumberCountryA3' + - $ref: '#/components/parameters/calledNumberCountryA3' + - $ref: '#/components/parameters/fromSegmentCount' + - $ref: '#/components/parameters/toSegmentCount' + - $ref: '#/components/parameters/fromMessageSize' + - $ref: '#/components/parameters/toMessageSize' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/pageToken' - $ref: '#/components/parameters/limit' @@ -1716,7 +1726,22 @@ components: enum: - sms - mms + - rcs example: sms + productTypeEnum: + type: string + description: The type of product associated with the message. + enum: + - LOCAL_A2P + - P2P + - SHORT_CODE_REACH + - TOLL_FREE + - HOSTED_SHORT_CODE + - ALPHA_NUMERIC + - RBM_MEDIA + - RBM_RICH + - RBM_CONVERSATIONAL + example: P2P fieldError: type: object properties: @@ -1819,6 +1844,33 @@ components: description: The campaign ID of the message if it has one. nullable: true example: CJEUMDK + bwLatency: + type: integer + description: >- + The Bandwidth latency of the message in seconds. Only available for + accounts with the Advanced Quality Metrics feature enabled. + nullable: true + example: 20 + callingNumberCountryA3: + type: string + description: The A3 country code of the calling number. + nullable: true + example: USA + calledNumberCountryA3: + type: string + description: The A3 country code of the called number. + nullable: true + example: USA + product: + type: string + description: The messaging product associated with the message. + nullable: true + example: P2P + location: + type: string + description: The location ID associated with this message. + nullable: true + example: 123ID pageInfo: title: PageInfo type: object @@ -6940,6 +6992,90 @@ components: example: CJEUMDK schema: type: string + fromBwLatency: + in: query + name: fromBwLatency + required: false + description: >- + The minimum Bandwidth latency of the message in seconds. Only available + for accounts with the Advanced Quality Metrics feature enabled. + example: 5 + schema: + type: integer + bwQueued: + in: query + name: bwQueued + required: false + description: >- + A boolean value indicating whether the message is queued in the + Bandwidth network. + example: true + schema: + type: boolean + product: + in: query + name: product + required: false + description: Messaging product associated with the message. + example: P2P + schema: + $ref: '#/components/schemas/productTypeEnum' + location: + in: query + name: location + required: false + description: Location Id associated with the message. + example: 123ABC + schema: + type: string + callingNumberCountryA3: + in: query + name: callingNumberCountryA3 + required: false + description: Calling number country in A3 format. + example: USA + schema: + type: string + calledNumberCountryA3: + in: query + name: calledNumberCountryA3 + required: false + description: Called number country in A3 format. + example: USA + schema: + type: string + fromSegmentCount: + in: query + name: fromSegmentCount + required: false + description: Segment count (start range). + example: 1 + schema: + type: integer + toSegmentCount: + in: query + name: toSegmentCount + required: false + description: Segment count (end range). + example: 3 + schema: + type: integer + fromMessageSize: + in: query + name: fromMessageSize + required: false + description: Message size (start range). + example: 100 + schema: + type: integer + toMessageSize: + in: query + name: toMessageSize + required: false + description: Message size (end range). + example: 120 + schema: + type: integer sort: in: query name: sort diff --git a/docs/ListMessageItem.md b/docs/ListMessageItem.md index 96b870fe..b0514701 100644 --- a/docs/ListMessageItem.md +++ b/docs/ListMessageItem.md @@ -24,6 +24,11 @@ |**recipientCount** | **Integer** | The number of recipients the message has. | [optional] | |**campaignClass** | **String** | The campaign class of the message if it has one. | [optional] | |**campaignId** | **String** | The campaign ID of the message if it has one. | [optional] | +|**bwLatency** | **Integer** | The Bandwidth latency of the message in seconds. Only available for accounts with the Advanced Quality Metrics feature enabled. | [optional] | +|**callingNumberCountryA3** | **String** | The A3 country code of the calling number. | [optional] | +|**calledNumberCountryA3** | **String** | The A3 country code of the called number. | [optional] | +|**product** | **String** | The messaging product associated with the message. | [optional] | +|**location** | **String** | The location ID associated with this message. | [optional] | diff --git a/docs/MessageTypeEnum.md b/docs/MessageTypeEnum.md index 50a0a4ca..a45b679f 100644 --- a/docs/MessageTypeEnum.md +++ b/docs/MessageTypeEnum.md @@ -9,5 +9,7 @@ * `MMS` (value: `"mms"`) +* `RCS` (value: `"rcs"`) + diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md index 1eb88215..e06d9223 100644 --- a/docs/MessagesApi.md +++ b/docs/MessagesApi.md @@ -89,7 +89,7 @@ public class Example { # **listMessages** -> MessagesList listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort, pageToken, limit, limitTotalCount) +> MessagesList listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, fromBwLatency, bwQueued, product, location, callingNumberCountryA3, calledNumberCountryA3, fromSegmentCount, toSegmentCount, fromMessageSize, toMessageSize, sort, pageToken, limit, limitTotalCount) List Messages @@ -128,12 +128,22 @@ public class Example { String fromDateTime = "2022-09-14T18:20:16.000Z"; // String | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. String toDateTime = "2022-09-14T18:20:16.000Z"; // String | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. String campaignId = "CJEUMDK"; // String | The campaign ID of the message. + Integer fromBwLatency = 5; // Integer | The minimum Bandwidth latency of the message in seconds. Only available for accounts with the Advanced Quality Metrics feature enabled. + Boolean bwQueued = true; // Boolean | A boolean value indicating whether the message is queued in the Bandwidth network. + ProductTypeEnum product = ProductTypeEnum.fromValue("LOCAL_A2P"); // ProductTypeEnum | Messaging product associated with the message. + String location = "123ABC"; // String | Location Id associated with the message. + String callingNumberCountryA3 = "USA"; // String | Calling number country in A3 format. + String calledNumberCountryA3 = "USA"; // String | Called number country in A3 format. + Integer fromSegmentCount = 1; // Integer | Segment count (start range). + Integer toSegmentCount = 3; // Integer | Segment count (end range). + Integer fromMessageSize = 100; // Integer | Message size (start range). + Integer toMessageSize = 120; // Integer | Message size (end range). String sort = "sourceTn:desc"; // String | The field and direction to sort by combined with a colon. Direction is either asc or desc. String pageToken = "gdEewhcJLQRB5"; // String | A base64 encoded value used for pagination of results. Integer limit = 50; // Integer | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. Boolean limitTotalCount = true; // Boolean | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. try { - MessagesList result = apiInstance.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort, pageToken, limit, limitTotalCount); + MessagesList result = apiInstance.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, fromBwLatency, bwQueued, product, location, callingNumberCountryA3, calledNumberCountryA3, fromSegmentCount, toSegmentCount, fromMessageSize, toMessageSize, sort, pageToken, limit, limitTotalCount); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MessagesApi#listMessages"); @@ -157,11 +167,21 @@ public class Example { | **messageStatus** | [**MessageStatusEnum**](.md)| The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] [enum: RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED, ACCEPTED, UNDELIVERED] | | **messageDirection** | [**ListMessageDirectionEnum**](.md)| The direction of the message. One of INBOUND OUTBOUND. | [optional] [enum: INBOUND, OUTBOUND] | | **carrierName** | **String**| The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] | -| **messageType** | [**MessageTypeEnum**](.md)| The type of message. Either sms or mms. | [optional] [enum: sms, mms] | +| **messageType** | [**MessageTypeEnum**](.md)| The type of message. Either sms or mms. | [optional] [enum: sms, mms, rcs] | | **errorCode** | **Integer**| The error code of the message. | [optional] | | **fromDateTime** | **String**| The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | | **toDateTime** | **String**| The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | | **campaignId** | **String**| The campaign ID of the message. | [optional] | +| **fromBwLatency** | **Integer**| The minimum Bandwidth latency of the message in seconds. Only available for accounts with the Advanced Quality Metrics feature enabled. | [optional] | +| **bwQueued** | **Boolean**| A boolean value indicating whether the message is queued in the Bandwidth network. | [optional] | +| **product** | [**ProductTypeEnum**](.md)| Messaging product associated with the message. | [optional] [enum: LOCAL_A2P, P2P, SHORT_CODE_REACH, TOLL_FREE, HOSTED_SHORT_CODE, ALPHA_NUMERIC, RBM_MEDIA, RBM_RICH, RBM_CONVERSATIONAL] | +| **location** | **String**| Location Id associated with the message. | [optional] | +| **callingNumberCountryA3** | **String**| Calling number country in A3 format. | [optional] | +| **calledNumberCountryA3** | **String**| Called number country in A3 format. | [optional] | +| **fromSegmentCount** | **Integer**| Segment count (start range). | [optional] | +| **toSegmentCount** | **Integer**| Segment count (end range). | [optional] | +| **fromMessageSize** | **Integer**| Message size (start range). | [optional] | +| **toMessageSize** | **Integer**| Message size (end range). | [optional] | | **sort** | **String**| The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional] | | **pageToken** | **String**| A base64 encoded value used for pagination of results. | [optional] | | **limit** | **Integer**| The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] | diff --git a/docs/ProductTypeEnum.md b/docs/ProductTypeEnum.md new file mode 100644 index 00000000..a04afbcb --- /dev/null +++ b/docs/ProductTypeEnum.md @@ -0,0 +1,27 @@ + + +# ProductTypeEnum + +## Enum + + +* `LOCAL_A2_P` (value: `"LOCAL_A2P"`) + +* `P2_P` (value: `"P2P"`) + +* `SHORT_CODE_REACH` (value: `"SHORT_CODE_REACH"`) + +* `TOLL_FREE` (value: `"TOLL_FREE"`) + +* `HOSTED_SHORT_CODE` (value: `"HOSTED_SHORT_CODE"`) + +* `ALPHA_NUMERIC` (value: `"ALPHA_NUMERIC"`) + +* `RBM_MEDIA` (value: `"RBM_MEDIA"`) + +* `RBM_RICH` (value: `"RBM_RICH"`) + +* `RBM_CONVERSATIONAL` (value: `"RBM_CONVERSATIONAL"`) + + + diff --git a/src/main/java/com/bandwidth/sdk/api/MessagesApi.java b/src/main/java/com/bandwidth/sdk/api/MessagesApi.java index 3757c77d..3e2bf99b 100644 --- a/src/main/java/com/bandwidth/sdk/api/MessagesApi.java +++ b/src/main/java/com/bandwidth/sdk/api/MessagesApi.java @@ -35,6 +35,7 @@ import com.bandwidth.sdk.model.MessageTypeEnum; import com.bandwidth.sdk.model.MessagesList; import com.bandwidth.sdk.model.MessagingRequestError; +import com.bandwidth.sdk.model.ProductTypeEnum; import java.lang.reflect.Type; import java.util.ArrayList; @@ -266,6 +267,16 @@ public okhttp3.Call createMessageAsync(String accountId, MessageRequest messageR * @param fromDateTime The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) * @param toDateTime The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) * @param campaignId The campaign ID of the message. (optional) + * @param fromBwLatency The minimum Bandwidth latency of the message in seconds. Only available for accounts with the Advanced Quality Metrics feature enabled. (optional) + * @param bwQueued A boolean value indicating whether the message is queued in the Bandwidth network. (optional) + * @param product Messaging product associated with the message. (optional) + * @param location Location Id associated with the message. (optional) + * @param callingNumberCountryA3 Calling number country in A3 format. (optional) + * @param calledNumberCountryA3 Called number country in A3 format. (optional) + * @param fromSegmentCount Segment count (start range). (optional) + * @param toSegmentCount Segment count (end range). (optional) + * @param fromMessageSize Message size (start range). (optional) + * @param toMessageSize Message size (end range). (optional) * @param sort The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional) * @param pageToken A base64 encoded value used for pagination of results. (optional) * @param limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional) @@ -287,7 +298,7 @@ public okhttp3.Call createMessageAsync(String accountId, MessageRequest messageR 500 Internal Server Error - */ - public okhttp3.Call listMessagesCall(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listMessagesCall(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, Integer fromBwLatency, Boolean bwQueued, ProductTypeEnum product, String location, String callingNumberCountryA3, String calledNumberCountryA3, Integer fromSegmentCount, Integer toSegmentCount, Integer fromMessageSize, Integer toMessageSize, String sort, String pageToken, Integer limit, Boolean limitTotalCount, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { "https://messaging.bandwidth.com/api/v2" }; @@ -357,6 +368,46 @@ public okhttp3.Call listMessagesCall(String accountId, String messageId, String localVarQueryParams.addAll(localVarApiClient.parameterToPair("campaignId", campaignId)); } + if (fromBwLatency != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromBwLatency", fromBwLatency)); + } + + if (bwQueued != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("bwQueued", bwQueued)); + } + + if (product != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("product", product)); + } + + if (location != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("location", location)); + } + + if (callingNumberCountryA3 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("callingNumberCountryA3", callingNumberCountryA3)); + } + + if (calledNumberCountryA3 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("calledNumberCountryA3", calledNumberCountryA3)); + } + + if (fromSegmentCount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromSegmentCount", fromSegmentCount)); + } + + if (toSegmentCount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("toSegmentCount", toSegmentCount)); + } + + if (fromMessageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromMessageSize", fromMessageSize)); + } + + if (toMessageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("toMessageSize", toMessageSize)); + } + if (sort != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); } @@ -393,13 +444,13 @@ public okhttp3.Call listMessagesCall(String accountId, String messageId, String } @SuppressWarnings("rawtypes") - private okhttp3.Call listMessagesValidateBeforeCall(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listMessagesValidateBeforeCall(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, Integer fromBwLatency, Boolean bwQueued, ProductTypeEnum product, String location, String callingNumberCountryA3, String calledNumberCountryA3, Integer fromSegmentCount, Integer toSegmentCount, Integer fromMessageSize, Integer toMessageSize, String sort, String pageToken, Integer limit, Boolean limitTotalCount, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling listMessages(Async)"); } - return listMessagesCall(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort, pageToken, limit, limitTotalCount, _callback); + return listMessagesCall(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, fromBwLatency, bwQueued, product, location, callingNumberCountryA3, calledNumberCountryA3, fromSegmentCount, toSegmentCount, fromMessageSize, toMessageSize, sort, pageToken, limit, limitTotalCount, _callback); } @@ -418,6 +469,16 @@ private okhttp3.Call listMessagesValidateBeforeCall(String accountId, String mes * @param fromDateTime The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) * @param toDateTime The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) * @param campaignId The campaign ID of the message. (optional) + * @param fromBwLatency The minimum Bandwidth latency of the message in seconds. Only available for accounts with the Advanced Quality Metrics feature enabled. (optional) + * @param bwQueued A boolean value indicating whether the message is queued in the Bandwidth network. (optional) + * @param product Messaging product associated with the message. (optional) + * @param location Location Id associated with the message. (optional) + * @param callingNumberCountryA3 Calling number country in A3 format. (optional) + * @param calledNumberCountryA3 Called number country in A3 format. (optional) + * @param fromSegmentCount Segment count (start range). (optional) + * @param toSegmentCount Segment count (end range). (optional) + * @param fromMessageSize Message size (start range). (optional) + * @param toMessageSize Message size (end range). (optional) * @param sort The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional) * @param pageToken A base64 encoded value used for pagination of results. (optional) * @param limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional) @@ -438,8 +499,8 @@ private okhttp3.Call listMessagesValidateBeforeCall(String accountId, String mes 500 Internal Server Error - */ - public MessagesList listMessages(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount) throws ApiException { - ApiResponse localVarResp = listMessagesWithHttpInfo(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort, pageToken, limit, limitTotalCount); + public MessagesList listMessages(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, Integer fromBwLatency, Boolean bwQueued, ProductTypeEnum product, String location, String callingNumberCountryA3, String calledNumberCountryA3, Integer fromSegmentCount, Integer toSegmentCount, Integer fromMessageSize, Integer toMessageSize, String sort, String pageToken, Integer limit, Boolean limitTotalCount) throws ApiException { + ApiResponse localVarResp = listMessagesWithHttpInfo(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, fromBwLatency, bwQueued, product, location, callingNumberCountryA3, calledNumberCountryA3, fromSegmentCount, toSegmentCount, fromMessageSize, toMessageSize, sort, pageToken, limit, limitTotalCount); return localVarResp.getData(); } @@ -458,6 +519,16 @@ public MessagesList listMessages(String accountId, String messageId, String sour * @param fromDateTime The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) * @param toDateTime The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) * @param campaignId The campaign ID of the message. (optional) + * @param fromBwLatency The minimum Bandwidth latency of the message in seconds. Only available for accounts with the Advanced Quality Metrics feature enabled. (optional) + * @param bwQueued A boolean value indicating whether the message is queued in the Bandwidth network. (optional) + * @param product Messaging product associated with the message. (optional) + * @param location Location Id associated with the message. (optional) + * @param callingNumberCountryA3 Calling number country in A3 format. (optional) + * @param calledNumberCountryA3 Called number country in A3 format. (optional) + * @param fromSegmentCount Segment count (start range). (optional) + * @param toSegmentCount Segment count (end range). (optional) + * @param fromMessageSize Message size (start range). (optional) + * @param toMessageSize Message size (end range). (optional) * @param sort The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional) * @param pageToken A base64 encoded value used for pagination of results. (optional) * @param limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional) @@ -478,8 +549,8 @@ public MessagesList listMessages(String accountId, String messageId, String sour 500 Internal Server Error - */ - public ApiResponse listMessagesWithHttpInfo(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount) throws ApiException { - okhttp3.Call localVarCall = listMessagesValidateBeforeCall(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort, pageToken, limit, limitTotalCount, null); + public ApiResponse listMessagesWithHttpInfo(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, Integer fromBwLatency, Boolean bwQueued, ProductTypeEnum product, String location, String callingNumberCountryA3, String calledNumberCountryA3, Integer fromSegmentCount, Integer toSegmentCount, Integer fromMessageSize, Integer toMessageSize, String sort, String pageToken, Integer limit, Boolean limitTotalCount) throws ApiException { + okhttp3.Call localVarCall = listMessagesValidateBeforeCall(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, fromBwLatency, bwQueued, product, location, callingNumberCountryA3, calledNumberCountryA3, fromSegmentCount, toSegmentCount, fromMessageSize, toMessageSize, sort, pageToken, limit, limitTotalCount, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -499,6 +570,16 @@ public ApiResponse listMessagesWithHttpInfo(String accountId, Stri * @param fromDateTime The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) * @param toDateTime The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) * @param campaignId The campaign ID of the message. (optional) + * @param fromBwLatency The minimum Bandwidth latency of the message in seconds. Only available for accounts with the Advanced Quality Metrics feature enabled. (optional) + * @param bwQueued A boolean value indicating whether the message is queued in the Bandwidth network. (optional) + * @param product Messaging product associated with the message. (optional) + * @param location Location Id associated with the message. (optional) + * @param callingNumberCountryA3 Calling number country in A3 format. (optional) + * @param calledNumberCountryA3 Called number country in A3 format. (optional) + * @param fromSegmentCount Segment count (start range). (optional) + * @param toSegmentCount Segment count (end range). (optional) + * @param fromMessageSize Message size (start range). (optional) + * @param toMessageSize Message size (end range). (optional) * @param sort The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional) * @param pageToken A base64 encoded value used for pagination of results. (optional) * @param limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional) @@ -520,9 +601,9 @@ public ApiResponse listMessagesWithHttpInfo(String accountId, Stri 500 Internal Server Error - */ - public okhttp3.Call listMessagesAsync(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listMessagesAsync(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, Integer fromBwLatency, Boolean bwQueued, ProductTypeEnum product, String location, String callingNumberCountryA3, String calledNumberCountryA3, Integer fromSegmentCount, Integer toSegmentCount, Integer fromMessageSize, Integer toMessageSize, String sort, String pageToken, Integer limit, Boolean limitTotalCount, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listMessagesValidateBeforeCall(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort, pageToken, limit, limitTotalCount, _callback); + okhttp3.Call localVarCall = listMessagesValidateBeforeCall(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, fromBwLatency, bwQueued, product, location, callingNumberCountryA3, calledNumberCountryA3, fromSegmentCount, toSegmentCount, fromMessageSize, toMessageSize, sort, pageToken, limit, limitTotalCount, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java b/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java index 611e2633..c88c1cf5 100644 --- a/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java +++ b/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java @@ -140,6 +140,31 @@ public class ListMessageItem { @javax.annotation.Nullable private String campaignId; + public static final String SERIALIZED_NAME_BW_LATENCY = "bwLatency"; + @SerializedName(SERIALIZED_NAME_BW_LATENCY) + @javax.annotation.Nullable + private Integer bwLatency; + + public static final String SERIALIZED_NAME_CALLING_NUMBER_COUNTRY_A3 = "callingNumberCountryA3"; + @SerializedName(SERIALIZED_NAME_CALLING_NUMBER_COUNTRY_A3) + @javax.annotation.Nullable + private String callingNumberCountryA3; + + public static final String SERIALIZED_NAME_CALLED_NUMBER_COUNTRY_A3 = "calledNumberCountryA3"; + @SerializedName(SERIALIZED_NAME_CALLED_NUMBER_COUNTRY_A3) + @javax.annotation.Nullable + private String calledNumberCountryA3; + + public static final String SERIALIZED_NAME_PRODUCT = "product"; + @SerializedName(SERIALIZED_NAME_PRODUCT) + @javax.annotation.Nullable + private String product; + + public static final String SERIALIZED_NAME_LOCATION = "location"; + @SerializedName(SERIALIZED_NAME_LOCATION) + @javax.annotation.Nullable + private String location; + public ListMessageItem() { } @@ -465,6 +490,101 @@ public void setCampaignId(@javax.annotation.Nullable String campaignId) { this.campaignId = campaignId; } + + public ListMessageItem bwLatency(@javax.annotation.Nullable Integer bwLatency) { + this.bwLatency = bwLatency; + return this; + } + + /** + * The Bandwidth latency of the message in seconds. Only available for accounts with the Advanced Quality Metrics feature enabled. + * @return bwLatency + */ + @javax.annotation.Nullable + public Integer getBwLatency() { + return bwLatency; + } + + public void setBwLatency(@javax.annotation.Nullable Integer bwLatency) { + this.bwLatency = bwLatency; + } + + + public ListMessageItem callingNumberCountryA3(@javax.annotation.Nullable String callingNumberCountryA3) { + this.callingNumberCountryA3 = callingNumberCountryA3; + return this; + } + + /** + * The A3 country code of the calling number. + * @return callingNumberCountryA3 + */ + @javax.annotation.Nullable + public String getCallingNumberCountryA3() { + return callingNumberCountryA3; + } + + public void setCallingNumberCountryA3(@javax.annotation.Nullable String callingNumberCountryA3) { + this.callingNumberCountryA3 = callingNumberCountryA3; + } + + + public ListMessageItem calledNumberCountryA3(@javax.annotation.Nullable String calledNumberCountryA3) { + this.calledNumberCountryA3 = calledNumberCountryA3; + return this; + } + + /** + * The A3 country code of the called number. + * @return calledNumberCountryA3 + */ + @javax.annotation.Nullable + public String getCalledNumberCountryA3() { + return calledNumberCountryA3; + } + + public void setCalledNumberCountryA3(@javax.annotation.Nullable String calledNumberCountryA3) { + this.calledNumberCountryA3 = calledNumberCountryA3; + } + + + public ListMessageItem product(@javax.annotation.Nullable String product) { + this.product = product; + return this; + } + + /** + * The messaging product associated with the message. + * @return product + */ + @javax.annotation.Nullable + public String getProduct() { + return product; + } + + public void setProduct(@javax.annotation.Nullable String product) { + this.product = product; + } + + + public ListMessageItem location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * The location ID associated with this message. + * @return location + */ + @javax.annotation.Nullable + public String getLocation() { + return location; + } + + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -536,7 +656,12 @@ public boolean equals(Object o) { Objects.equals(this.attachmentCount, listMessageItem.attachmentCount) && Objects.equals(this.recipientCount, listMessageItem.recipientCount) && Objects.equals(this.campaignClass, listMessageItem.campaignClass) && - Objects.equals(this.campaignId, listMessageItem.campaignId)&& + Objects.equals(this.campaignId, listMessageItem.campaignId) && + Objects.equals(this.bwLatency, listMessageItem.bwLatency) && + Objects.equals(this.callingNumberCountryA3, listMessageItem.callingNumberCountryA3) && + Objects.equals(this.calledNumberCountryA3, listMessageItem.calledNumberCountryA3) && + Objects.equals(this.product, listMessageItem.product) && + Objects.equals(this.location, listMessageItem.location)&& Objects.equals(this.additionalProperties, listMessageItem.additionalProperties); } @@ -546,7 +671,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(messageId, accountId, sourceTn, destinationTn, messageStatus, messageDirection, messageType, segmentCount, errorCode, receiveTime, carrierName, messageSize, messageLength, attachmentCount, recipientCount, campaignClass, campaignId, additionalProperties); + return Objects.hash(messageId, accountId, sourceTn, destinationTn, messageStatus, messageDirection, messageType, segmentCount, errorCode, receiveTime, carrierName, messageSize, messageLength, attachmentCount, recipientCount, campaignClass, campaignId, bwLatency, callingNumberCountryA3, calledNumberCountryA3, product, location, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -577,6 +702,11 @@ public String toString() { sb.append(" recipientCount: ").append(toIndentedString(recipientCount)).append("\n"); sb.append(" campaignClass: ").append(toIndentedString(campaignClass)).append("\n"); sb.append(" campaignId: ").append(toIndentedString(campaignId)).append("\n"); + sb.append(" bwLatency: ").append(toIndentedString(bwLatency)).append("\n"); + sb.append(" callingNumberCountryA3: ").append(toIndentedString(callingNumberCountryA3)).append("\n"); + sb.append(" calledNumberCountryA3: ").append(toIndentedString(calledNumberCountryA3)).append("\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -617,6 +747,11 @@ private String toIndentedString(Object o) { openapiFields.add("recipientCount"); openapiFields.add("campaignClass"); openapiFields.add("campaignId"); + openapiFields.add("bwLatency"); + openapiFields.add("callingNumberCountryA3"); + openapiFields.add("calledNumberCountryA3"); + openapiFields.add("product"); + openapiFields.add("location"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -668,6 +803,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("campaignId") != null && !jsonObj.get("campaignId").isJsonNull()) && !jsonObj.get("campaignId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `campaignId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("campaignId").toString())); } + if ((jsonObj.get("callingNumberCountryA3") != null && !jsonObj.get("callingNumberCountryA3").isJsonNull()) && !jsonObj.get("callingNumberCountryA3").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `callingNumberCountryA3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("callingNumberCountryA3").toString())); + } + if ((jsonObj.get("calledNumberCountryA3") != null && !jsonObj.get("calledNumberCountryA3").isJsonNull()) && !jsonObj.get("calledNumberCountryA3").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `calledNumberCountryA3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("calledNumberCountryA3").toString())); + } + if ((jsonObj.get("product") != null && !jsonObj.get("product").isJsonNull()) && !jsonObj.get("product").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `product` to be a primitive type in the JSON string but got `%s`", jsonObj.get("product").toString())); + } + if ((jsonObj.get("location") != null && !jsonObj.get("location").isJsonNull()) && !jsonObj.get("location").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("location").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/bandwidth/sdk/model/MessageTypeEnum.java b/src/main/java/com/bandwidth/sdk/model/MessageTypeEnum.java index e12241ca..ba7ade9b 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageTypeEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageTypeEnum.java @@ -31,7 +31,9 @@ public enum MessageTypeEnum { SMS("sms"), - MMS("mms"); + MMS("mms"), + + RCS("rcs"); private String value; diff --git a/src/main/java/com/bandwidth/sdk/model/ProductTypeEnum.java b/src/main/java/com/bandwidth/sdk/model/ProductTypeEnum.java new file mode 100644 index 00000000..5c83c023 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/ProductTypeEnum.java @@ -0,0 +1,92 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The type of product associated with the message. + */ +@JsonAdapter(ProductTypeEnum.Adapter.class) +public enum ProductTypeEnum { + + LOCAL_A2_P("LOCAL_A2P"), + + P2_P("P2P"), + + SHORT_CODE_REACH("SHORT_CODE_REACH"), + + TOLL_FREE("TOLL_FREE"), + + HOSTED_SHORT_CODE("HOSTED_SHORT_CODE"), + + ALPHA_NUMERIC("ALPHA_NUMERIC"), + + RBM_MEDIA("RBM_MEDIA"), + + RBM_RICH("RBM_RICH"), + + RBM_CONVERSATIONAL("RBM_CONVERSATIONAL"); + + private String value; + + ProductTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ProductTypeEnum fromValue(String value) { + for (ProductTypeEnum b : ProductTypeEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ProductTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ProductTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ProductTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ProductTypeEnum.fromValue(value); + } +} +