From 92aaf2b1e8334239b16a3504abb8fc463b9be1f4 Mon Sep 17 00:00:00 2001 From: Tamas Juhasz Date: Fri, 2 Aug 2024 08:36:37 +0200 Subject: [PATCH 1/6] Added support for SMS v3, updated tests, updated CHANGELOG.md, README.md --- CHANGELOG.md | 23 +- README.md | 23 +- pom.xml | 2 +- src/main/java/com/infobip/RequestFactory.java | 2 +- src/main/java/com/infobip/api/SmsApi.java | 449 ++++----- .../model/CallRoutingAllowedTimeFrom.java | 158 --- .../model/CallRoutingAllowedTimeTo.java | 158 --- .../model/CallRoutingAllowedTimeWindow.java | 193 ---- .../model/CallRoutingEndpointDestination.java | 11 +- .../infobip/model/CallsAdvancedMessage.java | 14 +- .../model/CallsClickToCallMessage.java | 8 +- .../com/infobip/model/CallsDeliveryTime.java | 128 --- .../model/CallsDeliveryTimeWindow.java | 193 ---- .../infobip/model/CallsSchedulingOptions.java | 8 +- .../com/infobip/model/CallsTimeWindow.java | 242 ----- .../infobip/model/CallsTimeWindowPoint.java | 128 --- .../{SmsDeliveryDay.java => DeliveryDay.java} | 8 +- ...berDeliveryTime.java => DeliveryTime.java} | 17 +- ...imeWindow.java => DeliveryTimeWindow.java} | 46 +- .../com/infobip/model/MmsAdvancedMessage.java | 17 +- .../com/infobip/model/MmsDeliveryTime.java | 145 --- .../infobip/model/MmsDeliveryTimeWindow.java | 201 ---- .../java/com/infobip/model/MmsReport.java | 17 +- ...sRecipientType.java => RecipientType.java} | 8 +- .../model/SmsAdvancedTextualRequest.java | 330 ------- .../com/infobip/model/SmsBinaryContent.java | 8 +- .../com/infobip/model/SmsBinaryMessage.java | 713 ------------- .../com/infobip/model/SmsDeliveryReport.java | 677 +++++++++++++ .../com/infobip/model/SmsDeliveryReports.java | 119 +++ .../infobip/model/SmsDeliveryTimeFrom.java | 158 --- .../com/infobip/model/SmsDeliveryTimeTo.java | 158 --- .../infobip/model/SmsDeliveryTimeWindow.java | 201 ---- .../com/infobip/model/SmsDestination.java | 103 +- ...sDeliveryDay.java => SmsLanguageCode.java} | 22 +- src/main/java/com/infobip/model/SmsLog.java | 592 ++++++----- .../com/infobip/model/SmsLogsResponse.java | 8 +- .../java/com/infobip/model/SmsMessage.java | 296 ++++++ .../com/infobip/model/SmsMessageContent.java | 12 + .../model/SmsMessageDeliveryReporting.java | 192 ++++ .../com/infobip/model/SmsMessageError.java | 321 ++++++ ...veryDay.java => SmsMessageErrorGroup.java} | 21 +- .../model/SmsMessageGeneralStatus.java | 51 + .../com/infobip/model/SmsMessageOptions.java | 294 ++++++ .../model/SmsMessageRequestOptions.java | 211 ++++ .../model/SmsMessageResponseDetails.java | 100 ++ .../com/infobip/model/SmsMessageStatus.java | 321 ++++++ .../java/com/infobip/model/SmsPlatform.java | 146 +++ .../java/com/infobip/model/SmsReport.java | 51 +- .../com/infobip/model/SmsRequestEnvelope.java | 164 +++ ...java => SmsRequestSchedulingSettings.java} | 100 +- .../java/com/infobip/model/SmsResponse.java | 16 +- .../com/infobip/model/SmsResponseDetails.java | 103 +- .../infobip/model/SmsSouthKoreaOptions.java | 84 +- .../infobip/model/SmsTextMessageContent.java | 180 ++++ .../com/infobip/model/SmsTextualMessage.java | 807 --------------- .../java/com/infobip/model/SmsTracking.java | 174 +--- .../infobip/model/SmsTransliterationCode.java | 57 ++ .../infobip/model/SmsTurkeyIysOptions.java | 8 +- .../com/infobip/model/SmsValidityPeriod.java | 143 +++ ...ay.java => SmsValidityPeriodTimeUnit.java} | 20 +- .../SmsWebhookInboundReportResponse.java | 106 +- .../java/com/infobip/model/SmsWebhooks.java | 183 ++++ .../com/infobip/model/ViberDeliveryDay.java | 52 - .../infobip/model/ViberMessageOptions.java | 8 +- .../infobip/model/WebRtcAcceptableHours.java | 16 +- .../com/infobip/model/WebRtcTimeOfDay.java | 127 --- .../java/com/infobip/RequestFactoryTest.java | 2 +- .../com/infobip/StringRepresentationTest.java | 53 +- .../infobip/api/ApiErrorResponsesTest.java | 98 +- .../java/com/infobip/api/CallLinkApiTest.java | 8 +- .../java/com/infobip/api/CallsApiTest.java | 10 +- src/test/java/com/infobip/api/MmsApiTest.java | 19 +- src/test/java/com/infobip/api/SmsApiTest.java | 934 +++++++++--------- 73 files changed, 5079 insertions(+), 5697 deletions(-) delete mode 100644 src/main/java/com/infobip/model/CallRoutingAllowedTimeFrom.java delete mode 100644 src/main/java/com/infobip/model/CallRoutingAllowedTimeTo.java delete mode 100644 src/main/java/com/infobip/model/CallRoutingAllowedTimeWindow.java delete mode 100644 src/main/java/com/infobip/model/CallsDeliveryTime.java delete mode 100644 src/main/java/com/infobip/model/CallsDeliveryTimeWindow.java delete mode 100644 src/main/java/com/infobip/model/CallsTimeWindow.java delete mode 100644 src/main/java/com/infobip/model/CallsTimeWindowPoint.java rename src/main/java/com/infobip/model/{SmsDeliveryDay.java => DeliveryDay.java} (86%) rename src/main/java/com/infobip/model/{ViberDeliveryTime.java => DeliveryTime.java} (88%) rename src/main/java/com/infobip/model/{ViberDeliveryTimeWindow.java => DeliveryTimeWindow.java} (76%) delete mode 100644 src/main/java/com/infobip/model/MmsDeliveryTime.java delete mode 100644 src/main/java/com/infobip/model/MmsDeliveryTimeWindow.java rename src/main/java/com/infobip/model/{SmsIysRecipientType.java => RecipientType.java} (83%) delete mode 100644 src/main/java/com/infobip/model/SmsAdvancedTextualRequest.java delete mode 100644 src/main/java/com/infobip/model/SmsBinaryMessage.java create mode 100644 src/main/java/com/infobip/model/SmsDeliveryReport.java create mode 100644 src/main/java/com/infobip/model/SmsDeliveryReports.java delete mode 100644 src/main/java/com/infobip/model/SmsDeliveryTimeFrom.java delete mode 100644 src/main/java/com/infobip/model/SmsDeliveryTimeTo.java delete mode 100644 src/main/java/com/infobip/model/SmsDeliveryTimeWindow.java rename src/main/java/com/infobip/model/{MmsDeliveryDay.java => SmsLanguageCode.java} (64%) create mode 100644 src/main/java/com/infobip/model/SmsMessage.java create mode 100644 src/main/java/com/infobip/model/SmsMessageContent.java create mode 100644 src/main/java/com/infobip/model/SmsMessageDeliveryReporting.java create mode 100644 src/main/java/com/infobip/model/SmsMessageError.java rename src/main/java/com/infobip/model/{CallsDeliveryDay.java => SmsMessageErrorGroup.java} (69%) create mode 100644 src/main/java/com/infobip/model/SmsMessageGeneralStatus.java create mode 100644 src/main/java/com/infobip/model/SmsMessageOptions.java create mode 100644 src/main/java/com/infobip/model/SmsMessageRequestOptions.java create mode 100644 src/main/java/com/infobip/model/SmsMessageResponseDetails.java create mode 100644 src/main/java/com/infobip/model/SmsMessageStatus.java create mode 100644 src/main/java/com/infobip/model/SmsPlatform.java create mode 100644 src/main/java/com/infobip/model/SmsRequestEnvelope.java rename src/main/java/com/infobip/model/{SmsAdvancedBinaryRequest.java => SmsRequestSchedulingSettings.java} (53%) create mode 100644 src/main/java/com/infobip/model/SmsTextMessageContent.java delete mode 100644 src/main/java/com/infobip/model/SmsTextualMessage.java create mode 100644 src/main/java/com/infobip/model/SmsTransliterationCode.java create mode 100644 src/main/java/com/infobip/model/SmsValidityPeriod.java rename src/main/java/com/infobip/model/{CallRoutingAllowedDay.java => SmsValidityPeriodTimeUnit.java} (69%) create mode 100644 src/main/java/com/infobip/model/SmsWebhooks.java delete mode 100644 src/main/java/com/infobip/model/ViberDeliveryDay.java delete mode 100644 src/main/java/com/infobip/model/WebRtcTimeOfDay.java diff --git a/CHANGELOG.md b/CHANGELOG.md index f03f6fc..b3b1279 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,33 @@ All notable changes to the library will be documented in this file. The format of the file is based on [Keep a Changelog](http://keepachangelog.com/) and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file. -## [Unreleased] +## [ [4.4.0](https://github.com/infobip/infobip-api-java-client/releases/tag/4.4.0) ] - 2024-08-02 + +⚠️ **IMPORTANT NOTE:** This release contains compile time breaking changes. +All changes, including breaking changes, are addressed and explained in the list bellow. +If you find out that something was not addressed properly, please submit an issue. ### Added +* Most recent [Infobip SMS API](https://www.infobip.com/docs/api/channels/sms) feature set. + * Introduced `/sms/3/messages (V3)` replacing the `/sms/2/text/advanced (V2)` and `/sms/2/binary/advanced (V2)` endpoints. + * Introduced `/sms/3/reports (V3)` replacing `/sms/1/reports (V1)` endpoint. + * Introduced `/sms/3/logs (V3)` replacing `/sms/1/logs (V1)` endpoint. * Added mock tests to verify the correctness of request payloads and response handling. * Added `awaitility` and `wiremock` test dependencies. +### Changed +* **Fixes and changes** + * Changed 'sentAt', 'doneAt' field type in [MmsReport](src/main/java/com/infobip/model/MmsReport.java) from String to OffsetDateTime since it didn't correspond to the state of the endpoint. + +* **Removed classes and unified structures** + * Removed delivery time window configuration classes (`SmsDeliveryTimeWindow`, `MmsDeliveryTimeWindow`, `ViberDeliveryTimeWindow`, `CallRoutingAllowedTimeWindow`, `CallsDeliveryTimeWindow`, `SmsDeliveryTimeWindow`, `CallsTimeWindow`) in favor of a unified class: [DeliveryTimeWindow](src/main/java/com/infobip/model/DeliveryTimeWindow.java) + * Removed delivery time configuration classes (`SmsDeliveryTimeFrom`, `SmsDeliveryTimeTo`, `MmsDeliveryTime`, `ViberDeliveryTime`, `CallsTimeWindowPoint`, `WebRtcTimeOfDay`, `CallRoutingAllowedTimeFrom`, `CallRoutingAllowedTimeTo`, `WebRtcTimeOfDay`) in favor of a unified class: [DeliveryTime](src/main/java/com/infobip/model/DeliveryTime.java) + * Removed delivery day enumeration classes (`SmsDeliveryDay`, `MmsDeliveryDay`, `CallsDeliveryDay`, `CallRoutingAllowedDay`) in favor of a unified class: [DeliveryDay](src/main/java/com/infobip/model/DeliveryDay.java) + * Removed recipient type enumeration class (`SmsIysRecipientType`) in favor of a unified class: [RecipientType](src/main/java/com/infobip/model/RecipientType.java) + +* **Documentation** + * Fixed Javadoc. + ## [ [4.3.1](https://github.com/infobip/infobip-api-java-client/releases/tag/4.3.1) ] - 2024-06-05 ### Added diff --git a/README.md b/README.md index 8e7530c..ce72d79 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Simply add the following in your project's POM file under `dependencies` tag: com.infobip infobip-api-java-client - 4.3.1 + 4.4.0 ``` @@ -85,17 +85,18 @@ See below, a simple example of sending a single SMS message to a single recipien ```java SmsApi smsApi = new SmsApi(apiClient); - SmsTextualMessage smsMessage = new SmsTextualMessage() - .from("InfoSMS") - .addDestinationsItem(new SmsDestination().to("41793026727")) - .text("Hello World from infobip-api-java-client!"); - SmsAdvancedTextualRequest smsMessageRequest = new SmsAdvancedTextualRequest() - .messages(List.of(smsMessage)); + SmsMessage message = new SmsMessage() + .sender("InfoSMS") + .destinations(new SmsDestination().to("41793026727")) + .content(new SmsTextMessageContent().text("Hello World from infobip-api-java-client!")); + + SmsRequestEnvelope smsMessageRequest = new SmsRequestEnvelope() + .messages(List.of(message)); ``` ```java try { - SmsResponse smsResponse = smsApi.sendSmsMessage(smsMessageRequest).execute(); + SmsResponse smsResponse = smsApi.sendSmsMessages(smsMessageRequest).execute(); } catch (ApiException apiException) { // HANDLE THE EXCEPTION } @@ -103,7 +104,7 @@ See below, a simple example of sending a single SMS message to a single recipien For asynchronous processing, you can use the following approach: ```java - smsApi.sendSmsMessage(smsMessageRequest) + smsApi.sendSmsMessages(smsMessageRequest) .executeAsync(new ApiCallback<>() { @Override public void onSuccess(SmsResponse result, int responseStatusCode, Map> responseHeaders) { @@ -158,7 +159,7 @@ If you are for any reason unable to receive real-time delivery reports on your e Each request will return a batch of delivery reports - only once. See [documentation](https://www.infobip.com/docs/api/channels/sms/sms-messaging/logs-and-status-reports/get-outbound-sms-message-delivery-reports) for more details. ```java - SmsDeliveryResult deliveryReports = smsApi.getOutboundSmsMessageDeliveryReports() + SmsDeliveryReports deliveryReports = smsApi.getOutboundSmsMessageDeliveryReports() .bulkId(bulkId) .execute(); for (SmsReport report : deliveryReports.getResults()) { @@ -214,7 +215,7 @@ This code is auto generated, and we are unable to merge any pull request from he For anything that requires our imminent attention, contact us @ [support@infobip.com](mailto:support@infobip.com). [apidocs]: https://www.infobip.com/docs/api -[freetrial]: https://www.infobip.com/docs/essentials/free-trial +[freetrial]: https://www.infobip.com/docs/essentials/getting-started/free-trial [signup]: https://www.infobip.com/signup [semver]: https://semver.org [license]: LICENSE diff --git a/pom.xml b/pom.xml index 4cf027b..7cbf8f7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.infobip infobip-api-java-client - 4.3.1 + 4.4.0 jar infobip-api-java-client diff --git a/src/main/java/com/infobip/RequestFactory.java b/src/main/java/com/infobip/RequestFactory.java index 79e6a98..896a318 100644 --- a/src/main/java/com/infobip/RequestFactory.java +++ b/src/main/java/com/infobip/RequestFactory.java @@ -26,7 +26,7 @@ */ final class RequestFactory { - private static final String USER_AGENT_HEADER_VALUE = "infobip-api-client-java/4.3.1"; + private static final String USER_AGENT_HEADER_VALUE = "infobip-api-client-java/4.4.0"; private final ApiKey apiKey; private final BaseUrl baseUrl; diff --git a/src/main/java/com/infobip/api/SmsApi.java b/src/main/java/com/infobip/api/SmsApi.java index 1ade643..1d7fc07 100644 --- a/src/main/java/com/infobip/api/SmsApi.java +++ b/src/main/java/com/infobip/api/SmsApi.java @@ -10,24 +10,24 @@ package com.infobip.api; import com.fasterxml.jackson.core.type.TypeReference; +import com.google.common.annotations.Beta; import com.infobip.ApiCallback; import com.infobip.ApiClient; import com.infobip.ApiException; import com.infobip.Parameter; import com.infobip.RequestDefinition; -import com.infobip.model.SmsAdvancedBinaryRequest; -import com.infobip.model.SmsAdvancedTextualRequest; import com.infobip.model.SmsBulkRequest; import com.infobip.model.SmsBulkResponse; import com.infobip.model.SmsBulkStatusResponse; -import com.infobip.model.SmsDeliveryResult; +import com.infobip.model.SmsDeliveryReports; import com.infobip.model.SmsInboundMessageResult; import com.infobip.model.SmsLogsResponse; +import com.infobip.model.SmsMessageGeneralStatus; import com.infobip.model.SmsPreviewRequest; import com.infobip.model.SmsPreviewResponse; +import com.infobip.model.SmsRequestEnvelope; import com.infobip.model.SmsResponse; import com.infobip.model.SmsUpdateStatusRequest; -import java.time.OffsetDateTime; import java.util.List; import java.util.Objects; @@ -147,9 +147,14 @@ public GetInboundSmsMessagesRequest getInboundSmsMessages() { return new GetInboundSmsMessagesRequest(); } - private RequestDefinition getOutboundSmsMessageDeliveryReportsDefinition( - String bulkId, String messageId, Integer limit, String applicationId, String entityId) { - RequestDefinition.Builder builder = RequestDefinition.builder("GET", "/sms/1/reports") + private RequestDefinition getOutboundSmsMessageDeliveryReportsV3Definition( + String bulkId, + String messageId, + Integer limit, + String entityId, + String applicationId, + String campaignReferenceId) { + RequestDefinition.Builder builder = RequestDefinition.builder("GET", "/sms/3/reports") .requiresAuthentication(true) .accept("application/json"); @@ -162,34 +167,38 @@ private RequestDefinition getOutboundSmsMessageDeliveryReportsDefinition( if (limit != null) { builder.addQueryParameter(new Parameter("limit", limit)); } + if (entityId != null) { + builder.addQueryParameter(new Parameter("entityId", entityId)); + } if (applicationId != null) { builder.addQueryParameter(new Parameter("applicationId", applicationId)); } - if (entityId != null) { - builder.addQueryParameter(new Parameter("entityId", entityId)); + if (campaignReferenceId != null) { + builder.addQueryParameter(new Parameter("campaignReferenceId", campaignReferenceId)); } return builder.build(); } /** - * getOutboundSmsMessageDeliveryReports request builder class. + * getOutboundSmsMessageDeliveryReportsV3 request builder class. */ - public class GetOutboundSmsMessageDeliveryReportsRequest { + public class GetOutboundSmsMessageDeliveryReportsV3Request { private String bulkId; private String messageId; private Integer limit; - private String applicationId; private String entityId; + private String applicationId; + private String campaignReferenceId; - private GetOutboundSmsMessageDeliveryReportsRequest() {} + private GetOutboundSmsMessageDeliveryReportsV3Request() {} /** * Sets bulkId. * - * @param bulkId Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. (optional) - * @return GetOutboundSmsMessageDeliveryReportsRequest + * @param bulkId The ID that uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address. (optional) + * @return GetOutboundSmsMessageDeliveryReportsV3Request */ - public GetOutboundSmsMessageDeliveryReportsRequest bulkId(String bulkId) { + public GetOutboundSmsMessageDeliveryReportsV3Request bulkId(String bulkId) { this.bulkId = bulkId; return this; } @@ -197,10 +206,10 @@ public GetOutboundSmsMessageDeliveryReportsRequest bulkId(String bulkId) { /** * Sets messageId. * - * @param messageId Unique message ID for which a report is requested. (optional) - * @return GetOutboundSmsMessageDeliveryReportsRequest + * @param messageId The ID that uniquely identifies the message sent. (optional) + * @return GetOutboundSmsMessageDeliveryReportsV3Request */ - public GetOutboundSmsMessageDeliveryReportsRequest messageId(String messageId) { + public GetOutboundSmsMessageDeliveryReportsV3Request messageId(String messageId) { this.messageId = messageId; return this; } @@ -208,62 +217,75 @@ public GetOutboundSmsMessageDeliveryReportsRequest messageId(String messageId) { /** * Sets limit. * - * @param limit Maximum number of delivery reports to be returned. If not set, the latest 50 records are returned. Maximum limit value is `1000` and you can only access reports for the last 48h. (optional, default to 50) - * @return GetOutboundSmsMessageDeliveryReportsRequest + * @param limit Maximum number of delivery reports to be returned. If not set, the latest 50 records are returned. Maximum limit value is 1000 and you can only access reports for the last 48h (optional, default to 50) + * @return GetOutboundSmsMessageDeliveryReportsV3Request */ - public GetOutboundSmsMessageDeliveryReportsRequest limit(Integer limit) { + public GetOutboundSmsMessageDeliveryReportsV3Request limit(Integer limit) { this.limit = limit; return this; } + /** + * Sets entityId. + * + * @param entityId Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). (optional) + * @return GetOutboundSmsMessageDeliveryReportsV3Request + */ + public GetOutboundSmsMessageDeliveryReportsV3Request entityId(String entityId) { + this.entityId = entityId; + return this; + } + /** * Sets applicationId. * * @param applicationId Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). (optional) - * @return GetOutboundSmsMessageDeliveryReportsRequest + * @return GetOutboundSmsMessageDeliveryReportsV3Request */ - public GetOutboundSmsMessageDeliveryReportsRequest applicationId(String applicationId) { + public GetOutboundSmsMessageDeliveryReportsV3Request applicationId(String applicationId) { this.applicationId = applicationId; return this; } /** - * Sets entityId. + * Sets campaignReferenceId. * - * @param entityId Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). (optional) - * @return GetOutboundSmsMessageDeliveryReportsRequest + * @param campaignReferenceId ID of a campaign that was sent in the message. (optional) + * @return GetOutboundSmsMessageDeliveryReportsV3Request */ - public GetOutboundSmsMessageDeliveryReportsRequest entityId(String entityId) { - this.entityId = entityId; + public GetOutboundSmsMessageDeliveryReportsV3Request campaignReferenceId(String campaignReferenceId) { + this.campaignReferenceId = campaignReferenceId; return this; } /** - * Executes the getOutboundSmsMessageDeliveryReports request. + * Executes the getOutboundSmsMessageDeliveryReportsV3 request. * - * @return SmsDeliveryResult The deserialized response. + * @return SmsDeliveryReports The deserialized response. * @throws ApiException If the API call fails or an error occurs during the request or response processing. */ - public SmsDeliveryResult execute() throws ApiException { - RequestDefinition getOutboundSmsMessageDeliveryReportsDefinition = - getOutboundSmsMessageDeliveryReportsDefinition(bulkId, messageId, limit, applicationId, entityId); + public SmsDeliveryReports execute() throws ApiException { + RequestDefinition getOutboundSmsMessageDeliveryReportsV3Definition = + getOutboundSmsMessageDeliveryReportsV3Definition( + bulkId, messageId, limit, entityId, applicationId, campaignReferenceId); return apiClient.execute( - getOutboundSmsMessageDeliveryReportsDefinition, - new TypeReference() {}.getType()); + getOutboundSmsMessageDeliveryReportsV3Definition, + new TypeReference() {}.getType()); } /** - * Executes the getOutboundSmsMessageDeliveryReports request asynchronously. + * Executes the getOutboundSmsMessageDeliveryReportsV3 request asynchronously. * * @param callback The {@link ApiCallback} to be invoked. * @return The {@link okhttp3.Call} associated with the API request. */ - public okhttp3.Call executeAsync(ApiCallback callback) { - RequestDefinition getOutboundSmsMessageDeliveryReportsDefinition = - getOutboundSmsMessageDeliveryReportsDefinition(bulkId, messageId, limit, applicationId, entityId); + public okhttp3.Call executeAsync(ApiCallback callback) { + RequestDefinition getOutboundSmsMessageDeliveryReportsV3Definition = + getOutboundSmsMessageDeliveryReportsV3Definition( + bulkId, messageId, limit, entityId, applicationId, campaignReferenceId); return apiClient.executeAsync( - getOutboundSmsMessageDeliveryReportsDefinition, - new TypeReference() {}.getType(), + getOutboundSmsMessageDeliveryReportsV3Definition, + new TypeReference() {}.getType(), callback); } } @@ -271,37 +293,45 @@ public okhttp3.Call executeAsync(ApiCallback callback) { /** * Get outbound SMS message delivery reports. *

- * If you are for any reason unable to receive real-time delivery reports on your endpoint, you can use this API method to learn if and when the message has been delivered to the recipient. Each request will return a batch of delivery reports - only once. The following API request will return only new reports that arrived since the last API request in the last 48 hours. + * If you are unable to receive real-time message delivery reports towards your endpoint for various reasons, we offer you an API method to fetch batches of message reports to confirm whether specific messages have been delivered. Each request towards this endpoint will return batches of the latest message reports. Please note they will be returned only once. * - * @return GetOutboundSmsMessageDeliveryReportsRequest - * @see Learn more about SMS channel and use cases + * @return GetOutboundSmsMessageDeliveryReportsV3Request + * @see Learn more about the SMS channel and its use cases */ - public GetOutboundSmsMessageDeliveryReportsRequest getOutboundSmsMessageDeliveryReports() { - return new GetOutboundSmsMessageDeliveryReportsRequest(); + @Beta + public GetOutboundSmsMessageDeliveryReportsV3Request getOutboundSmsMessageDeliveryReportsV3() { + return new GetOutboundSmsMessageDeliveryReportsV3Request(); } - private RequestDefinition getOutboundSmsMessageLogsDefinition( - String from, - String to, + private RequestDefinition getOutboundSmsMessageLogsV3Definition( + String mcc, + String mnc, + String sender, + String destination, List bulkId, List messageId, - String generalStatus, - OffsetDateTime sentSince, - OffsetDateTime sentUntil, + SmsMessageGeneralStatus generalStatus, + String sentSince, + String sentUntil, Integer limit, - String mcc, - String mnc, + String entityId, String applicationId, - String entityId) { - RequestDefinition.Builder builder = RequestDefinition.builder("GET", "/sms/1/logs") + List campaignReferenceId) { + RequestDefinition.Builder builder = RequestDefinition.builder("GET", "/sms/3/logs") .requiresAuthentication(true) .accept("application/json"); - if (from != null) { - builder.addQueryParameter(new Parameter("from", from)); + if (mcc != null) { + builder.addQueryParameter(new Parameter("mcc", mcc)); + } + if (mnc != null) { + builder.addQueryParameter(new Parameter("mnc", mnc)); } - if (to != null) { - builder.addQueryParameter(new Parameter("to", to)); + if (sender != null) { + builder.addQueryParameter(new Parameter("sender", sender)); + } + if (destination != null) { + builder.addQueryParameter(new Parameter("destination", destination)); } if (bulkId != null) { for (var parameterItem : bulkId) { @@ -325,59 +355,81 @@ private RequestDefinition getOutboundSmsMessageLogsDefinition( if (limit != null) { builder.addQueryParameter(new Parameter("limit", limit)); } - if (mcc != null) { - builder.addQueryParameter(new Parameter("mcc", mcc)); - } - if (mnc != null) { - builder.addQueryParameter(new Parameter("mnc", mnc)); + if (entityId != null) { + builder.addQueryParameter(new Parameter("entityId", entityId)); } if (applicationId != null) { builder.addQueryParameter(new Parameter("applicationId", applicationId)); } - if (entityId != null) { - builder.addQueryParameter(new Parameter("entityId", entityId)); + if (campaignReferenceId != null) { + for (var parameterItem : campaignReferenceId) { + builder.addQueryParameter(new Parameter("campaignReferenceId", parameterItem)); + } } return builder.build(); } /** - * getOutboundSmsMessageLogs request builder class. + * getOutboundSmsMessageLogsV3 request builder class. */ - public class GetOutboundSmsMessageLogsRequest { - private String from; - private String to; + public class GetOutboundSmsMessageLogsV3Request { + private String mcc; + private String mnc; + private String sender; + private String destination; private List bulkId; private List messageId; - private String generalStatus; - private OffsetDateTime sentSince; - private OffsetDateTime sentUntil; + private SmsMessageGeneralStatus generalStatus; + private String sentSince; + private String sentUntil; private Integer limit; - private String mcc; - private String mnc; - private String applicationId; private String entityId; + private String applicationId; + private List campaignReferenceId; - private GetOutboundSmsMessageLogsRequest() {} + private GetOutboundSmsMessageLogsV3Request() {} + + /** + * Sets mcc. + * + * @param mcc Mobile Country Code. (optional) + * @return GetOutboundSmsMessageLogsV3Request + */ + public GetOutboundSmsMessageLogsV3Request mcc(String mcc) { + this.mcc = mcc; + return this; + } + + /** + * Sets mnc. + * + * @param mnc Mobile Network Code. (optional) + * @return GetOutboundSmsMessageLogsV3Request + */ + public GetOutboundSmsMessageLogsV3Request mnc(String mnc) { + this.mnc = mnc; + return this; + } /** - * Sets from. + * Sets sender. * - * @param from The sender ID which can be alphanumeric or numeric. (optional) - * @return GetOutboundSmsMessageLogsRequest + * @param sender The sender ID which can be alphanumeric or numeric. (optional) + * @return GetOutboundSmsMessageLogsV3Request */ - public GetOutboundSmsMessageLogsRequest from(String from) { - this.from = from; + public GetOutboundSmsMessageLogsV3Request sender(String sender) { + this.sender = sender; return this; } /** - * Sets to. + * Sets destination. * - * @param to Message destination address. (optional) - * @return GetOutboundSmsMessageLogsRequest + * @param destination Message destination address. (optional) + * @return GetOutboundSmsMessageLogsV3Request */ - public GetOutboundSmsMessageLogsRequest to(String to) { - this.to = to; + public GetOutboundSmsMessageLogsV3Request destination(String destination) { + this.destination = destination; return this; } @@ -385,9 +437,9 @@ public GetOutboundSmsMessageLogsRequest to(String to) { * Sets bulkId. * * @param bulkId Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. May contain multiple comma-separated values. Maximum length 2048 characters. (optional) - * @return GetOutboundSmsMessageLogsRequest + * @return GetOutboundSmsMessageLogsV3Request */ - public GetOutboundSmsMessageLogsRequest bulkId(List bulkId) { + public GetOutboundSmsMessageLogsV3Request bulkId(List bulkId) { this.bulkId = bulkId; return this; } @@ -396,9 +448,9 @@ public GetOutboundSmsMessageLogsRequest bulkId(List bulkId) { * Sets messageId. * * @param messageId Unique message ID for which a log is requested. May contain multiple comma-separated values. Maximum length 2048 characters. (optional) - * @return GetOutboundSmsMessageLogsRequest + * @return GetOutboundSmsMessageLogsV3Request */ - public GetOutboundSmsMessageLogsRequest messageId(List messageId) { + public GetOutboundSmsMessageLogsV3Request messageId(List messageId) { this.messageId = messageId; return this; } @@ -406,10 +458,10 @@ public GetOutboundSmsMessageLogsRequest messageId(List messageId) { /** * Sets generalStatus. * - * @param generalStatus Sent [message status](https://www.infobip.com/docs/essentials/response-status-and-error-codes#api-status-codes). Possible values: `ACCEPTED`, `PENDING`, `UNDELIVERABLE`, `DELIVERED`, `REJECTED`, `EXPIRED`. (optional) - * @return GetOutboundSmsMessageLogsRequest + * @param generalStatus (optional) + * @return GetOutboundSmsMessageLogsV3Request */ - public GetOutboundSmsMessageLogsRequest generalStatus(String generalStatus) { + public GetOutboundSmsMessageLogsV3Request generalStatus(SmsMessageGeneralStatus generalStatus) { this.generalStatus = generalStatus; return this; } @@ -417,10 +469,10 @@ public GetOutboundSmsMessageLogsRequest generalStatus(String generalStatus) { /** * Sets sentSince. * - * @param sentSince The logs will only include messages sent after this date. Use it together with `sentUntil` to return a time range or if you want to fetch more than 1000 logs allowed per call. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. (optional) - * @return GetOutboundSmsMessageLogsRequest + * @param sentSince The logs will only include messages sent after this date. Use it together with sentUntil to return a time range or if you want to fetch more than 1000 logs allowed per call. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. (optional) + * @return GetOutboundSmsMessageLogsV3Request */ - public GetOutboundSmsMessageLogsRequest sentSince(OffsetDateTime sentSince) { + public GetOutboundSmsMessageLogsV3Request sentSince(String sentSince) { this.sentSince = sentSince; return this; } @@ -428,10 +480,10 @@ public GetOutboundSmsMessageLogsRequest sentSince(OffsetDateTime sentSince) { /** * Sets sentUntil. * - * @param sentUntil The logs will only include messages sent before this date. Use it together with `sentBefore` to return a time range or if you want to fetch more than 1000 logs allowed per call. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. (optional) - * @return GetOutboundSmsMessageLogsRequest + * @param sentUntil The logs will only include messages sent before this date. Use it together with sentSince to return a time range or if you want to fetch more than 1000 logs allowed per call. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. (optional) + * @return GetOutboundSmsMessageLogsV3Request */ - public GetOutboundSmsMessageLogsRequest sentUntil(OffsetDateTime sentUntil) { + public GetOutboundSmsMessageLogsV3Request sentUntil(String sentUntil) { this.sentUntil = sentUntil; return this; } @@ -439,33 +491,22 @@ public GetOutboundSmsMessageLogsRequest sentUntil(OffsetDateTime sentUntil) { /** * Sets limit. * - * @param limit Maximum number of messages to include in logs. If not set, the latest 50 records are returned. Maximum limit value is `1000` and you can only access logs for the last 48h. If you want to fetch more than 1000 logs allowed per call, use `sentBefore` and `sentUntil` to retrieve them in pages. (optional) - * @return GetOutboundSmsMessageLogsRequest + * @param limit Maximum number of messages to include in logs. If not set, the latest 50 records are returned. Maximum limit value is 1000 and you can only access logs for the last 48h. If you want to fetch more than 1000 logs allowed per call, use sentBefore and sentUntil to retrieve them in pages. (optional, default to 50) + * @return GetOutboundSmsMessageLogsV3Request */ - public GetOutboundSmsMessageLogsRequest limit(Integer limit) { + public GetOutboundSmsMessageLogsV3Request limit(Integer limit) { this.limit = limit; return this; } /** - * Sets mcc. - * - * @param mcc Mobile Country Code. (optional) - * @return GetOutboundSmsMessageLogsRequest - */ - public GetOutboundSmsMessageLogsRequest mcc(String mcc) { - this.mcc = mcc; - return this; - } - - /** - * Sets mnc. + * Sets entityId. * - * @param mnc Mobile Network Code. (optional) - * @return GetOutboundSmsMessageLogsRequest + * @param entityId Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). (optional) + * @return GetOutboundSmsMessageLogsV3Request */ - public GetOutboundSmsMessageLogsRequest mnc(String mnc) { - this.mnc = mnc; + public GetOutboundSmsMessageLogsV3Request entityId(String entityId) { + this.entityId = entityId; return this; } @@ -473,89 +514,86 @@ public GetOutboundSmsMessageLogsRequest mnc(String mnc) { * Sets applicationId. * * @param applicationId Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). (optional) - * @return GetOutboundSmsMessageLogsRequest + * @return GetOutboundSmsMessageLogsV3Request */ - public GetOutboundSmsMessageLogsRequest applicationId(String applicationId) { + public GetOutboundSmsMessageLogsV3Request applicationId(String applicationId) { this.applicationId = applicationId; return this; } /** - * Sets entityId. + * Sets campaignReferenceId. * - * @param entityId Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). (optional) - * @return GetOutboundSmsMessageLogsRequest + * @param campaignReferenceId ID of a campaign that was sent in the message. May contain multiple comma-separated values. (optional) + * @return GetOutboundSmsMessageLogsV3Request */ - public GetOutboundSmsMessageLogsRequest entityId(String entityId) { - this.entityId = entityId; + public GetOutboundSmsMessageLogsV3Request campaignReferenceId(List campaignReferenceId) { + this.campaignReferenceId = campaignReferenceId; return this; } /** - * Executes the getOutboundSmsMessageLogs request. + * Executes the getOutboundSmsMessageLogsV3 request. * * @return SmsLogsResponse The deserialized response. * @throws ApiException If the API call fails or an error occurs during the request or response processing. - * @deprecated */ - @Deprecated public SmsLogsResponse execute() throws ApiException { - RequestDefinition getOutboundSmsMessageLogsDefinition = getOutboundSmsMessageLogsDefinition( - from, - to, + RequestDefinition getOutboundSmsMessageLogsV3Definition = getOutboundSmsMessageLogsV3Definition( + mcc, + mnc, + sender, + destination, bulkId, messageId, generalStatus, sentSince, sentUntil, limit, - mcc, - mnc, + entityId, applicationId, - entityId); + campaignReferenceId); return apiClient.execute( - getOutboundSmsMessageLogsDefinition, new TypeReference() {}.getType()); + getOutboundSmsMessageLogsV3Definition, new TypeReference() {}.getType()); } /** - * Executes the getOutboundSmsMessageLogs request asynchronously. + * Executes the getOutboundSmsMessageLogsV3 request asynchronously. * * @param callback The {@link ApiCallback} to be invoked. * @return The {@link okhttp3.Call} associated with the API request. - * @deprecated */ - @Deprecated public okhttp3.Call executeAsync(ApiCallback callback) { - RequestDefinition getOutboundSmsMessageLogsDefinition = getOutboundSmsMessageLogsDefinition( - from, - to, + RequestDefinition getOutboundSmsMessageLogsV3Definition = getOutboundSmsMessageLogsV3Definition( + mcc, + mnc, + sender, + destination, bulkId, messageId, generalStatus, sentSince, sentUntil, limit, - mcc, - mnc, + entityId, applicationId, - entityId); + campaignReferenceId); return apiClient.executeAsync( - getOutboundSmsMessageLogsDefinition, new TypeReference() {}.getType(), callback); + getOutboundSmsMessageLogsV3Definition, new TypeReference() {}.getType(), callback); } } /** * Get outbound SMS message logs. *

- * Use this method for displaying logs for example in the user interface. Available are the logs for the last 48 hours and you can only retrieve maximum of 1000 logs per call. See [message delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) if your use case is to verify message delivery.\\ Although this endpoint remains functional, starting from May 16, 2024., we recommend transitioning to the new endpoint provided at [Get outbound SMS message delivery reports](#channels/sms/get-outbound-sms-message-logs-v3) for improved support and future updates. + * Use this method for displaying logs, for example, in the user interface. Available are the logs for the last 48 hours and you can only retrieve maximum of 1000 logs per call. See [message delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports-v3) if your use case is to verify message delivery. * - * @return GetOutboundSmsMessageLogsRequest - * @deprecated - * @see Learn more about SMS channel and use cases + * @return GetOutboundSmsMessageLogsV3Request + * @see Learn more about the SMS channel and its use cases */ - @Deprecated - public GetOutboundSmsMessageLogsRequest getOutboundSmsMessageLogs() { - return new GetOutboundSmsMessageLogsRequest(); + @Beta + public GetOutboundSmsMessageLogsV3Request getOutboundSmsMessageLogsV3() { + return new GetOutboundSmsMessageLogsV3Request(); } private RequestDefinition getScheduledSmsMessagesDefinition(String bulkId) { @@ -801,9 +839,9 @@ public RescheduleSmsMessagesRequest rescheduleSmsMessages(String bulkId, SmsBulk return new RescheduleSmsMessagesRequest(bulkId, smsBulkRequest); } - private RequestDefinition sendBinarySmsMessageDefinition(SmsAdvancedBinaryRequest smsAdvancedBinaryRequest) { - RequestDefinition.Builder builder = RequestDefinition.builder("POST", "/sms/2/binary/advanced") - .body(smsAdvancedBinaryRequest) + private RequestDefinition sendSmsMessagesDefinition(SmsRequestEnvelope smsRequestEnvelope) { + RequestDefinition.Builder builder = RequestDefinition.builder("POST", "/sms/3/messages") + .body(smsRequestEnvelope) .requiresAuthentication(true) .accept("application/json") .contentType("application/json"); @@ -812,109 +850,52 @@ private RequestDefinition sendBinarySmsMessageDefinition(SmsAdvancedBinaryReques } /** - * sendBinarySmsMessage request builder class. + * sendSmsMessages request builder class. */ - public class SendBinarySmsMessageRequest { - private final SmsAdvancedBinaryRequest smsAdvancedBinaryRequest; + public class SendSmsMessagesRequest { + private final SmsRequestEnvelope smsRequestEnvelope; - private SendBinarySmsMessageRequest(SmsAdvancedBinaryRequest smsAdvancedBinaryRequest) { - this.smsAdvancedBinaryRequest = Objects.requireNonNull( - smsAdvancedBinaryRequest, "The required parameter 'smsAdvancedBinaryRequest' is missing."); + private SendSmsMessagesRequest(SmsRequestEnvelope smsRequestEnvelope) { + this.smsRequestEnvelope = Objects.requireNonNull( + smsRequestEnvelope, "The required parameter 'smsRequestEnvelope' is missing."); } /** - * Executes the sendBinarySmsMessage request. + * Executes the sendSmsMessages request. * * @return SmsResponse The deserialized response. * @throws ApiException If the API call fails or an error occurs during the request or response processing. */ public SmsResponse execute() throws ApiException { - RequestDefinition sendBinarySmsMessageDefinition = sendBinarySmsMessageDefinition(smsAdvancedBinaryRequest); - return apiClient.execute(sendBinarySmsMessageDefinition, new TypeReference() {}.getType()); + RequestDefinition sendSmsMessagesDefinition = sendSmsMessagesDefinition(smsRequestEnvelope); + return apiClient.execute(sendSmsMessagesDefinition, new TypeReference() {}.getType()); } /** - * Executes the sendBinarySmsMessage request asynchronously. + * Executes the sendSmsMessages request asynchronously. * * @param callback The {@link ApiCallback} to be invoked. * @return The {@link okhttp3.Call} associated with the API request. */ public okhttp3.Call executeAsync(ApiCallback callback) { - RequestDefinition sendBinarySmsMessageDefinition = sendBinarySmsMessageDefinition(smsAdvancedBinaryRequest); + RequestDefinition sendSmsMessagesDefinition = sendSmsMessagesDefinition(smsRequestEnvelope); return apiClient.executeAsync( - sendBinarySmsMessageDefinition, new TypeReference() {}.getType(), callback); - } - } - - /** - * Send binary SMS message. - *

- * Send single or multiple binary messages to one or more destination address. The API response will not contain the final delivery status, use [Delivery Reports](https://www.infobip.com/docs/api/channels/sms/sms-messaging/logs-and-status-reports/receive-outbound-sms-message-report) instead.\\ In light of improved features, this endpoint has been superseded. Please visit [Send SMS message](#channels/sms/send-sms-messages) for the next version. - * - * @param smsAdvancedBinaryRequest (required) - * @return SendBinarySmsMessageRequest - * @see Learn more about SMS channel and use cases - */ - public SendBinarySmsMessageRequest sendBinarySmsMessage(SmsAdvancedBinaryRequest smsAdvancedBinaryRequest) { - return new SendBinarySmsMessageRequest(smsAdvancedBinaryRequest); - } - - private RequestDefinition sendSmsMessageDefinition(SmsAdvancedTextualRequest smsAdvancedTextualRequest) { - RequestDefinition.Builder builder = RequestDefinition.builder("POST", "/sms/2/text/advanced") - .body(smsAdvancedTextualRequest) - .requiresAuthentication(true) - .accept("application/json") - .contentType("application/json"); - - return builder.build(); - } - - /** - * sendSmsMessage request builder class. - */ - public class SendSmsMessageRequest { - private final SmsAdvancedTextualRequest smsAdvancedTextualRequest; - - private SendSmsMessageRequest(SmsAdvancedTextualRequest smsAdvancedTextualRequest) { - this.smsAdvancedTextualRequest = Objects.requireNonNull( - smsAdvancedTextualRequest, "The required parameter 'smsAdvancedTextualRequest' is missing."); - } - - /** - * Executes the sendSmsMessage request. - * - * @return SmsResponse The deserialized response. - * @throws ApiException If the API call fails or an error occurs during the request or response processing. - */ - public SmsResponse execute() throws ApiException { - RequestDefinition sendSmsMessageDefinition = sendSmsMessageDefinition(smsAdvancedTextualRequest); - return apiClient.execute(sendSmsMessageDefinition, new TypeReference() {}.getType()); - } - - /** - * Executes the sendSmsMessage request asynchronously. - * - * @param callback The {@link ApiCallback} to be invoked. - * @return The {@link okhttp3.Call} associated with the API request. - */ - public okhttp3.Call executeAsync(ApiCallback callback) { - RequestDefinition sendSmsMessageDefinition = sendSmsMessageDefinition(smsAdvancedTextualRequest); - return apiClient.executeAsync( - sendSmsMessageDefinition, new TypeReference() {}.getType(), callback); + sendSmsMessagesDefinition, new TypeReference() {}.getType(), callback); } } /** * Send SMS message. *

- * Use this endpoint to send an SMS and set up a rich set of features, such as batch sending with a single API request, scheduling, URL tracking, language and transliteration configuration, etc. The API response will not contain the final delivery status, use [Delivery Reports](https://www.infobip.com/docs/api/channels/sms/sms-messaging/logs-and-status-reports/receive-outbound-sms-message-report) instead.\\ In light of improved features, this endpoint has been superseded. Please visit [Send SMS message](#channels/sms/send-sms-messages) for the next version. + * With this API method, you can do anything from sending a basic message to one person, all the way to sending customized messages to thousands of recipients in one go. It comes with a range of useful features like transliteration, scheduling, and tracking in a unified way.\\ If utilizing Message Delivery Reports webhook, please consult the documentation provided at [Receive outbound SMS message reports](#channels/sms/receive-outbound-sms-message-report-v3).\\ This endpoint is the successor of [Send SMS message](#channels/sms/send-sms-message) and [Send binary SMS message](#channels/sms/send-binary-sms-message). * - * @param smsAdvancedTextualRequest (required) - * @return SendSmsMessageRequest - * @see Learn more about SMS channel and use cases + * @param smsRequestEnvelope (required) + * @return SendSmsMessagesRequest + * @see Learn more about the SMS channel and its use cases */ - public SendSmsMessageRequest sendSmsMessage(SmsAdvancedTextualRequest smsAdvancedTextualRequest) { - return new SendSmsMessageRequest(smsAdvancedTextualRequest); + @Beta + public SendSmsMessagesRequest sendSmsMessages(SmsRequestEnvelope smsRequestEnvelope) { + return new SendSmsMessagesRequest(smsRequestEnvelope); } private RequestDefinition updateScheduledSmsMessagesStatusDefinition( diff --git a/src/main/java/com/infobip/model/CallRoutingAllowedTimeFrom.java b/src/main/java/com/infobip/model/CallRoutingAllowedTimeFrom.java deleted file mode 100644 index 1e0832d..0000000 --- a/src/main/java/com/infobip/model/CallRoutingAllowedTimeFrom.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Objects; - -/** - * The exact time of day to enable call forwarding. Time is expressed in the `UTC` time zone. If not set, defaults to `00:00:00`. - */ -public class CallRoutingAllowedTimeFrom { - - private Integer hour; - - private Integer minute; - - /** - * Sets hour. - *

- * Field description: - * Hour when the time window opens. - *

- * The field is required. - * - * @param hour - * @return This {@link CallRoutingAllowedTimeFrom instance}. - */ - public CallRoutingAllowedTimeFrom hour(Integer hour) { - this.hour = hour; - return this; - } - - /** - * Returns hour. - *

- * Field description: - * Hour when the time window opens. - *

- * The field is required. - * - * @return hour - */ - @JsonProperty("hour") - public Integer getHour() { - return hour; - } - - /** - * Sets hour. - *

- * Field description: - * Hour when the time window opens. - *

- * The field is required. - * - * @param hour - */ - @JsonProperty("hour") - public void setHour(Integer hour) { - this.hour = hour; - } - - /** - * Sets minute. - *

- * Field description: - * Minute when the time window opens. - *

- * The field is required. - * - * @param minute - * @return This {@link CallRoutingAllowedTimeFrom instance}. - */ - public CallRoutingAllowedTimeFrom minute(Integer minute) { - this.minute = minute; - return this; - } - - /** - * Returns minute. - *

- * Field description: - * Minute when the time window opens. - *

- * The field is required. - * - * @return minute - */ - @JsonProperty("minute") - public Integer getMinute() { - return minute; - } - - /** - * Sets minute. - *

- * Field description: - * Minute when the time window opens. - *

- * The field is required. - * - * @param minute - */ - @JsonProperty("minute") - public void setMinute(Integer minute) { - this.minute = minute; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CallRoutingAllowedTimeFrom callRoutingAllowedTimeFrom = (CallRoutingAllowedTimeFrom) o; - return Objects.equals(this.hour, callRoutingAllowedTimeFrom.hour) - && Objects.equals(this.minute, callRoutingAllowedTimeFrom.minute); - } - - @Override - public int hashCode() { - return Objects.hash(hour, minute); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class CallRoutingAllowedTimeFrom {") - .append(newLine) - .append(" hour: ") - .append(toIndentedString(hour)) - .append(newLine) - .append(" minute: ") - .append(toIndentedString(minute)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/CallRoutingAllowedTimeTo.java b/src/main/java/com/infobip/model/CallRoutingAllowedTimeTo.java deleted file mode 100644 index a4d2149..0000000 --- a/src/main/java/com/infobip/model/CallRoutingAllowedTimeTo.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Objects; - -/** - * The exact time of day to end call forwarding. Time is expressed in the `UTC` time zone. If not set, defaults to `23:59:59`. - */ -public class CallRoutingAllowedTimeTo { - - private Integer hour; - - private Integer minute; - - /** - * Sets hour. - *

- * Field description: - * Hour when the time window closes. - *

- * The field is required. - * - * @param hour - * @return This {@link CallRoutingAllowedTimeTo instance}. - */ - public CallRoutingAllowedTimeTo hour(Integer hour) { - this.hour = hour; - return this; - } - - /** - * Returns hour. - *

- * Field description: - * Hour when the time window closes. - *

- * The field is required. - * - * @return hour - */ - @JsonProperty("hour") - public Integer getHour() { - return hour; - } - - /** - * Sets hour. - *

- * Field description: - * Hour when the time window closes. - *

- * The field is required. - * - * @param hour - */ - @JsonProperty("hour") - public void setHour(Integer hour) { - this.hour = hour; - } - - /** - * Sets minute. - *

- * Field description: - * Minute when the time window closes. - *

- * The field is required. - * - * @param minute - * @return This {@link CallRoutingAllowedTimeTo instance}. - */ - public CallRoutingAllowedTimeTo minute(Integer minute) { - this.minute = minute; - return this; - } - - /** - * Returns minute. - *

- * Field description: - * Minute when the time window closes. - *

- * The field is required. - * - * @return minute - */ - @JsonProperty("minute") - public Integer getMinute() { - return minute; - } - - /** - * Sets minute. - *

- * Field description: - * Minute when the time window closes. - *

- * The field is required. - * - * @param minute - */ - @JsonProperty("minute") - public void setMinute(Integer minute) { - this.minute = minute; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CallRoutingAllowedTimeTo callRoutingAllowedTimeTo = (CallRoutingAllowedTimeTo) o; - return Objects.equals(this.hour, callRoutingAllowedTimeTo.hour) - && Objects.equals(this.minute, callRoutingAllowedTimeTo.minute); - } - - @Override - public int hashCode() { - return Objects.hash(hour, minute); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class CallRoutingAllowedTimeTo {") - .append(newLine) - .append(" hour: ") - .append(toIndentedString(hour)) - .append(newLine) - .append(" minute: ") - .append(toIndentedString(minute)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/CallRoutingAllowedTimeWindow.java b/src/main/java/com/infobip/model/CallRoutingAllowedTimeWindow.java deleted file mode 100644 index 1a3189f..0000000 --- a/src/main/java/com/infobip/model/CallRoutingAllowedTimeWindow.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * Sets specific delivery windows outside of which calls won't be forwarded to the destination. If defined, call forwarding is allowed only if any time window in array is satisfied. - */ -public class CallRoutingAllowedTimeWindow { - - private CallRoutingAllowedTimeFrom from; - - private CallRoutingAllowedTimeTo to; - - private List days = null; - - /** - * Sets from. - * - * @param from - * @return This {@link CallRoutingAllowedTimeWindow instance}. - */ - public CallRoutingAllowedTimeWindow from(CallRoutingAllowedTimeFrom from) { - this.from = from; - return this; - } - - /** - * Returns from. - * - * @return from - */ - @JsonProperty("from") - public CallRoutingAllowedTimeFrom getFrom() { - return from; - } - - /** - * Sets from. - * - * @param from - */ - @JsonProperty("from") - public void setFrom(CallRoutingAllowedTimeFrom from) { - this.from = from; - } - - /** - * Sets to. - * - * @param to - * @return This {@link CallRoutingAllowedTimeWindow instance}. - */ - public CallRoutingAllowedTimeWindow to(CallRoutingAllowedTimeTo to) { - this.to = to; - return this; - } - - /** - * Returns to. - * - * @return to - */ - @JsonProperty("to") - public CallRoutingAllowedTimeTo getTo() { - return to; - } - - /** - * Sets to. - * - * @param to - */ - @JsonProperty("to") - public void setTo(CallRoutingAllowedTimeTo to) { - this.to = to; - } - - /** - * Sets days. - *

- * Field description: - * Days for which to apply the `from` and `to` properties. If not set, defaults to all days. - * - * @param days - * @return This {@link CallRoutingAllowedTimeWindow instance}. - */ - public CallRoutingAllowedTimeWindow days(List days) { - this.days = days; - return this; - } - - /** - * Adds and item into days. - *

- * Field description: - * Days for which to apply the `from` and `to` properties. If not set, defaults to all days. - * - * @param daysItem The item to be added to the list. - * @return This {@link CallRoutingAllowedTimeWindow instance}. - */ - public CallRoutingAllowedTimeWindow addDaysItem(CallRoutingAllowedDay daysItem) { - if (this.days == null) { - this.days = new ArrayList<>(); - } - this.days.add(daysItem); - return this; - } - - /** - * Returns days. - *

- * Field description: - * Days for which to apply the `from` and `to` properties. If not set, defaults to all days. - * - * @return days - */ - @JsonProperty("days") - public List getDays() { - return days; - } - - /** - * Sets days. - *

- * Field description: - * Days for which to apply the `from` and `to` properties. If not set, defaults to all days. - * - * @param days - */ - @JsonProperty("days") - public void setDays(List days) { - this.days = days; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CallRoutingAllowedTimeWindow callRoutingAllowedTimeWindow = (CallRoutingAllowedTimeWindow) o; - return Objects.equals(this.from, callRoutingAllowedTimeWindow.from) - && Objects.equals(this.to, callRoutingAllowedTimeWindow.to) - && Objects.equals(this.days, callRoutingAllowedTimeWindow.days); - } - - @Override - public int hashCode() { - return Objects.hash(from, to, days); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class CallRoutingAllowedTimeWindow {") - .append(newLine) - .append(" from: ") - .append(toIndentedString(from)) - .append(newLine) - .append(" to: ") - .append(toIndentedString(to)) - .append(newLine) - .append(" days: ") - .append(toIndentedString(days)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/CallRoutingEndpointDestination.java b/src/main/java/com/infobip/model/CallRoutingEndpointDestination.java index 21ce6f8..6390719 100644 --- a/src/main/java/com/infobip/model/CallRoutingEndpointDestination.java +++ b/src/main/java/com/infobip/model/CallRoutingEndpointDestination.java @@ -29,7 +29,7 @@ public class CallRoutingEndpointDestination extends CallRoutingDestination { private CallRoutingRecording recording; - private List allowedTimeWindows = null; + private List allowedTimeWindows = null; /** * Constructs a new {@link CallRoutingEndpointDestination} instance. @@ -235,7 +235,7 @@ public void setRecording(CallRoutingRecording recording) { * @param allowedTimeWindows * @return This {@link CallRoutingEndpointDestination instance}. */ - public CallRoutingEndpointDestination allowedTimeWindows(List allowedTimeWindows) { + public CallRoutingEndpointDestination allowedTimeWindows(List allowedTimeWindows) { this.allowedTimeWindows = allowedTimeWindows; return this; } @@ -249,8 +249,7 @@ public CallRoutingEndpointDestination allowedTimeWindows(List(); } @@ -267,7 +266,7 @@ public CallRoutingEndpointDestination addAllowedTimeWindowsItem( * @return allowedTimeWindows */ @JsonProperty("allowedTimeWindows") - public List getAllowedTimeWindows() { + public List getAllowedTimeWindows() { return allowedTimeWindows; } @@ -280,7 +279,7 @@ public List getAllowedTimeWindows() { * @param allowedTimeWindows */ @JsonProperty("allowedTimeWindows") - public void setAllowedTimeWindows(List allowedTimeWindows) { + public void setAllowedTimeWindows(List allowedTimeWindows) { this.allowedTimeWindows = allowedTimeWindows; } diff --git a/src/main/java/com/infobip/model/CallsAdvancedMessage.java b/src/main/java/com/infobip/model/CallsAdvancedMessage.java index 5e28e8c..57b2f87 100644 --- a/src/main/java/com/infobip/model/CallsAdvancedMessage.java +++ b/src/main/java/com/infobip/model/CallsAdvancedMessage.java @@ -28,7 +28,7 @@ public class CallsAdvancedMessage { private String callbackData; - private CallsDeliveryTimeWindow deliveryTimeWindow; + private DeliveryTimeWindow deliveryTimeWindow; private List destinations = new ArrayList<>(); @@ -211,7 +211,7 @@ public void setCallTransfers(List callTransfers) { * Sets callbackData. *

* Field description: - * Additional client's data that will be sent on the notifyUrl. The maximum value is 200 characters. Example: `Text containing some additional data needed in Delivery Report`. + * Additional client's data that will be sent on the notifyUrl. The maximum value is 700 characters. Example: `Text containing some additional data needed in Delivery Report`. * * @param callbackData * @return This {@link CallsAdvancedMessage instance}. @@ -225,7 +225,7 @@ public CallsAdvancedMessage callbackData(String callbackData) { * Returns callbackData. *

* Field description: - * Additional client's data that will be sent on the notifyUrl. The maximum value is 200 characters. Example: `Text containing some additional data needed in Delivery Report`. + * Additional client's data that will be sent on the notifyUrl. The maximum value is 700 characters. Example: `Text containing some additional data needed in Delivery Report`. * * @return callbackData */ @@ -238,7 +238,7 @@ public String getCallbackData() { * Sets callbackData. *

* Field description: - * Additional client's data that will be sent on the notifyUrl. The maximum value is 200 characters. Example: `Text containing some additional data needed in Delivery Report`. + * Additional client's data that will be sent on the notifyUrl. The maximum value is 700 characters. Example: `Text containing some additional data needed in Delivery Report`. * * @param callbackData */ @@ -253,7 +253,7 @@ public void setCallbackData(String callbackData) { * @param deliveryTimeWindow * @return This {@link CallsAdvancedMessage instance}. */ - public CallsAdvancedMessage deliveryTimeWindow(CallsDeliveryTimeWindow deliveryTimeWindow) { + public CallsAdvancedMessage deliveryTimeWindow(DeliveryTimeWindow deliveryTimeWindow) { this.deliveryTimeWindow = deliveryTimeWindow; return this; } @@ -264,7 +264,7 @@ public CallsAdvancedMessage deliveryTimeWindow(CallsDeliveryTimeWindow deliveryT * @return deliveryTimeWindow */ @JsonProperty("deliveryTimeWindow") - public CallsDeliveryTimeWindow getDeliveryTimeWindow() { + public DeliveryTimeWindow getDeliveryTimeWindow() { return deliveryTimeWindow; } @@ -274,7 +274,7 @@ public CallsDeliveryTimeWindow getDeliveryTimeWindow() { * @param deliveryTimeWindow */ @JsonProperty("deliveryTimeWindow") - public void setDeliveryTimeWindow(CallsDeliveryTimeWindow deliveryTimeWindow) { + public void setDeliveryTimeWindow(DeliveryTimeWindow deliveryTimeWindow) { this.deliveryTimeWindow = deliveryTimeWindow; } diff --git a/src/main/java/com/infobip/model/CallsClickToCallMessage.java b/src/main/java/com/infobip/model/CallsClickToCallMessage.java index 440b982..8273dca 100644 --- a/src/main/java/com/infobip/model/CallsClickToCallMessage.java +++ b/src/main/java/com/infobip/model/CallsClickToCallMessage.java @@ -21,7 +21,7 @@ public class CallsClickToCallMessage { private String audioFileUrl; - private CallsDeliveryTimeWindow deliveryTimeWindow; + private DeliveryTimeWindow deliveryTimeWindow; private String destinationA; @@ -139,7 +139,7 @@ public void setAudioFileUrl(String audioFileUrl) { * @param deliveryTimeWindow * @return This {@link CallsClickToCallMessage instance}. */ - public CallsClickToCallMessage deliveryTimeWindow(CallsDeliveryTimeWindow deliveryTimeWindow) { + public CallsClickToCallMessage deliveryTimeWindow(DeliveryTimeWindow deliveryTimeWindow) { this.deliveryTimeWindow = deliveryTimeWindow; return this; } @@ -150,7 +150,7 @@ public CallsClickToCallMessage deliveryTimeWindow(CallsDeliveryTimeWindow delive * @return deliveryTimeWindow */ @JsonProperty("deliveryTimeWindow") - public CallsDeliveryTimeWindow getDeliveryTimeWindow() { + public DeliveryTimeWindow getDeliveryTimeWindow() { return deliveryTimeWindow; } @@ -160,7 +160,7 @@ public CallsDeliveryTimeWindow getDeliveryTimeWindow() { * @param deliveryTimeWindow */ @JsonProperty("deliveryTimeWindow") - public void setDeliveryTimeWindow(CallsDeliveryTimeWindow deliveryTimeWindow) { + public void setDeliveryTimeWindow(DeliveryTimeWindow deliveryTimeWindow) { this.deliveryTimeWindow = deliveryTimeWindow; } diff --git a/src/main/java/com/infobip/model/CallsDeliveryTime.java b/src/main/java/com/infobip/model/CallsDeliveryTime.java deleted file mode 100644 index 3dd22fa..0000000 --- a/src/main/java/com/infobip/model/CallsDeliveryTime.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Objects; - -/** - * Represents CallsDeliveryTime model. - */ -public class CallsDeliveryTime { - - private Integer hour; - - private Integer minute; - - /** - * Sets hour. - * - * @param hour - * @return This {@link CallsDeliveryTime instance}. - */ - public CallsDeliveryTime hour(Integer hour) { - this.hour = hour; - return this; - } - - /** - * Returns hour. - * - * @return hour - */ - @JsonProperty("hour") - public Integer getHour() { - return hour; - } - - /** - * Sets hour. - * - * @param hour - */ - @JsonProperty("hour") - public void setHour(Integer hour) { - this.hour = hour; - } - - /** - * Sets minute. - * - * @param minute - * @return This {@link CallsDeliveryTime instance}. - */ - public CallsDeliveryTime minute(Integer minute) { - this.minute = minute; - return this; - } - - /** - * Returns minute. - * - * @return minute - */ - @JsonProperty("minute") - public Integer getMinute() { - return minute; - } - - /** - * Sets minute. - * - * @param minute - */ - @JsonProperty("minute") - public void setMinute(Integer minute) { - this.minute = minute; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CallsDeliveryTime callsDeliveryTime = (CallsDeliveryTime) o; - return Objects.equals(this.hour, callsDeliveryTime.hour) - && Objects.equals(this.minute, callsDeliveryTime.minute); - } - - @Override - public int hashCode() { - return Objects.hash(hour, minute); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class CallsDeliveryTime {") - .append(newLine) - .append(" hour: ") - .append(toIndentedString(hour)) - .append(newLine) - .append(" minute: ") - .append(toIndentedString(minute)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/CallsDeliveryTimeWindow.java b/src/main/java/com/infobip/model/CallsDeliveryTimeWindow.java deleted file mode 100644 index 3954f44..0000000 --- a/src/main/java/com/infobip/model/CallsDeliveryTimeWindow.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashSet; -import java.util.Objects; -import java.util.Set; - -/** - * Scheduling object that allows setting up detailed time windows in which the message can be sent. Consists of from, to and days properties. Days property is mandatory. Days in the week are written as their full names: Monday-Sunday. Days parameter must be populated as a list, between two square brackets. `Example: ['MONDAY', 'TUESDAY', 'WEDNESDAY']`. From and to properties should be either both included, to allow finer time window granulation or both omitted, to include whole days in the delivery time window. From and to parameters are objects, that consist of hour and minute fields that hold integer values. For example, ` from: [ hour: 15, minute:45 ]`. For complete json, please check out our example. Note: delivery time window is set in UTC timezone. - */ -public class CallsDeliveryTimeWindow { - - private Set days = null; - - private CallsDeliveryTime from; - - private CallsDeliveryTime to; - - /** - * Sets days. - * - * @param days - * @return This {@link CallsDeliveryTimeWindow instance}. - */ - public CallsDeliveryTimeWindow days(Set days) { - this.days = days; - return this; - } - - /** - * Adds and item into days. - * - * @param daysItem The item to be added to the list. - * @return This {@link CallsDeliveryTimeWindow instance}. - */ - public CallsDeliveryTimeWindow addDaysItem(CallsDeliveryDay daysItem) { - if (this.days == null) { - this.days = new LinkedHashSet<>(); - } - this.days.add(daysItem); - return this; - } - - /** - * Returns days. - * - * @return days - */ - @JsonProperty("days") - public Set getDays() { - return days; - } - - /** - * Sets days. - * - * @param days - */ - @JsonProperty("days") - public void setDays(Set days) { - this.days = days; - } - - /** - * Sets from. - *

- * The field is required. - * - * @param from - * @return This {@link CallsDeliveryTimeWindow instance}. - */ - public CallsDeliveryTimeWindow from(CallsDeliveryTime from) { - this.from = from; - return this; - } - - /** - * Returns from. - *

- * The field is required. - * - * @return from - */ - @JsonProperty("from") - public CallsDeliveryTime getFrom() { - return from; - } - - /** - * Sets from. - *

- * The field is required. - * - * @param from - */ - @JsonProperty("from") - public void setFrom(CallsDeliveryTime from) { - this.from = from; - } - - /** - * Sets to. - *

- * The field is required. - * - * @param to - * @return This {@link CallsDeliveryTimeWindow instance}. - */ - public CallsDeliveryTimeWindow to(CallsDeliveryTime to) { - this.to = to; - return this; - } - - /** - * Returns to. - *

- * The field is required. - * - * @return to - */ - @JsonProperty("to") - public CallsDeliveryTime getTo() { - return to; - } - - /** - * Sets to. - *

- * The field is required. - * - * @param to - */ - @JsonProperty("to") - public void setTo(CallsDeliveryTime to) { - this.to = to; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CallsDeliveryTimeWindow callsDeliveryTimeWindow = (CallsDeliveryTimeWindow) o; - return Objects.equals(this.days, callsDeliveryTimeWindow.days) - && Objects.equals(this.from, callsDeliveryTimeWindow.from) - && Objects.equals(this.to, callsDeliveryTimeWindow.to); - } - - @Override - public int hashCode() { - return Objects.hash(days, from, to); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class CallsDeliveryTimeWindow {") - .append(newLine) - .append(" days: ") - .append(toIndentedString(days)) - .append(newLine) - .append(" from: ") - .append(toIndentedString(from)) - .append(newLine) - .append(" to: ") - .append(toIndentedString(to)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/CallsSchedulingOptions.java b/src/main/java/com/infobip/model/CallsSchedulingOptions.java index 8ddf9f3..780c965 100644 --- a/src/main/java/com/infobip/model/CallsSchedulingOptions.java +++ b/src/main/java/com/infobip/model/CallsSchedulingOptions.java @@ -20,7 +20,7 @@ public class CallsSchedulingOptions { private OffsetDateTime startTime; - private CallsTimeWindow callingTimeWindow; + private DeliveryTimeWindow callingTimeWindow; /** * Sets startTime. @@ -68,7 +68,7 @@ public void setStartTime(OffsetDateTime startTime) { * @param callingTimeWindow * @return This {@link CallsSchedulingOptions instance}. */ - public CallsSchedulingOptions callingTimeWindow(CallsTimeWindow callingTimeWindow) { + public CallsSchedulingOptions callingTimeWindow(DeliveryTimeWindow callingTimeWindow) { this.callingTimeWindow = callingTimeWindow; return this; } @@ -79,7 +79,7 @@ public CallsSchedulingOptions callingTimeWindow(CallsTimeWindow callingTimeWindo * @return callingTimeWindow */ @JsonProperty("callingTimeWindow") - public CallsTimeWindow getCallingTimeWindow() { + public DeliveryTimeWindow getCallingTimeWindow() { return callingTimeWindow; } @@ -89,7 +89,7 @@ public CallsTimeWindow getCallingTimeWindow() { * @param callingTimeWindow */ @JsonProperty("callingTimeWindow") - public void setCallingTimeWindow(CallsTimeWindow callingTimeWindow) { + public void setCallingTimeWindow(DeliveryTimeWindow callingTimeWindow) { this.callingTimeWindow = callingTimeWindow; } diff --git a/src/main/java/com/infobip/model/CallsTimeWindow.java b/src/main/java/com/infobip/model/CallsTimeWindow.java deleted file mode 100644 index 13b7559..0000000 --- a/src/main/java/com/infobip/model/CallsTimeWindow.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * Defines a scheduling object that allows setting up a detailed time window in which calls can be established. Consists of from, to and days properties. Days property is mandatory. - */ -public class CallsTimeWindow { - - private CallsTimeWindowPoint from; - - private CallsTimeWindowPoint to; - - /** - * Days when scheduling call establishment will be attempted. - */ - public enum DaysEnum { - MONDAY("MONDAY"), - TUESDAY("TUESDAY"), - WEDNESDAY("WEDNESDAY"), - THURSDAY("THURSDAY"), - FRIDAY("FRIDAY"), - SATURDAY("SATURDAY"), - SUNDAY("SUNDAY"); - - private String value; - - DaysEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static DaysEnum fromValue(String value) { - for (DaysEnum enumElement : DaysEnum.values()) { - if (enumElement.value.equals(value)) { - return enumElement; - } - } - throw new IllegalArgumentException("Unexpected enum value '" + value + "'."); - } - } - - private List days = new ArrayList<>(); - - /** - * Sets from. - * - * @param from - * @return This {@link CallsTimeWindow instance}. - */ - public CallsTimeWindow from(CallsTimeWindowPoint from) { - this.from = from; - return this; - } - - /** - * Returns from. - * - * @return from - */ - @JsonProperty("from") - public CallsTimeWindowPoint getFrom() { - return from; - } - - /** - * Sets from. - * - * @param from - */ - @JsonProperty("from") - public void setFrom(CallsTimeWindowPoint from) { - this.from = from; - } - - /** - * Sets to. - * - * @param to - * @return This {@link CallsTimeWindow instance}. - */ - public CallsTimeWindow to(CallsTimeWindowPoint to) { - this.to = to; - return this; - } - - /** - * Returns to. - * - * @return to - */ - @JsonProperty("to") - public CallsTimeWindowPoint getTo() { - return to; - } - - /** - * Sets to. - * - * @param to - */ - @JsonProperty("to") - public void setTo(CallsTimeWindowPoint to) { - this.to = to; - } - - /** - * Sets days. - *

- * Field description: - * Days when scheduling call establishment will be attempted. - *

- * The field is required. - * - * @param days - * @return This {@link CallsTimeWindow instance}. - */ - public CallsTimeWindow days(List days) { - this.days = days; - return this; - } - - /** - * Adds and item into days. - *

- * Field description: - * Days when scheduling call establishment will be attempted. - *

- * The field is required. - * - * @param daysItem The item to be added to the list. - * @return This {@link CallsTimeWindow instance}. - */ - public CallsTimeWindow addDaysItem(DaysEnum daysItem) { - if (this.days == null) { - this.days = new ArrayList<>(); - } - this.days.add(daysItem); - return this; - } - - /** - * Returns days. - *

- * Field description: - * Days when scheduling call establishment will be attempted. - *

- * The field is required. - * - * @return days - */ - @JsonProperty("days") - public List getDays() { - return days; - } - - /** - * Sets days. - *

- * Field description: - * Days when scheduling call establishment will be attempted. - *

- * The field is required. - * - * @param days - */ - @JsonProperty("days") - public void setDays(List days) { - this.days = days; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CallsTimeWindow callsTimeWindow = (CallsTimeWindow) o; - return Objects.equals(this.from, callsTimeWindow.from) - && Objects.equals(this.to, callsTimeWindow.to) - && Objects.equals(this.days, callsTimeWindow.days); - } - - @Override - public int hashCode() { - return Objects.hash(from, to, days); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class CallsTimeWindow {") - .append(newLine) - .append(" from: ") - .append(toIndentedString(from)) - .append(newLine) - .append(" to: ") - .append(toIndentedString(to)) - .append(newLine) - .append(" days: ") - .append(toIndentedString(days)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/CallsTimeWindowPoint.java b/src/main/java/com/infobip/model/CallsTimeWindowPoint.java deleted file mode 100644 index cc4a9a8..0000000 --- a/src/main/java/com/infobip/model/CallsTimeWindowPoint.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Objects; - -/** - * Call establishment attempt end time. - */ -public class CallsTimeWindowPoint { - - private Integer hour; - - private Integer minute; - - /** - * Sets hour. - * - * @param hour - * @return This {@link CallsTimeWindowPoint instance}. - */ - public CallsTimeWindowPoint hour(Integer hour) { - this.hour = hour; - return this; - } - - /** - * Returns hour. - * - * @return hour - */ - @JsonProperty("hour") - public Integer getHour() { - return hour; - } - - /** - * Sets hour. - * - * @param hour - */ - @JsonProperty("hour") - public void setHour(Integer hour) { - this.hour = hour; - } - - /** - * Sets minute. - * - * @param minute - * @return This {@link CallsTimeWindowPoint instance}. - */ - public CallsTimeWindowPoint minute(Integer minute) { - this.minute = minute; - return this; - } - - /** - * Returns minute. - * - * @return minute - */ - @JsonProperty("minute") - public Integer getMinute() { - return minute; - } - - /** - * Sets minute. - * - * @param minute - */ - @JsonProperty("minute") - public void setMinute(Integer minute) { - this.minute = minute; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CallsTimeWindowPoint callsTimeWindowPoint = (CallsTimeWindowPoint) o; - return Objects.equals(this.hour, callsTimeWindowPoint.hour) - && Objects.equals(this.minute, callsTimeWindowPoint.minute); - } - - @Override - public int hashCode() { - return Objects.hash(hour, minute); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class CallsTimeWindowPoint {") - .append(newLine) - .append(" hour: ") - .append(toIndentedString(hour)) - .append(newLine) - .append(" minute: ") - .append(toIndentedString(minute)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/SmsDeliveryDay.java b/src/main/java/com/infobip/model/DeliveryDay.java similarity index 86% rename from src/main/java/com/infobip/model/SmsDeliveryDay.java rename to src/main/java/com/infobip/model/DeliveryDay.java index 97dbd06..afbffea 100644 --- a/src/main/java/com/infobip/model/SmsDeliveryDay.java +++ b/src/main/java/com/infobip/model/DeliveryDay.java @@ -15,7 +15,7 @@ /** * Days of the week which are included in the delivery time window. At least one day must be provided. Separate multiple days with a comma. */ -public enum SmsDeliveryDay { +public enum DeliveryDay { MONDAY("MONDAY"), TUESDAY("TUESDAY"), WEDNESDAY("WEDNESDAY"), @@ -26,7 +26,7 @@ public enum SmsDeliveryDay { private final String value; - SmsDeliveryDay(String value) { + DeliveryDay(String value) { this.value = value; } @@ -41,8 +41,8 @@ public String toString() { } @JsonCreator - public static SmsDeliveryDay fromValue(String value) { - for (SmsDeliveryDay enumElement : SmsDeliveryDay.values()) { + public static DeliveryDay fromValue(String value) { + for (DeliveryDay enumElement : DeliveryDay.values()) { if (enumElement.value.equals(value)) { return enumElement; } diff --git a/src/main/java/com/infobip/model/ViberDeliveryTime.java b/src/main/java/com/infobip/model/DeliveryTime.java similarity index 88% rename from src/main/java/com/infobip/model/ViberDeliveryTime.java rename to src/main/java/com/infobip/model/DeliveryTime.java index b40c758..3a1ea76 100644 --- a/src/main/java/com/infobip/model/ViberDeliveryTime.java +++ b/src/main/java/com/infobip/model/DeliveryTime.java @@ -15,7 +15,7 @@ /** * The exact time of the day. The time is expressed in the UTC time zone. */ -public class ViberDeliveryTime { +public class DeliveryTime { private Integer hour; @@ -30,9 +30,9 @@ public class ViberDeliveryTime { * The field is required. * * @param hour - * @return This {@link ViberDeliveryTime instance}. + * @return This {@link DeliveryTime instance}. */ - public ViberDeliveryTime hour(Integer hour) { + public DeliveryTime hour(Integer hour) { this.hour = hour; return this; } @@ -76,9 +76,9 @@ public void setHour(Integer hour) { * The field is required. * * @param minute - * @return This {@link ViberDeliveryTime instance}. + * @return This {@link DeliveryTime instance}. */ - public ViberDeliveryTime minute(Integer minute) { + public DeliveryTime minute(Integer minute) { this.minute = minute; return this; } @@ -121,9 +121,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ViberDeliveryTime viberDeliveryTime = (ViberDeliveryTime) o; - return Objects.equals(this.hour, viberDeliveryTime.hour) - && Objects.equals(this.minute, viberDeliveryTime.minute); + DeliveryTime deliveryTime = (DeliveryTime) o; + return Objects.equals(this.hour, deliveryTime.hour) && Objects.equals(this.minute, deliveryTime.minute); } @Override @@ -135,7 +134,7 @@ public int hashCode() { public String toString() { String newLine = System.lineSeparator(); return new StringBuilder() - .append("class ViberDeliveryTime {") + .append("class DeliveryTime {") .append(newLine) .append(" hour: ") .append(toIndentedString(hour)) diff --git a/src/main/java/com/infobip/model/ViberDeliveryTimeWindow.java b/src/main/java/com/infobip/model/DeliveryTimeWindow.java similarity index 76% rename from src/main/java/com/infobip/model/ViberDeliveryTimeWindow.java rename to src/main/java/com/infobip/model/DeliveryTimeWindow.java index 5f41dc4..6d3b4c0 100644 --- a/src/main/java/com/infobip/model/ViberDeliveryTimeWindow.java +++ b/src/main/java/com/infobip/model/DeliveryTimeWindow.java @@ -17,13 +17,13 @@ /** * Sets specific message delivery window outside of which messages won't be delivered. Often, used when there are restrictions on when messages can be sent. The exact time of the day to start sending messages can be defined using the `from` property. The exact time of the day to end sending messages can be defined using the `to` property. Properties `from` and `to` should be both provided with the minimum 1 hour difference or omitted. */ -public class ViberDeliveryTimeWindow { +public class DeliveryTimeWindow { - private List days = new ArrayList<>(); + private List days = new ArrayList<>(); - private ViberDeliveryTime from; + private DeliveryTime from; - private ViberDeliveryTime to; + private DeliveryTime to; /** * Sets days. @@ -34,9 +34,9 @@ public class ViberDeliveryTimeWindow { * The field is required. * * @param days - * @return This {@link ViberDeliveryTimeWindow instance}. + * @return This {@link DeliveryTimeWindow instance}. */ - public ViberDeliveryTimeWindow days(List days) { + public DeliveryTimeWindow days(List days) { this.days = days; return this; } @@ -50,9 +50,9 @@ public ViberDeliveryTimeWindow days(List days) { * The field is required. * * @param daysItem The item to be added to the list. - * @return This {@link ViberDeliveryTimeWindow instance}. + * @return This {@link DeliveryTimeWindow instance}. */ - public ViberDeliveryTimeWindow addDaysItem(ViberDeliveryDay daysItem) { + public DeliveryTimeWindow addDaysItem(DeliveryDay daysItem) { if (this.days == null) { this.days = new ArrayList<>(); } @@ -71,7 +71,7 @@ public ViberDeliveryTimeWindow addDaysItem(ViberDeliveryDay daysItem) { * @return days */ @JsonProperty("days") - public List getDays() { + public List getDays() { return days; } @@ -86,7 +86,7 @@ public List getDays() { * @param days */ @JsonProperty("days") - public void setDays(List days) { + public void setDays(List days) { this.days = days; } @@ -94,9 +94,9 @@ public void setDays(List days) { * Sets from. * * @param from - * @return This {@link ViberDeliveryTimeWindow instance}. + * @return This {@link DeliveryTimeWindow instance}. */ - public ViberDeliveryTimeWindow from(ViberDeliveryTime from) { + public DeliveryTimeWindow from(DeliveryTime from) { this.from = from; return this; } @@ -107,7 +107,7 @@ public ViberDeliveryTimeWindow from(ViberDeliveryTime from) { * @return from */ @JsonProperty("from") - public ViberDeliveryTime getFrom() { + public DeliveryTime getFrom() { return from; } @@ -117,7 +117,7 @@ public ViberDeliveryTime getFrom() { * @param from */ @JsonProperty("from") - public void setFrom(ViberDeliveryTime from) { + public void setFrom(DeliveryTime from) { this.from = from; } @@ -125,9 +125,9 @@ public void setFrom(ViberDeliveryTime from) { * Sets to. * * @param to - * @return This {@link ViberDeliveryTimeWindow instance}. + * @return This {@link DeliveryTimeWindow instance}. */ - public ViberDeliveryTimeWindow to(ViberDeliveryTime to) { + public DeliveryTimeWindow to(DeliveryTime to) { this.to = to; return this; } @@ -138,7 +138,7 @@ public ViberDeliveryTimeWindow to(ViberDeliveryTime to) { * @return to */ @JsonProperty("to") - public ViberDeliveryTime getTo() { + public DeliveryTime getTo() { return to; } @@ -148,7 +148,7 @@ public ViberDeliveryTime getTo() { * @param to */ @JsonProperty("to") - public void setTo(ViberDeliveryTime to) { + public void setTo(DeliveryTime to) { this.to = to; } @@ -160,10 +160,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ViberDeliveryTimeWindow viberDeliveryTimeWindow = (ViberDeliveryTimeWindow) o; - return Objects.equals(this.days, viberDeliveryTimeWindow.days) - && Objects.equals(this.from, viberDeliveryTimeWindow.from) - && Objects.equals(this.to, viberDeliveryTimeWindow.to); + DeliveryTimeWindow deliveryTimeWindow = (DeliveryTimeWindow) o; + return Objects.equals(this.days, deliveryTimeWindow.days) + && Objects.equals(this.from, deliveryTimeWindow.from) + && Objects.equals(this.to, deliveryTimeWindow.to); } @Override @@ -175,7 +175,7 @@ public int hashCode() { public String toString() { String newLine = System.lineSeparator(); return new StringBuilder() - .append("class ViberDeliveryTimeWindow {") + .append("class DeliveryTimeWindow {") .append(newLine) .append(" days: ") .append(toIndentedString(days)) diff --git a/src/main/java/com/infobip/model/MmsAdvancedMessage.java b/src/main/java/com/infobip/model/MmsAdvancedMessage.java index fc44049..561c4da 100644 --- a/src/main/java/com/infobip/model/MmsAdvancedMessage.java +++ b/src/main/java/com/infobip/model/MmsAdvancedMessage.java @@ -22,7 +22,7 @@ public class MmsAdvancedMessage { private String callbackData; - private MmsDeliveryTimeWindow deliveryTimeWindow; + private DeliveryTimeWindow deliveryTimeWindow; private List destinations = new ArrayList<>(); @@ -92,7 +92,7 @@ public void setCallbackData(String callbackData) { * @param deliveryTimeWindow * @return This {@link MmsAdvancedMessage instance}. */ - public MmsAdvancedMessage deliveryTimeWindow(MmsDeliveryTimeWindow deliveryTimeWindow) { + public MmsAdvancedMessage deliveryTimeWindow(DeliveryTimeWindow deliveryTimeWindow) { this.deliveryTimeWindow = deliveryTimeWindow; return this; } @@ -103,7 +103,7 @@ public MmsAdvancedMessage deliveryTimeWindow(MmsDeliveryTimeWindow deliveryTimeW * @return deliveryTimeWindow */ @JsonProperty("deliveryTimeWindow") - public MmsDeliveryTimeWindow getDeliveryTimeWindow() { + public DeliveryTimeWindow getDeliveryTimeWindow() { return deliveryTimeWindow; } @@ -113,7 +113,7 @@ public MmsDeliveryTimeWindow getDeliveryTimeWindow() { * @param deliveryTimeWindow */ @JsonProperty("deliveryTimeWindow") - public void setDeliveryTimeWindow(MmsDeliveryTimeWindow deliveryTimeWindow) { + public void setDeliveryTimeWindow(DeliveryTimeWindow deliveryTimeWindow) { this.deliveryTimeWindow = deliveryTimeWindow; } @@ -480,6 +480,9 @@ public void setValidityPeriod(Long validityPeriod) { /** * Sets title. + *

+ * Field description: + * Message title. * * @param title * @return This {@link MmsAdvancedMessage instance}. @@ -491,6 +494,9 @@ public MmsAdvancedMessage title(String title) { /** * Returns title. + *

+ * Field description: + * Message title. * * @return title */ @@ -501,6 +507,9 @@ public String getTitle() { /** * Sets title. + *

+ * Field description: + * Message title. * * @param title */ diff --git a/src/main/java/com/infobip/model/MmsDeliveryTime.java b/src/main/java/com/infobip/model/MmsDeliveryTime.java deleted file mode 100644 index f6b6b57..0000000 --- a/src/main/java/com/infobip/model/MmsDeliveryTime.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Objects; - -/** - * Exact time of day in which the sending ends. Time is expressed in the UTC time zone. If set, use it together with the `from` property with minimum 1 hour difference. - */ -public class MmsDeliveryTime { - - private Integer hour; - - private Integer minute; - - /** - * Sets hour. - *

- * Field description: - * Hour when the time window opens when used in the `from` property or closes when used in the `to` property. - * - * @param hour - * @return This {@link MmsDeliveryTime instance}. - */ - public MmsDeliveryTime hour(Integer hour) { - this.hour = hour; - return this; - } - - /** - * Returns hour. - *

- * Field description: - * Hour when the time window opens when used in the `from` property or closes when used in the `to` property. - * - * @return hour - */ - @JsonProperty("hour") - public Integer getHour() { - return hour; - } - - /** - * Sets hour. - *

- * Field description: - * Hour when the time window opens when used in the `from` property or closes when used in the `to` property. - * - * @param hour - */ - @JsonProperty("hour") - public void setHour(Integer hour) { - this.hour = hour; - } - - /** - * Sets minute. - *

- * Field description: - * Minute when the time window opens when used in the `from` property or closes when used in the `to` property. - * - * @param minute - * @return This {@link MmsDeliveryTime instance}. - */ - public MmsDeliveryTime minute(Integer minute) { - this.minute = minute; - return this; - } - - /** - * Returns minute. - *

- * Field description: - * Minute when the time window opens when used in the `from` property or closes when used in the `to` property. - * - * @return minute - */ - @JsonProperty("minute") - public Integer getMinute() { - return minute; - } - - /** - * Sets minute. - *

- * Field description: - * Minute when the time window opens when used in the `from` property or closes when used in the `to` property. - * - * @param minute - */ - @JsonProperty("minute") - public void setMinute(Integer minute) { - this.minute = minute; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MmsDeliveryTime mmsDeliveryTime = (MmsDeliveryTime) o; - return Objects.equals(this.hour, mmsDeliveryTime.hour) && Objects.equals(this.minute, mmsDeliveryTime.minute); - } - - @Override - public int hashCode() { - return Objects.hash(hour, minute); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class MmsDeliveryTime {") - .append(newLine) - .append(" hour: ") - .append(toIndentedString(hour)) - .append(newLine) - .append(" minute: ") - .append(toIndentedString(minute)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/MmsDeliveryTimeWindow.java b/src/main/java/com/infobip/model/MmsDeliveryTimeWindow.java deleted file mode 100644 index 0947a26..0000000 --- a/src/main/java/com/infobip/model/MmsDeliveryTimeWindow.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * Set specific scheduling options to send a message within daily or hourly intervals. - */ -public class MmsDeliveryTimeWindow { - - private List days = new ArrayList<>(); - - private MmsDeliveryTime from; - - private MmsDeliveryTime to; - - /** - * Sets days. - *

- * Field description: - * Days of the week which are included in the delivery time window. At least one day must be provided. - *

- * The field is required. - * - * @param days - * @return This {@link MmsDeliveryTimeWindow instance}. - */ - public MmsDeliveryTimeWindow days(List days) { - this.days = days; - return this; - } - - /** - * Adds and item into days. - *

- * Field description: - * Days of the week which are included in the delivery time window. At least one day must be provided. - *

- * The field is required. - * - * @param daysItem The item to be added to the list. - * @return This {@link MmsDeliveryTimeWindow instance}. - */ - public MmsDeliveryTimeWindow addDaysItem(MmsDeliveryDay daysItem) { - if (this.days == null) { - this.days = new ArrayList<>(); - } - this.days.add(daysItem); - return this; - } - - /** - * Returns days. - *

- * Field description: - * Days of the week which are included in the delivery time window. At least one day must be provided. - *

- * The field is required. - * - * @return days - */ - @JsonProperty("days") - public List getDays() { - return days; - } - - /** - * Sets days. - *

- * Field description: - * Days of the week which are included in the delivery time window. At least one day must be provided. - *

- * The field is required. - * - * @param days - */ - @JsonProperty("days") - public void setDays(List days) { - this.days = days; - } - - /** - * Sets from. - * - * @param from - * @return This {@link MmsDeliveryTimeWindow instance}. - */ - public MmsDeliveryTimeWindow from(MmsDeliveryTime from) { - this.from = from; - return this; - } - - /** - * Returns from. - * - * @return from - */ - @JsonProperty("from") - public MmsDeliveryTime getFrom() { - return from; - } - - /** - * Sets from. - * - * @param from - */ - @JsonProperty("from") - public void setFrom(MmsDeliveryTime from) { - this.from = from; - } - - /** - * Sets to. - * - * @param to - * @return This {@link MmsDeliveryTimeWindow instance}. - */ - public MmsDeliveryTimeWindow to(MmsDeliveryTime to) { - this.to = to; - return this; - } - - /** - * Returns to. - * - * @return to - */ - @JsonProperty("to") - public MmsDeliveryTime getTo() { - return to; - } - - /** - * Sets to. - * - * @param to - */ - @JsonProperty("to") - public void setTo(MmsDeliveryTime to) { - this.to = to; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MmsDeliveryTimeWindow mmsDeliveryTimeWindow = (MmsDeliveryTimeWindow) o; - return Objects.equals(this.days, mmsDeliveryTimeWindow.days) - && Objects.equals(this.from, mmsDeliveryTimeWindow.from) - && Objects.equals(this.to, mmsDeliveryTimeWindow.to); - } - - @Override - public int hashCode() { - return Objects.hash(days, from, to); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class MmsDeliveryTimeWindow {") - .append(newLine) - .append(" days: ") - .append(toIndentedString(days)) - .append(newLine) - .append(" from: ") - .append(toIndentedString(from)) - .append(newLine) - .append(" to: ") - .append(toIndentedString(to)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/MmsReport.java b/src/main/java/com/infobip/model/MmsReport.java index 53130d2..835e570 100644 --- a/src/main/java/com/infobip/model/MmsReport.java +++ b/src/main/java/com/infobip/model/MmsReport.java @@ -10,6 +10,7 @@ package com.infobip.model; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; import java.util.Objects; /** @@ -25,9 +26,9 @@ public class MmsReport { private String from; - private String sentAt; + private OffsetDateTime sentAt; - private String doneAt; + private OffsetDateTime doneAt; private Integer mmsCount; @@ -214,7 +215,7 @@ public void setFrom(String from) { * @param sentAt * @return This {@link MmsReport instance}. */ - public MmsReport sentAt(String sentAt) { + public MmsReport sentAt(OffsetDateTime sentAt) { this.sentAt = sentAt; return this; } @@ -228,7 +229,7 @@ public MmsReport sentAt(String sentAt) { * @return sentAt */ @JsonProperty("sentAt") - public String getSentAt() { + public OffsetDateTime getSentAt() { return sentAt; } @@ -241,7 +242,7 @@ public String getSentAt() { * @param sentAt */ @JsonProperty("sentAt") - public void setSentAt(String sentAt) { + public void setSentAt(OffsetDateTime sentAt) { this.sentAt = sentAt; } @@ -254,7 +255,7 @@ public void setSentAt(String sentAt) { * @param doneAt * @return This {@link MmsReport instance}. */ - public MmsReport doneAt(String doneAt) { + public MmsReport doneAt(OffsetDateTime doneAt) { this.doneAt = doneAt; return this; } @@ -268,7 +269,7 @@ public MmsReport doneAt(String doneAt) { * @return doneAt */ @JsonProperty("doneAt") - public String getDoneAt() { + public OffsetDateTime getDoneAt() { return doneAt; } @@ -281,7 +282,7 @@ public String getDoneAt() { * @param doneAt */ @JsonProperty("doneAt") - public void setDoneAt(String doneAt) { + public void setDoneAt(OffsetDateTime doneAt) { this.doneAt = doneAt; } diff --git a/src/main/java/com/infobip/model/SmsIysRecipientType.java b/src/main/java/com/infobip/model/RecipientType.java similarity index 83% rename from src/main/java/com/infobip/model/SmsIysRecipientType.java rename to src/main/java/com/infobip/model/RecipientType.java index 3ec652b..62788ae 100644 --- a/src/main/java/com/infobip/model/SmsIysRecipientType.java +++ b/src/main/java/com/infobip/model/RecipientType.java @@ -15,13 +15,13 @@ /** * Recipient Type must be `TACIR` or `BIREYSEL`. */ -public enum SmsIysRecipientType { +public enum RecipientType { BIREYSEL("BIREYSEL"), TACIR("TACIR"); private final String value; - SmsIysRecipientType(String value) { + RecipientType(String value) { this.value = value; } @@ -36,8 +36,8 @@ public String toString() { } @JsonCreator - public static SmsIysRecipientType fromValue(String value) { - for (SmsIysRecipientType enumElement : SmsIysRecipientType.values()) { + public static RecipientType fromValue(String value) { + for (RecipientType enumElement : RecipientType.values()) { if (enumElement.value.equals(value)) { return enumElement; } diff --git a/src/main/java/com/infobip/model/SmsAdvancedTextualRequest.java b/src/main/java/com/infobip/model/SmsAdvancedTextualRequest.java deleted file mode 100644 index 841b0a1..0000000 --- a/src/main/java/com/infobip/model/SmsAdvancedTextualRequest.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * Represents SmsAdvancedTextualRequest model. - */ -public class SmsAdvancedTextualRequest { - - private String bulkId; - - private List messages = new ArrayList<>(); - - private SmsSendingSpeedLimit sendingSpeedLimit; - - private SmsUrlOptions urlOptions; - - private SmsTracking tracking; - - private Boolean includeSmsCountInResponse; - - /** - * Sets bulkId. - *

- * Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). - * - * @param bulkId - * @return This {@link SmsAdvancedTextualRequest instance}. - */ - public SmsAdvancedTextualRequest bulkId(String bulkId) { - this.bulkId = bulkId; - return this; - } - - /** - * Returns bulkId. - *

- * Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). - * - * @return bulkId - */ - @JsonProperty("bulkId") - public String getBulkId() { - return bulkId; - } - - /** - * Sets bulkId. - *

- * Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). - * - * @param bulkId - */ - @JsonProperty("bulkId") - public void setBulkId(String bulkId) { - this.bulkId = bulkId; - } - - /** - * Sets messages. - *

- * Field description: - * An array of message objects of a single message or multiple messages sent under one bulk ID. - *

- * The field is required. - * - * @param messages - * @return This {@link SmsAdvancedTextualRequest instance}. - */ - public SmsAdvancedTextualRequest messages(List messages) { - this.messages = messages; - return this; - } - - /** - * Adds and item into messages. - *

- * Field description: - * An array of message objects of a single message or multiple messages sent under one bulk ID. - *

- * The field is required. - * - * @param messagesItem The item to be added to the list. - * @return This {@link SmsAdvancedTextualRequest instance}. - */ - public SmsAdvancedTextualRequest addMessagesItem(SmsTextualMessage messagesItem) { - if (this.messages == null) { - this.messages = new ArrayList<>(); - } - this.messages.add(messagesItem); - return this; - } - - /** - * Returns messages. - *

- * Field description: - * An array of message objects of a single message or multiple messages sent under one bulk ID. - *

- * The field is required. - * - * @return messages - */ - @JsonProperty("messages") - public List getMessages() { - return messages; - } - - /** - * Sets messages. - *

- * Field description: - * An array of message objects of a single message or multiple messages sent under one bulk ID. - *

- * The field is required. - * - * @param messages - */ - @JsonProperty("messages") - public void setMessages(List messages) { - this.messages = messages; - } - - /** - * Sets sendingSpeedLimit. - * - * @param sendingSpeedLimit - * @return This {@link SmsAdvancedTextualRequest instance}. - */ - public SmsAdvancedTextualRequest sendingSpeedLimit(SmsSendingSpeedLimit sendingSpeedLimit) { - this.sendingSpeedLimit = sendingSpeedLimit; - return this; - } - - /** - * Returns sendingSpeedLimit. - * - * @return sendingSpeedLimit - */ - @JsonProperty("sendingSpeedLimit") - public SmsSendingSpeedLimit getSendingSpeedLimit() { - return sendingSpeedLimit; - } - - /** - * Sets sendingSpeedLimit. - * - * @param sendingSpeedLimit - */ - @JsonProperty("sendingSpeedLimit") - public void setSendingSpeedLimit(SmsSendingSpeedLimit sendingSpeedLimit) { - this.sendingSpeedLimit = sendingSpeedLimit; - } - - /** - * Sets urlOptions. - * - * @param urlOptions - * @return This {@link SmsAdvancedTextualRequest instance}. - */ - public SmsAdvancedTextualRequest urlOptions(SmsUrlOptions urlOptions) { - this.urlOptions = urlOptions; - return this; - } - - /** - * Returns urlOptions. - * - * @return urlOptions - */ - @JsonProperty("urlOptions") - public SmsUrlOptions getUrlOptions() { - return urlOptions; - } - - /** - * Sets urlOptions. - * - * @param urlOptions - */ - @JsonProperty("urlOptions") - public void setUrlOptions(SmsUrlOptions urlOptions) { - this.urlOptions = urlOptions; - } - - /** - * Sets tracking. - * - * @param tracking - * @return This {@link SmsAdvancedTextualRequest instance}. - */ - public SmsAdvancedTextualRequest tracking(SmsTracking tracking) { - this.tracking = tracking; - return this; - } - - /** - * Returns tracking. - * - * @return tracking - */ - @JsonProperty("tracking") - public SmsTracking getTracking() { - return tracking; - } - - /** - * Sets tracking. - * - * @param tracking - */ - @JsonProperty("tracking") - public void setTracking(SmsTracking tracking) { - this.tracking = tracking; - } - - /** - * Sets includeSmsCountInResponse. - *

- * Field description: - * Set to true to return smsCount in the response. Default is false. smsCount is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. - * - * @param includeSmsCountInResponse - * @return This {@link SmsAdvancedTextualRequest instance}. - */ - public SmsAdvancedTextualRequest includeSmsCountInResponse(Boolean includeSmsCountInResponse) { - this.includeSmsCountInResponse = includeSmsCountInResponse; - return this; - } - - /** - * Returns includeSmsCountInResponse. - *

- * Field description: - * Set to true to return smsCount in the response. Default is false. smsCount is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. - * - * @return includeSmsCountInResponse - */ - @JsonProperty("includeSmsCountInResponse") - public Boolean getIncludeSmsCountInResponse() { - return includeSmsCountInResponse; - } - - /** - * Sets includeSmsCountInResponse. - *

- * Field description: - * Set to true to return smsCount in the response. Default is false. smsCount is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. - * - * @param includeSmsCountInResponse - */ - @JsonProperty("includeSmsCountInResponse") - public void setIncludeSmsCountInResponse(Boolean includeSmsCountInResponse) { - this.includeSmsCountInResponse = includeSmsCountInResponse; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsAdvancedTextualRequest smsAdvancedTextualRequest = (SmsAdvancedTextualRequest) o; - return Objects.equals(this.bulkId, smsAdvancedTextualRequest.bulkId) - && Objects.equals(this.messages, smsAdvancedTextualRequest.messages) - && Objects.equals(this.sendingSpeedLimit, smsAdvancedTextualRequest.sendingSpeedLimit) - && Objects.equals(this.urlOptions, smsAdvancedTextualRequest.urlOptions) - && Objects.equals(this.tracking, smsAdvancedTextualRequest.tracking) - && Objects.equals(this.includeSmsCountInResponse, smsAdvancedTextualRequest.includeSmsCountInResponse); - } - - @Override - public int hashCode() { - return Objects.hash(bulkId, messages, sendingSpeedLimit, urlOptions, tracking, includeSmsCountInResponse); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class SmsAdvancedTextualRequest {") - .append(newLine) - .append(" bulkId: ") - .append(toIndentedString(bulkId)) - .append(newLine) - .append(" messages: ") - .append(toIndentedString(messages)) - .append(newLine) - .append(" sendingSpeedLimit: ") - .append(toIndentedString(sendingSpeedLimit)) - .append(newLine) - .append(" urlOptions: ") - .append(toIndentedString(urlOptions)) - .append(newLine) - .append(" tracking: ") - .append(toIndentedString(tracking)) - .append(newLine) - .append(" includeSmsCountInResponse: ") - .append(toIndentedString(includeSmsCountInResponse)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/SmsBinaryContent.java b/src/main/java/com/infobip/model/SmsBinaryContent.java index 108721f..d267ae6 100644 --- a/src/main/java/com/infobip/model/SmsBinaryContent.java +++ b/src/main/java/com/infobip/model/SmsBinaryContent.java @@ -15,7 +15,7 @@ /** * Represents SmsBinaryContent model. */ -public class SmsBinaryContent { +public class SmsBinaryContent implements SmsMessageContent { private Integer dataCoding; @@ -107,7 +107,7 @@ public void setEsmClass(Integer esmClass) { * Sets hex. *

* Field description: - * Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by the space character (Example: `0f c2 4a bf 34 13 ba`). + * Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by the space character. *

* The field is required. * @@ -123,7 +123,7 @@ public SmsBinaryContent hex(String hex) { * Returns hex. *

* Field description: - * Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by the space character (Example: `0f c2 4a bf 34 13 ba`). + * Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by the space character. *

* The field is required. * @@ -138,7 +138,7 @@ public String getHex() { * Sets hex. *

* Field description: - * Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by the space character (Example: `0f c2 4a bf 34 13 ba`). + * Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by the space character. *

* The field is required. * diff --git a/src/main/java/com/infobip/model/SmsBinaryMessage.java b/src/main/java/com/infobip/model/SmsBinaryMessage.java deleted file mode 100644 index f638e5d..0000000 --- a/src/main/java/com/infobip/model/SmsBinaryMessage.java +++ /dev/null @@ -1,713 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * An array of message objects of a single message or multiple messages sent under one bulk ID. - */ -public class SmsBinaryMessage { - - private SmsBinaryContent binary; - - private String callbackData; - - private SmsDeliveryTimeWindow deliveryTimeWindow; - - private List destinations = new ArrayList<>(); - - private Boolean flash; - - private String from; - - private Boolean intermediateReport; - - private String notifyContentType; - - private String notifyUrl; - - private SmsRegionalOptions regional; - - private OffsetDateTime sendAt; - - private Long validityPeriod; - - private String entityId; - - private String applicationId; - - /** - * Sets binary. - * - * @param binary - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage binary(SmsBinaryContent binary) { - this.binary = binary; - return this; - } - - /** - * Returns binary. - * - * @return binary - */ - @JsonProperty("binary") - public SmsBinaryContent getBinary() { - return binary; - } - - /** - * Sets binary. - * - * @param binary - */ - @JsonProperty("binary") - public void setBinary(SmsBinaryContent binary) { - this.binary = binary; - } - - /** - * Sets callbackData. - *

- * Field description: - * Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports). The maximum value is 4000 characters. - * - * @param callbackData - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage callbackData(String callbackData) { - this.callbackData = callbackData; - return this; - } - - /** - * Returns callbackData. - *

- * Field description: - * Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports). The maximum value is 4000 characters. - * - * @return callbackData - */ - @JsonProperty("callbackData") - public String getCallbackData() { - return callbackData; - } - - /** - * Sets callbackData. - *

- * Field description: - * Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports). The maximum value is 4000 characters. - * - * @param callbackData - */ - @JsonProperty("callbackData") - public void setCallbackData(String callbackData) { - this.callbackData = callbackData; - } - - /** - * Sets deliveryTimeWindow. - * - * @param deliveryTimeWindow - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage deliveryTimeWindow(SmsDeliveryTimeWindow deliveryTimeWindow) { - this.deliveryTimeWindow = deliveryTimeWindow; - return this; - } - - /** - * Returns deliveryTimeWindow. - * - * @return deliveryTimeWindow - */ - @JsonProperty("deliveryTimeWindow") - public SmsDeliveryTimeWindow getDeliveryTimeWindow() { - return deliveryTimeWindow; - } - - /** - * Sets deliveryTimeWindow. - * - * @param deliveryTimeWindow - */ - @JsonProperty("deliveryTimeWindow") - public void setDeliveryTimeWindow(SmsDeliveryTimeWindow deliveryTimeWindow) { - this.deliveryTimeWindow = deliveryTimeWindow; - } - - /** - * Sets destinations. - *

- * Field description: - * An array of destination objects for where messages are being sent. A valid destination is required. - *

- * The field is required. - * - * @param destinations - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage destinations(List destinations) { - this.destinations = destinations; - return this; - } - - /** - * Adds and item into destinations. - *

- * Field description: - * An array of destination objects for where messages are being sent. A valid destination is required. - *

- * The field is required. - * - * @param destinationsItem The item to be added to the list. - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage addDestinationsItem(SmsDestination destinationsItem) { - if (this.destinations == null) { - this.destinations = new ArrayList<>(); - } - this.destinations.add(destinationsItem); - return this; - } - - /** - * Returns destinations. - *

- * Field description: - * An array of destination objects for where messages are being sent. A valid destination is required. - *

- * The field is required. - * - * @return destinations - */ - @JsonProperty("destinations") - public List getDestinations() { - return destinations; - } - - /** - * Sets destinations. - *

- * Field description: - * An array of destination objects for where messages are being sent. A valid destination is required. - *

- * The field is required. - * - * @param destinations - */ - @JsonProperty("destinations") - public void setDestinations(List destinations) { - this.destinations = destinations; - } - - /** - * Sets flash. - *

- * Field description: - * Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS. - * - * @param flash - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage flash(Boolean flash) { - this.flash = flash; - return this; - } - - /** - * Returns flash. - *

- * Field description: - * Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS. - * - * @return flash - */ - @JsonProperty("flash") - public Boolean getFlash() { - return flash; - } - - /** - * Sets flash. - *

- * Field description: - * Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS. - * - * @param flash - */ - @JsonProperty("flash") - public void setFlash(Boolean flash) { - this.flash = flash; - } - - /** - * Sets from. - *

- * Field description: - * The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names). - * - * @param from - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage from(String from) { - this.from = from; - return this; - } - - /** - * Returns from. - *

- * Field description: - * The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names). - * - * @return from - */ - @JsonProperty("from") - public String getFrom() { - return from; - } - - /** - * Sets from. - *

- * Field description: - * The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names). - * - * @param from - */ - @JsonProperty("from") - public void setFrom(String from) { - this.from = from; - } - - /** - * Sets intermediateReport. - *

- * Field description: - * The [real-time intermediate delivery report](https://www.infobip.com/docs/api#channels/sms/receive-outbound-sms-message-report) containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`. - * - * @param intermediateReport - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage intermediateReport(Boolean intermediateReport) { - this.intermediateReport = intermediateReport; - return this; - } - - /** - * Returns intermediateReport. - *

- * Field description: - * The [real-time intermediate delivery report](https://www.infobip.com/docs/api#channels/sms/receive-outbound-sms-message-report) containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`. - * - * @return intermediateReport - */ - @JsonProperty("intermediateReport") - public Boolean getIntermediateReport() { - return intermediateReport; - } - - /** - * Sets intermediateReport. - *

- * Field description: - * The [real-time intermediate delivery report](https://www.infobip.com/docs/api#channels/sms/receive-outbound-sms-message-report) containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`. - * - * @param intermediateReport - */ - @JsonProperty("intermediateReport") - public void setIntermediateReport(Boolean intermediateReport) { - this.intermediateReport = intermediateReport; - } - - /** - * Sets notifyContentType. - *

- * Field description: - * Preferred delivery report content type, `application/json` or `application/xml`. - * - * @param notifyContentType - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage notifyContentType(String notifyContentType) { - this.notifyContentType = notifyContentType; - return this; - } - - /** - * Returns notifyContentType. - *

- * Field description: - * Preferred delivery report content type, `application/json` or `application/xml`. - * - * @return notifyContentType - */ - @JsonProperty("notifyContentType") - public String getNotifyContentType() { - return notifyContentType; - } - - /** - * Sets notifyContentType. - *

- * Field description: - * Preferred delivery report content type, `application/json` or `application/xml`. - * - * @param notifyContentType - */ - @JsonProperty("notifyContentType") - public void setNotifyContentType(String notifyContentType) { - this.notifyContentType = notifyContentType; - } - - /** - * Sets notifyUrl. - *

- * Field description: - * The URL on your call back server on which the Delivery report will be sent. - * - * @param notifyUrl - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage notifyUrl(String notifyUrl) { - this.notifyUrl = notifyUrl; - return this; - } - - /** - * Returns notifyUrl. - *

- * Field description: - * The URL on your call back server on which the Delivery report will be sent. - * - * @return notifyUrl - */ - @JsonProperty("notifyUrl") - public String getNotifyUrl() { - return notifyUrl; - } - - /** - * Sets notifyUrl. - *

- * Field description: - * The URL on your call back server on which the Delivery report will be sent. - * - * @param notifyUrl - */ - @JsonProperty("notifyUrl") - public void setNotifyUrl(String notifyUrl) { - this.notifyUrl = notifyUrl; - } - - /** - * Sets regional. - * - * @param regional - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage regional(SmsRegionalOptions regional) { - this.regional = regional; - return this; - } - - /** - * Returns regional. - * - * @return regional - */ - @JsonProperty("regional") - public SmsRegionalOptions getRegional() { - return regional; - } - - /** - * Sets regional. - * - * @param regional - */ - @JsonProperty("regional") - public void setRegional(SmsRegionalOptions regional) { - this.regional = regional; - } - - /** - * Sets sendAt. - *

- * Field description: - * Date and time when the message is to be sent. Used for [scheduled SMS](https://www.infobip.com/docs/api#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. - * - * @param sendAt - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage sendAt(OffsetDateTime sendAt) { - this.sendAt = sendAt; - return this; - } - - /** - * Returns sendAt. - *

- * Field description: - * Date and time when the message is to be sent. Used for [scheduled SMS](https://www.infobip.com/docs/api#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. - * - * @return sendAt - */ - @JsonProperty("sendAt") - public OffsetDateTime getSendAt() { - return sendAt; - } - - /** - * Sets sendAt. - *

- * Field description: - * Date and time when the message is to be sent. Used for [scheduled SMS](https://www.infobip.com/docs/api#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. - * - * @param sendAt - */ - @JsonProperty("sendAt") - public void setSendAt(OffsetDateTime sendAt) { - this.sendAt = sendAt; - } - - /** - * Sets validityPeriod. - *

- * Field description: - * The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported (in this case, it will be automatically set to 48h). - * - * @param validityPeriod - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage validityPeriod(Long validityPeriod) { - this.validityPeriod = validityPeriod; - return this; - } - - /** - * Returns validityPeriod. - *

- * Field description: - * The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported (in this case, it will be automatically set to 48h). - * - * @return validityPeriod - */ - @JsonProperty("validityPeriod") - public Long getValidityPeriod() { - return validityPeriod; - } - - /** - * Sets validityPeriod. - *

- * Field description: - * The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported (in this case, it will be automatically set to 48h). - * - * @param validityPeriod - */ - @JsonProperty("validityPeriod") - public void setValidityPeriod(Long validityPeriod) { - this.validityPeriod = validityPeriod; - } - - /** - * Sets entityId. - *

- * Field description: - * Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @param entityId - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage entityId(String entityId) { - this.entityId = entityId; - return this; - } - - /** - * Returns entityId. - *

- * Field description: - * Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @return entityId - */ - @JsonProperty("entityId") - public String getEntityId() { - return entityId; - } - - /** - * Sets entityId. - *

- * Field description: - * Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @param entityId - */ - @JsonProperty("entityId") - public void setEntityId(String entityId) { - this.entityId = entityId; - } - - /** - * Sets applicationId. - *

- * Field description: - * Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @param applicationId - * @return This {@link SmsBinaryMessage instance}. - */ - public SmsBinaryMessage applicationId(String applicationId) { - this.applicationId = applicationId; - return this; - } - - /** - * Returns applicationId. - *

- * Field description: - * Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @return applicationId - */ - @JsonProperty("applicationId") - public String getApplicationId() { - return applicationId; - } - - /** - * Sets applicationId. - *

- * Field description: - * Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @param applicationId - */ - @JsonProperty("applicationId") - public void setApplicationId(String applicationId) { - this.applicationId = applicationId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsBinaryMessage smsBinaryMessage = (SmsBinaryMessage) o; - return Objects.equals(this.binary, smsBinaryMessage.binary) - && Objects.equals(this.callbackData, smsBinaryMessage.callbackData) - && Objects.equals(this.deliveryTimeWindow, smsBinaryMessage.deliveryTimeWindow) - && Objects.equals(this.destinations, smsBinaryMessage.destinations) - && Objects.equals(this.flash, smsBinaryMessage.flash) - && Objects.equals(this.from, smsBinaryMessage.from) - && Objects.equals(this.intermediateReport, smsBinaryMessage.intermediateReport) - && Objects.equals(this.notifyContentType, smsBinaryMessage.notifyContentType) - && Objects.equals(this.notifyUrl, smsBinaryMessage.notifyUrl) - && Objects.equals(this.regional, smsBinaryMessage.regional) - && Objects.equals(this.sendAt, smsBinaryMessage.sendAt) - && Objects.equals(this.validityPeriod, smsBinaryMessage.validityPeriod) - && Objects.equals(this.entityId, smsBinaryMessage.entityId) - && Objects.equals(this.applicationId, smsBinaryMessage.applicationId); - } - - @Override - public int hashCode() { - return Objects.hash( - binary, - callbackData, - deliveryTimeWindow, - destinations, - flash, - from, - intermediateReport, - notifyContentType, - notifyUrl, - regional, - sendAt, - validityPeriod, - entityId, - applicationId); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class SmsBinaryMessage {") - .append(newLine) - .append(" binary: ") - .append(toIndentedString(binary)) - .append(newLine) - .append(" callbackData: ") - .append(toIndentedString(callbackData)) - .append(newLine) - .append(" deliveryTimeWindow: ") - .append(toIndentedString(deliveryTimeWindow)) - .append(newLine) - .append(" destinations: ") - .append(toIndentedString(destinations)) - .append(newLine) - .append(" flash: ") - .append(toIndentedString(flash)) - .append(newLine) - .append(" from: ") - .append(toIndentedString(from)) - .append(newLine) - .append(" intermediateReport: ") - .append(toIndentedString(intermediateReport)) - .append(newLine) - .append(" notifyContentType: ") - .append(toIndentedString(notifyContentType)) - .append(newLine) - .append(" notifyUrl: ") - .append(toIndentedString(notifyUrl)) - .append(newLine) - .append(" regional: ") - .append(toIndentedString(regional)) - .append(newLine) - .append(" sendAt: ") - .append(toIndentedString(sendAt)) - .append(newLine) - .append(" validityPeriod: ") - .append(toIndentedString(validityPeriod)) - .append(newLine) - .append(" entityId: ") - .append(toIndentedString(entityId)) - .append(newLine) - .append(" applicationId: ") - .append(toIndentedString(applicationId)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/SmsDeliveryReport.java b/src/main/java/com/infobip/model/SmsDeliveryReport.java new file mode 100644 index 0000000..fb4c68a --- /dev/null +++ b/src/main/java/com/infobip/model/SmsDeliveryReport.java @@ -0,0 +1,677 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** + * Collection of reports, one per every message. + */ +public class SmsDeliveryReport { + + private String bulkId; + + private MessagePrice price; + + private SmsMessageStatus status; + + private SmsMessageError error; + + private String messageId; + + private String to; + + private String sender; + + private OffsetDateTime sentAt; + + private OffsetDateTime doneAt; + + private Integer messageCount; + + private String mccMnc; + + private String callbackData; + + private SmsPlatform platform; + + private String campaignReferenceId; + + /** + * Sets bulkId. + *

+ * Field description: + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. + * + * @param bulkId + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport bulkId(String bulkId) { + this.bulkId = bulkId; + return this; + } + + /** + * Returns bulkId. + *

+ * Field description: + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. + * + * @return bulkId + */ + @JsonProperty("bulkId") + public String getBulkId() { + return bulkId; + } + + /** + * Sets bulkId. + *

+ * Field description: + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. + * + * @param bulkId + */ + @JsonProperty("bulkId") + public void setBulkId(String bulkId) { + this.bulkId = bulkId; + } + + /** + * Sets price. + * + * @param price + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport price(MessagePrice price) { + this.price = price; + return this; + } + + /** + * Returns price. + * + * @return price + */ + @JsonProperty("price") + public MessagePrice getPrice() { + return price; + } + + /** + * Sets price. + * + * @param price + */ + @JsonProperty("price") + public void setPrice(MessagePrice price) { + this.price = price; + } + + /** + * Sets status. + * + * @param status + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport status(SmsMessageStatus status) { + this.status = status; + return this; + } + + /** + * Returns status. + * + * @return status + */ + @JsonProperty("status") + public SmsMessageStatus getStatus() { + return status; + } + + /** + * Sets status. + * + * @param status + */ + @JsonProperty("status") + public void setStatus(SmsMessageStatus status) { + this.status = status; + } + + /** + * Sets error. + * + * @param error + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport error(SmsMessageError error) { + this.error = error; + return this; + } + + /** + * Returns error. + * + * @return error + */ + @JsonProperty("error") + public SmsMessageError getError() { + return error; + } + + /** + * Sets error. + * + * @param error + */ + @JsonProperty("error") + public void setError(SmsMessageError error) { + this.error = error; + } + + /** + * Sets messageId. + *

+ * Field description: + * Unique message ID. + * + * @param messageId + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport messageId(String messageId) { + this.messageId = messageId; + return this; + } + + /** + * Returns messageId. + *

+ * Field description: + * Unique message ID. + * + * @return messageId + */ + @JsonProperty("messageId") + public String getMessageId() { + return messageId; + } + + /** + * Sets messageId. + *

+ * Field description: + * Unique message ID. + * + * @param messageId + */ + @JsonProperty("messageId") + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + /** + * Sets to. + *

+ * Field description: + * Message destination address. + * + * @param to + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport to(String to) { + this.to = to; + return this; + } + + /** + * Returns to. + *

+ * Field description: + * Message destination address. + * + * @return to + */ + @JsonProperty("to") + public String getTo() { + return to; + } + + /** + * Sets to. + *

+ * Field description: + * Message destination address. + * + * @param to + */ + @JsonProperty("to") + public void setTo(String to) { + this.to = to; + } + + /** + * Sets sender. + *

+ * Field description: + * The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). + * + * @param sender + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport sender(String sender) { + this.sender = sender; + return this; + } + + /** + * Returns sender. + *

+ * Field description: + * The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). + * + * @return sender + */ + @JsonProperty("sender") + public String getSender() { + return sender; + } + + /** + * Sets sender. + *

+ * Field description: + * The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). + * + * @param sender + */ + @JsonProperty("sender") + public void setSender(String sender) { + this.sender = sender; + } + + /** + * Sets sentAt. + *

+ * Field description: + * Date and time when the message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. + * + * @param sentAt + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport sentAt(OffsetDateTime sentAt) { + this.sentAt = sentAt; + return this; + } + + /** + * Returns sentAt. + *

+ * Field description: + * Date and time when the message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. + * + * @return sentAt + */ + @JsonProperty("sentAt") + public OffsetDateTime getSentAt() { + return sentAt; + } + + /** + * Sets sentAt. + *

+ * Field description: + * Date and time when the message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. + * + * @param sentAt + */ + @JsonProperty("sentAt") + public void setSentAt(OffsetDateTime sentAt) { + this.sentAt = sentAt; + } + + /** + * Sets doneAt. + *

+ * Field description: + * Date and time when the Infobip services finished processing the message (i.e., delivered to the destination, network, etc.). Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. + * + * @param doneAt + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport doneAt(OffsetDateTime doneAt) { + this.doneAt = doneAt; + return this; + } + + /** + * Returns doneAt. + *

+ * Field description: + * Date and time when the Infobip services finished processing the message (i.e., delivered to the destination, network, etc.). Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. + * + * @return doneAt + */ + @JsonProperty("doneAt") + public OffsetDateTime getDoneAt() { + return doneAt; + } + + /** + * Sets doneAt. + *

+ * Field description: + * Date and time when the Infobip services finished processing the message (i.e., delivered to the destination, network, etc.). Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. + * + * @param doneAt + */ + @JsonProperty("doneAt") + public void setDoneAt(OffsetDateTime doneAt) { + this.doneAt = doneAt; + } + + /** + * Sets messageCount. + *

+ * Field description: + * The number of sent messages. + * + * @param messageCount + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport messageCount(Integer messageCount) { + this.messageCount = messageCount; + return this; + } + + /** + * Returns messageCount. + *

+ * Field description: + * The number of sent messages. + * + * @return messageCount + */ + @JsonProperty("messageCount") + public Integer getMessageCount() { + return messageCount; + } + + /** + * Sets messageCount. + *

+ * Field description: + * The number of sent messages. + * + * @param messageCount + */ + @JsonProperty("messageCount") + public void setMessageCount(Integer messageCount) { + this.messageCount = messageCount; + } + + /** + * Sets mccMnc. + *

+ * Field description: + * Mobile country and network codes. + * + * @param mccMnc + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport mccMnc(String mccMnc) { + this.mccMnc = mccMnc; + return this; + } + + /** + * Returns mccMnc. + *

+ * Field description: + * Mobile country and network codes. + * + * @return mccMnc + */ + @JsonProperty("mccMnc") + public String getMccMnc() { + return mccMnc; + } + + /** + * Sets mccMnc. + *

+ * Field description: + * Mobile country and network codes. + * + * @param mccMnc + */ + @JsonProperty("mccMnc") + public void setMccMnc(String mccMnc) { + this.mccMnc = mccMnc; + } + + /** + * Sets callbackData. + *

+ * Field description: + * Callback data sent through ‛callbackData‛ field when sending message. + * + * @param callbackData + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport callbackData(String callbackData) { + this.callbackData = callbackData; + return this; + } + + /** + * Returns callbackData. + *

+ * Field description: + * Callback data sent through ‛callbackData‛ field when sending message. + * + * @return callbackData + */ + @JsonProperty("callbackData") + public String getCallbackData() { + return callbackData; + } + + /** + * Sets callbackData. + *

+ * Field description: + * Callback data sent through ‛callbackData‛ field when sending message. + * + * @param callbackData + */ + @JsonProperty("callbackData") + public void setCallbackData(String callbackData) { + this.callbackData = callbackData; + } + + /** + * Sets platform. + * + * @param platform + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport platform(SmsPlatform platform) { + this.platform = platform; + return this; + } + + /** + * Returns platform. + * + * @return platform + */ + @JsonProperty("platform") + public SmsPlatform getPlatform() { + return platform; + } + + /** + * Sets platform. + * + * @param platform + */ + @JsonProperty("platform") + public void setPlatform(SmsPlatform platform) { + this.platform = platform; + } + + /** + * Sets campaignReferenceId. + *

+ * Field description: + * ID of a campaign that was sent in the message. + * + * @param campaignReferenceId + * @return This {@link SmsDeliveryReport instance}. + */ + public SmsDeliveryReport campaignReferenceId(String campaignReferenceId) { + this.campaignReferenceId = campaignReferenceId; + return this; + } + + /** + * Returns campaignReferenceId. + *

+ * Field description: + * ID of a campaign that was sent in the message. + * + * @return campaignReferenceId + */ + @JsonProperty("campaignReferenceId") + public String getCampaignReferenceId() { + return campaignReferenceId; + } + + /** + * Sets campaignReferenceId. + *

+ * Field description: + * ID of a campaign that was sent in the message. + * + * @param campaignReferenceId + */ + @JsonProperty("campaignReferenceId") + public void setCampaignReferenceId(String campaignReferenceId) { + this.campaignReferenceId = campaignReferenceId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsDeliveryReport smsDeliveryReport = (SmsDeliveryReport) o; + return Objects.equals(this.bulkId, smsDeliveryReport.bulkId) + && Objects.equals(this.price, smsDeliveryReport.price) + && Objects.equals(this.status, smsDeliveryReport.status) + && Objects.equals(this.error, smsDeliveryReport.error) + && Objects.equals(this.messageId, smsDeliveryReport.messageId) + && Objects.equals(this.to, smsDeliveryReport.to) + && Objects.equals(this.sender, smsDeliveryReport.sender) + && Objects.equals(this.sentAt, smsDeliveryReport.sentAt) + && Objects.equals(this.doneAt, smsDeliveryReport.doneAt) + && Objects.equals(this.messageCount, smsDeliveryReport.messageCount) + && Objects.equals(this.mccMnc, smsDeliveryReport.mccMnc) + && Objects.equals(this.callbackData, smsDeliveryReport.callbackData) + && Objects.equals(this.platform, smsDeliveryReport.platform) + && Objects.equals(this.campaignReferenceId, smsDeliveryReport.campaignReferenceId); + } + + @Override + public int hashCode() { + return Objects.hash( + bulkId, + price, + status, + error, + messageId, + to, + sender, + sentAt, + doneAt, + messageCount, + mccMnc, + callbackData, + platform, + campaignReferenceId); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsDeliveryReport {") + .append(newLine) + .append(" bulkId: ") + .append(toIndentedString(bulkId)) + .append(newLine) + .append(" price: ") + .append(toIndentedString(price)) + .append(newLine) + .append(" status: ") + .append(toIndentedString(status)) + .append(newLine) + .append(" error: ") + .append(toIndentedString(error)) + .append(newLine) + .append(" messageId: ") + .append(toIndentedString(messageId)) + .append(newLine) + .append(" to: ") + .append(toIndentedString(to)) + .append(newLine) + .append(" sender: ") + .append(toIndentedString(sender)) + .append(newLine) + .append(" sentAt: ") + .append(toIndentedString(sentAt)) + .append(newLine) + .append(" doneAt: ") + .append(toIndentedString(doneAt)) + .append(newLine) + .append(" messageCount: ") + .append(toIndentedString(messageCount)) + .append(newLine) + .append(" mccMnc: ") + .append(toIndentedString(mccMnc)) + .append(newLine) + .append(" callbackData: ") + .append(toIndentedString(callbackData)) + .append(newLine) + .append(" platform: ") + .append(toIndentedString(platform)) + .append(newLine) + .append(" campaignReferenceId: ") + .append(toIndentedString(campaignReferenceId)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/SmsDeliveryReports.java b/src/main/java/com/infobip/model/SmsDeliveryReports.java new file mode 100644 index 0000000..c417d6a --- /dev/null +++ b/src/main/java/com/infobip/model/SmsDeliveryReports.java @@ -0,0 +1,119 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Represents SmsDeliveryReports model. + */ +public class SmsDeliveryReports { + + private List results = null; + + /** + * Sets results. + *

+ * Field description: + * Collection of reports, one per every message. + * + * @param results + * @return This {@link SmsDeliveryReports instance}. + */ + public SmsDeliveryReports results(List results) { + this.results = results; + return this; + } + + /** + * Adds and item into results. + *

+ * Field description: + * Collection of reports, one per every message. + * + * @param resultsItem The item to be added to the list. + * @return This {@link SmsDeliveryReports instance}. + */ + public SmsDeliveryReports addResultsItem(SmsDeliveryReport resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Returns results. + *

+ * Field description: + * Collection of reports, one per every message. + * + * @return results + */ + @JsonProperty("results") + public List getResults() { + return results; + } + + /** + * Sets results. + *

+ * Field description: + * Collection of reports, one per every message. + * + * @param results + */ + @JsonProperty("results") + public void setResults(List results) { + this.results = results; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsDeliveryReports smsDeliveryReports = (SmsDeliveryReports) o; + return Objects.equals(this.results, smsDeliveryReports.results); + } + + @Override + public int hashCode() { + return Objects.hash(results); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsDeliveryReports {") + .append(newLine) + .append(" results: ") + .append(toIndentedString(results)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/SmsDeliveryTimeFrom.java b/src/main/java/com/infobip/model/SmsDeliveryTimeFrom.java deleted file mode 100644 index c17cff2..0000000 --- a/src/main/java/com/infobip/model/SmsDeliveryTimeFrom.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Objects; - -/** - * The exact time of day to start sending messages. Time is expressed in the UTC time zone. If set, use it together with the `to` property with minimum 1 hour difference. - */ -public class SmsDeliveryTimeFrom { - - private Integer hour; - - private Integer minute; - - /** - * Sets hour. - *

- * Field description: - * Hour when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @param hour - * @return This {@link SmsDeliveryTimeFrom instance}. - */ - public SmsDeliveryTimeFrom hour(Integer hour) { - this.hour = hour; - return this; - } - - /** - * Returns hour. - *

- * Field description: - * Hour when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @return hour - */ - @JsonProperty("hour") - public Integer getHour() { - return hour; - } - - /** - * Sets hour. - *

- * Field description: - * Hour when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @param hour - */ - @JsonProperty("hour") - public void setHour(Integer hour) { - this.hour = hour; - } - - /** - * Sets minute. - *

- * Field description: - * Minute when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @param minute - * @return This {@link SmsDeliveryTimeFrom instance}. - */ - public SmsDeliveryTimeFrom minute(Integer minute) { - this.minute = minute; - return this; - } - - /** - * Returns minute. - *

- * Field description: - * Minute when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @return minute - */ - @JsonProperty("minute") - public Integer getMinute() { - return minute; - } - - /** - * Sets minute. - *

- * Field description: - * Minute when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @param minute - */ - @JsonProperty("minute") - public void setMinute(Integer minute) { - this.minute = minute; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsDeliveryTimeFrom smsDeliveryTimeFrom = (SmsDeliveryTimeFrom) o; - return Objects.equals(this.hour, smsDeliveryTimeFrom.hour) - && Objects.equals(this.minute, smsDeliveryTimeFrom.minute); - } - - @Override - public int hashCode() { - return Objects.hash(hour, minute); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class SmsDeliveryTimeFrom {") - .append(newLine) - .append(" hour: ") - .append(toIndentedString(hour)) - .append(newLine) - .append(" minute: ") - .append(toIndentedString(minute)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/SmsDeliveryTimeTo.java b/src/main/java/com/infobip/model/SmsDeliveryTimeTo.java deleted file mode 100644 index e614b60..0000000 --- a/src/main/java/com/infobip/model/SmsDeliveryTimeTo.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Objects; - -/** - * The exact time of day to end sending messages. Time is expressed in the UTC time zone. If set, use it together with the `from` property with minimum 1 hour difference. - */ -public class SmsDeliveryTimeTo { - - private Integer hour; - - private Integer minute; - - /** - * Sets hour. - *

- * Field description: - * Hour when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @param hour - * @return This {@link SmsDeliveryTimeTo instance}. - */ - public SmsDeliveryTimeTo hour(Integer hour) { - this.hour = hour; - return this; - } - - /** - * Returns hour. - *

- * Field description: - * Hour when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @return hour - */ - @JsonProperty("hour") - public Integer getHour() { - return hour; - } - - /** - * Sets hour. - *

- * Field description: - * Hour when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @param hour - */ - @JsonProperty("hour") - public void setHour(Integer hour) { - this.hour = hour; - } - - /** - * Sets minute. - *

- * Field description: - * Minute when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @param minute - * @return This {@link SmsDeliveryTimeTo instance}. - */ - public SmsDeliveryTimeTo minute(Integer minute) { - this.minute = minute; - return this; - } - - /** - * Returns minute. - *

- * Field description: - * Minute when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @return minute - */ - @JsonProperty("minute") - public Integer getMinute() { - return minute; - } - - /** - * Sets minute. - *

- * Field description: - * Minute when the time window opens when used in the `from` property or closes when used in the `to` property. - *

- * The field is required. - * - * @param minute - */ - @JsonProperty("minute") - public void setMinute(Integer minute) { - this.minute = minute; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsDeliveryTimeTo smsDeliveryTimeTo = (SmsDeliveryTimeTo) o; - return Objects.equals(this.hour, smsDeliveryTimeTo.hour) - && Objects.equals(this.minute, smsDeliveryTimeTo.minute); - } - - @Override - public int hashCode() { - return Objects.hash(hour, minute); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class SmsDeliveryTimeTo {") - .append(newLine) - .append(" hour: ") - .append(toIndentedString(hour)) - .append(newLine) - .append(" minute: ") - .append(toIndentedString(minute)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/SmsDeliveryTimeWindow.java b/src/main/java/com/infobip/model/SmsDeliveryTimeWindow.java deleted file mode 100644 index ac2436c..0000000 --- a/src/main/java/com/infobip/model/SmsDeliveryTimeWindow.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * Sets specific SMS delivery window outside of which messages won't be delivered. Often, used when there are restrictions on when messages can be sent. - */ -public class SmsDeliveryTimeWindow { - - private List days = new ArrayList<>(); - - private SmsDeliveryTimeFrom from; - - private SmsDeliveryTimeTo to; - - /** - * Sets days. - *

- * Field description: - * Days of the week which are included in the delivery time window. At least one day must be provided. Separate multiple days with a comma. - *

- * The field is required. - * - * @param days - * @return This {@link SmsDeliveryTimeWindow instance}. - */ - public SmsDeliveryTimeWindow days(List days) { - this.days = days; - return this; - } - - /** - * Adds and item into days. - *

- * Field description: - * Days of the week which are included in the delivery time window. At least one day must be provided. Separate multiple days with a comma. - *

- * The field is required. - * - * @param daysItem The item to be added to the list. - * @return This {@link SmsDeliveryTimeWindow instance}. - */ - public SmsDeliveryTimeWindow addDaysItem(SmsDeliveryDay daysItem) { - if (this.days == null) { - this.days = new ArrayList<>(); - } - this.days.add(daysItem); - return this; - } - - /** - * Returns days. - *

- * Field description: - * Days of the week which are included in the delivery time window. At least one day must be provided. Separate multiple days with a comma. - *

- * The field is required. - * - * @return days - */ - @JsonProperty("days") - public List getDays() { - return days; - } - - /** - * Sets days. - *

- * Field description: - * Days of the week which are included in the delivery time window. At least one day must be provided. Separate multiple days with a comma. - *

- * The field is required. - * - * @param days - */ - @JsonProperty("days") - public void setDays(List days) { - this.days = days; - } - - /** - * Sets from. - * - * @param from - * @return This {@link SmsDeliveryTimeWindow instance}. - */ - public SmsDeliveryTimeWindow from(SmsDeliveryTimeFrom from) { - this.from = from; - return this; - } - - /** - * Returns from. - * - * @return from - */ - @JsonProperty("from") - public SmsDeliveryTimeFrom getFrom() { - return from; - } - - /** - * Sets from. - * - * @param from - */ - @JsonProperty("from") - public void setFrom(SmsDeliveryTimeFrom from) { - this.from = from; - } - - /** - * Sets to. - * - * @param to - * @return This {@link SmsDeliveryTimeWindow instance}. - */ - public SmsDeliveryTimeWindow to(SmsDeliveryTimeTo to) { - this.to = to; - return this; - } - - /** - * Returns to. - * - * @return to - */ - @JsonProperty("to") - public SmsDeliveryTimeTo getTo() { - return to; - } - - /** - * Sets to. - * - * @param to - */ - @JsonProperty("to") - public void setTo(SmsDeliveryTimeTo to) { - this.to = to; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsDeliveryTimeWindow smsDeliveryTimeWindow = (SmsDeliveryTimeWindow) o; - return Objects.equals(this.days, smsDeliveryTimeWindow.days) - && Objects.equals(this.from, smsDeliveryTimeWindow.from) - && Objects.equals(this.to, smsDeliveryTimeWindow.to); - } - - @Override - public int hashCode() { - return Objects.hash(days, from, to); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class SmsDeliveryTimeWindow {") - .append(newLine) - .append(" days: ") - .append(toIndentedString(days)) - .append(newLine) - .append(" from: ") - .append(toIndentedString(from)) - .append(newLine) - .append(" to: ") - .append(toIndentedString(to)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/SmsDestination.java b/src/main/java/com/infobip/model/SmsDestination.java index befaf3b..b8d6193 100644 --- a/src/main/java/com/infobip/model/SmsDestination.java +++ b/src/main/java/com/infobip/model/SmsDestination.java @@ -17,9 +17,57 @@ */ public class SmsDestination { + private String to; + private String messageId; - private String to; + private Integer networkId; + + /** + * Sets to. + *

+ * Field description: + * The destination address of the message. + *

+ * The field is required. + * + * @param to + * @return This {@link SmsDestination instance}. + */ + public SmsDestination to(String to) { + this.to = to; + return this; + } + + /** + * Returns to. + *

+ * Field description: + * The destination address of the message. + *

+ * The field is required. + * + * @return to + */ + @JsonProperty("to") + public String getTo() { + return to; + } + + /** + * Sets to. + *

+ * Field description: + * The destination address of the message. + *

+ * The field is required. + * + * @param to + */ + @JsonProperty("to") + public void setTo(String to) { + this.to = to; + } /** * Sets messageId. @@ -62,49 +110,43 @@ public void setMessageId(String messageId) { } /** - * Sets to. + * Sets networkId. *

* Field description: - * Message destination address. Addresses must be in international format (Example: `41793026727`). - *

- * The field is required. + * Available in US and Canada only if networkId is known for Network Operator of the destination. Returned in [SMS message delivery reports](https://www.infobip.com/docs/api/channels/sms/sms-messaging/logs-and-status-reports) and [Inbound SMS](https://www.infobip.com/docs/api/channels/sms/sms-messaging/inbound-sms); contact Infobip Support to enable. * - * @param to + * @param networkId * @return This {@link SmsDestination instance}. */ - public SmsDestination to(String to) { - this.to = to; + public SmsDestination networkId(Integer networkId) { + this.networkId = networkId; return this; } /** - * Returns to. + * Returns networkId. *

* Field description: - * Message destination address. Addresses must be in international format (Example: `41793026727`). - *

- * The field is required. + * Available in US and Canada only if networkId is known for Network Operator of the destination. Returned in [SMS message delivery reports](https://www.infobip.com/docs/api/channels/sms/sms-messaging/logs-and-status-reports) and [Inbound SMS](https://www.infobip.com/docs/api/channels/sms/sms-messaging/inbound-sms); contact Infobip Support to enable. * - * @return to + * @return networkId */ - @JsonProperty("to") - public String getTo() { - return to; + @JsonProperty("networkId") + public Integer getNetworkId() { + return networkId; } /** - * Sets to. + * Sets networkId. *

* Field description: - * Message destination address. Addresses must be in international format (Example: `41793026727`). - *

- * The field is required. + * Available in US and Canada only if networkId is known for Network Operator of the destination. Returned in [SMS message delivery reports](https://www.infobip.com/docs/api/channels/sms/sms-messaging/logs-and-status-reports) and [Inbound SMS](https://www.infobip.com/docs/api/channels/sms/sms-messaging/inbound-sms); contact Infobip Support to enable. * - * @param to + * @param networkId */ - @JsonProperty("to") - public void setTo(String to) { - this.to = to; + @JsonProperty("networkId") + public void setNetworkId(Integer networkId) { + this.networkId = networkId; } @Override @@ -116,12 +158,14 @@ public boolean equals(Object o) { return false; } SmsDestination smsDestination = (SmsDestination) o; - return Objects.equals(this.messageId, smsDestination.messageId) && Objects.equals(this.to, smsDestination.to); + return Objects.equals(this.to, smsDestination.to) + && Objects.equals(this.messageId, smsDestination.messageId) + && Objects.equals(this.networkId, smsDestination.networkId); } @Override public int hashCode() { - return Objects.hash(messageId, to); + return Objects.hash(to, messageId, networkId); } @Override @@ -130,11 +174,14 @@ public String toString() { return new StringBuilder() .append("class SmsDestination {") .append(newLine) + .append(" to: ") + .append(toIndentedString(to)) + .append(newLine) .append(" messageId: ") .append(toIndentedString(messageId)) .append(newLine) - .append(" to: ") - .append(toIndentedString(to)) + .append(" networkId: ") + .append(toIndentedString(networkId)) .append(newLine) .append("}") .toString(); diff --git a/src/main/java/com/infobip/model/MmsDeliveryDay.java b/src/main/java/com/infobip/model/SmsLanguageCode.java similarity index 64% rename from src/main/java/com/infobip/model/MmsDeliveryDay.java rename to src/main/java/com/infobip/model/SmsLanguageCode.java index f220064..9ff36f2 100644 --- a/src/main/java/com/infobip/model/MmsDeliveryDay.java +++ b/src/main/java/com/infobip/model/SmsLanguageCode.java @@ -13,20 +13,18 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * Days of the week which are included in the delivery time window. At least one day must be provided. + * Language code for the correct character set. Possible values: `TR` for Turkish, `ES` for Spanish, `PT` for Portuguese, or `AUTODETECT` to let platform select the character set based on message content. */ -public enum MmsDeliveryDay { - MONDAY("MONDAY"), - TUESDAY("TUESDAY"), - WEDNESDAY("WEDNESDAY"), - THURSDAY("THURSDAY"), - FRIDAY("FRIDAY"), - SATURDAY("SATURDAY"), - SUNDAY("SUNDAY"); +public enum SmsLanguageCode { + NONE("NONE"), + TR("TR"), + ES("ES"), + PT("PT"), + AUTODETECT("AUTODETECT"); private final String value; - MmsDeliveryDay(String value) { + SmsLanguageCode(String value) { this.value = value; } @@ -41,8 +39,8 @@ public String toString() { } @JsonCreator - public static MmsDeliveryDay fromValue(String value) { - for (MmsDeliveryDay enumElement : MmsDeliveryDay.values()) { + public static SmsLanguageCode fromValue(String value) { + for (SmsLanguageCode enumElement : SmsLanguageCode.values()) { if (enumElement.value.equals(value)) { return enumElement; } diff --git a/src/main/java/com/infobip/model/SmsLog.java b/src/main/java/com/infobip/model/SmsLog.java index 7834bcd..ece2cdd 100644 --- a/src/main/java/com/infobip/model/SmsLog.java +++ b/src/main/java/com/infobip/model/SmsLog.java @@ -14,347 +14,316 @@ import java.util.Objects; /** - * Represents SmsLog model. + * An array of message log results, one object per each message log entry. */ public class SmsLog { - private String applicationId; + private String sender; - private String bulkId; - - private OffsetDateTime doneAt; + private String destination; - private String entityId; + private String bulkId; - private MessageError error; + private String messageId; - private String from; + private OffsetDateTime sentAt; - private String mccMnc; + private OffsetDateTime doneAt; - private String messageId; + private Integer messageCount; private MessagePrice price; - private OffsetDateTime sentAt; + private SmsMessageStatus status; - private Integer smsCount; + private SmsMessageError error; - private MessageStatus status; + private SmsPlatform platform; - private String text; + private SmsMessageContent content; - private String to; + private String campaignReferenceId; + + private String mccMnc; /** - * Sets applicationId. + * Sets sender. *

* Field description: - * Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * The sender ID which can be alphanumeric or numeric. * - * @param applicationId + * @param sender * @return This {@link SmsLog instance}. */ - public SmsLog applicationId(String applicationId) { - this.applicationId = applicationId; + public SmsLog sender(String sender) { + this.sender = sender; return this; } /** - * Returns applicationId. + * Returns sender. *

* Field description: - * Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * The sender ID which can be alphanumeric or numeric. * - * @return applicationId + * @return sender */ - @JsonProperty("applicationId") - public String getApplicationId() { - return applicationId; + @JsonProperty("sender") + public String getSender() { + return sender; } /** - * Sets applicationId. + * Sets sender. *

* Field description: - * Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * The sender ID which can be alphanumeric or numeric. * - * @param applicationId + * @param sender */ - @JsonProperty("applicationId") - public void setApplicationId(String applicationId) { - this.applicationId = applicationId; + @JsonProperty("sender") + public void setSender(String sender) { + this.sender = sender; } /** - * Sets bulkId. + * Sets destination. *

* Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. + * Message destination address. * - * @param bulkId + * @param destination * @return This {@link SmsLog instance}. */ - public SmsLog bulkId(String bulkId) { - this.bulkId = bulkId; + public SmsLog destination(String destination) { + this.destination = destination; return this; } /** - * Returns bulkId. + * Returns destination. *

* Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. + * Message destination address. * - * @return bulkId + * @return destination */ - @JsonProperty("bulkId") - public String getBulkId() { - return bulkId; + @JsonProperty("destination") + public String getDestination() { + return destination; } /** - * Sets bulkId. + * Sets destination. *

* Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. + * Message destination address. * - * @param bulkId + * @param destination */ - @JsonProperty("bulkId") - public void setBulkId(String bulkId) { - this.bulkId = bulkId; + @JsonProperty("destination") + public void setDestination(String destination) { + this.destination = destination; } /** - * Sets doneAt. + * Sets bulkId. *

* Field description: - * Date and time when the Infobip services finished processing the message (i.e. delivered to the destination, delivered to the destination network, etc.). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. * - * @param doneAt + * @param bulkId * @return This {@link SmsLog instance}. */ - public SmsLog doneAt(OffsetDateTime doneAt) { - this.doneAt = doneAt; + public SmsLog bulkId(String bulkId) { + this.bulkId = bulkId; return this; } /** - * Returns doneAt. + * Returns bulkId. *

* Field description: - * Date and time when the Infobip services finished processing the message (i.e. delivered to the destination, delivered to the destination network, etc.). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. * - * @return doneAt + * @return bulkId */ - @JsonProperty("doneAt") - public OffsetDateTime getDoneAt() { - return doneAt; + @JsonProperty("bulkId") + public String getBulkId() { + return bulkId; } /** - * Sets doneAt. + * Sets bulkId. *

* Field description: - * Date and time when the Infobip services finished processing the message (i.e. delivered to the destination, delivered to the destination network, etc.). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. * - * @param doneAt + * @param bulkId */ - @JsonProperty("doneAt") - public void setDoneAt(OffsetDateTime doneAt) { - this.doneAt = doneAt; + @JsonProperty("bulkId") + public void setBulkId(String bulkId) { + this.bulkId = bulkId; } /** - * Sets entityId. + * Sets messageId. *

* Field description: - * Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * Unique message ID for which a log is requested. * - * @param entityId + * @param messageId * @return This {@link SmsLog instance}. */ - public SmsLog entityId(String entityId) { - this.entityId = entityId; + public SmsLog messageId(String messageId) { + this.messageId = messageId; return this; } /** - * Returns entityId. + * Returns messageId. *

* Field description: - * Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * Unique message ID for which a log is requested. * - * @return entityId + * @return messageId */ - @JsonProperty("entityId") - public String getEntityId() { - return entityId; + @JsonProperty("messageId") + public String getMessageId() { + return messageId; } /** - * Sets entityId. + * Sets messageId. *

* Field description: - * Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * Unique message ID for which a log is requested. * - * @param entityId - */ - @JsonProperty("entityId") - public void setEntityId(String entityId) { - this.entityId = entityId; - } - - /** - * Sets error. - * - * @param error - * @return This {@link SmsLog instance}. - */ - public SmsLog error(MessageError error) { - this.error = error; - return this; - } - - /** - * Returns error. - * - * @return error - */ - @JsonProperty("error") - public MessageError getError() { - return error; - } - - /** - * Sets error. - * - * @param error + * @param messageId */ - @JsonProperty("error") - public void setError(MessageError error) { - this.error = error; + @JsonProperty("messageId") + public void setMessageId(String messageId) { + this.messageId = messageId; } /** - * Sets from. + * Sets sentAt. *

* Field description: - * Sender ID that can be alphanumeric or numeric. + * Date and time when the message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. * - * @param from + * @param sentAt * @return This {@link SmsLog instance}. */ - public SmsLog from(String from) { - this.from = from; + public SmsLog sentAt(OffsetDateTime sentAt) { + this.sentAt = sentAt; return this; } /** - * Returns from. + * Returns sentAt. *

* Field description: - * Sender ID that can be alphanumeric or numeric. + * Date and time when the message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. * - * @return from + * @return sentAt */ - @JsonProperty("from") - public String getFrom() { - return from; + @JsonProperty("sentAt") + public OffsetDateTime getSentAt() { + return sentAt; } /** - * Sets from. + * Sets sentAt. *

* Field description: - * Sender ID that can be alphanumeric or numeric. + * Date and time when the message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. * - * @param from + * @param sentAt */ - @JsonProperty("from") - public void setFrom(String from) { - this.from = from; + @JsonProperty("sentAt") + public void setSentAt(OffsetDateTime sentAt) { + this.sentAt = sentAt; } /** - * Sets mccMnc. + * Sets doneAt. *

* Field description: - * Mobile country and network codes. + * Date and time when the Infobip services finished processing the message (i.e., delivered to the destination, network, etc.). Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. * - * @param mccMnc + * @param doneAt * @return This {@link SmsLog instance}. */ - public SmsLog mccMnc(String mccMnc) { - this.mccMnc = mccMnc; + public SmsLog doneAt(OffsetDateTime doneAt) { + this.doneAt = doneAt; return this; } /** - * Returns mccMnc. + * Returns doneAt. *

* Field description: - * Mobile country and network codes. + * Date and time when the Infobip services finished processing the message (i.e., delivered to the destination, network, etc.). Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. * - * @return mccMnc + * @return doneAt */ - @JsonProperty("mccMnc") - public String getMccMnc() { - return mccMnc; + @JsonProperty("doneAt") + public OffsetDateTime getDoneAt() { + return doneAt; } /** - * Sets mccMnc. + * Sets doneAt. *

* Field description: - * Mobile country and network codes. + * Date and time when the Infobip services finished processing the message (i.e., delivered to the destination, network, etc.). Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. * - * @param mccMnc + * @param doneAt */ - @JsonProperty("mccMnc") - public void setMccMnc(String mccMnc) { - this.mccMnc = mccMnc; + @JsonProperty("doneAt") + public void setDoneAt(OffsetDateTime doneAt) { + this.doneAt = doneAt; } /** - * Sets messageId. + * Sets messageCount. *

* Field description: - * Unique message ID. + * The number of messages content was split to. * - * @param messageId + * @param messageCount * @return This {@link SmsLog instance}. */ - public SmsLog messageId(String messageId) { - this.messageId = messageId; + public SmsLog messageCount(Integer messageCount) { + this.messageCount = messageCount; return this; } /** - * Returns messageId. + * Returns messageCount. *

* Field description: - * Unique message ID. + * The number of messages content was split to. * - * @return messageId + * @return messageCount */ - @JsonProperty("messageId") - public String getMessageId() { - return messageId; + @JsonProperty("messageCount") + public Integer getMessageCount() { + return messageCount; } /** - * Sets messageId. + * Sets messageCount. *

* Field description: - * Unique message ID. + * The number of messages content was split to. * - * @param messageId + * @param messageCount */ - @JsonProperty("messageId") - public void setMessageId(String messageId) { - this.messageId = messageId; + @JsonProperty("messageCount") + public void setMessageCount(Integer messageCount) { + this.messageCount = messageCount; } /** @@ -389,194 +358,207 @@ public void setPrice(MessagePrice price) { } /** - * Sets sentAt. - *

- * Field description: - * Date and time when the message was [scheduled](https://www.infobip.com/docs/api#channels/sms/get-scheduled-sms-messages) to be sent. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + * Sets status. * - * @param sentAt + * @param status * @return This {@link SmsLog instance}. */ - public SmsLog sentAt(OffsetDateTime sentAt) { - this.sentAt = sentAt; + public SmsLog status(SmsMessageStatus status) { + this.status = status; return this; } /** - * Returns sentAt. - *

- * Field description: - * Date and time when the message was [scheduled](https://www.infobip.com/docs/api#channels/sms/get-scheduled-sms-messages) to be sent. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + * Returns status. * - * @return sentAt + * @return status */ - @JsonProperty("sentAt") - public OffsetDateTime getSentAt() { - return sentAt; + @JsonProperty("status") + public SmsMessageStatus getStatus() { + return status; } /** - * Sets sentAt. - *

- * Field description: - * Date and time when the message was [scheduled](https://www.infobip.com/docs/api#channels/sms/get-scheduled-sms-messages) to be sent. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. + * Sets status. * - * @param sentAt + * @param status */ - @JsonProperty("sentAt") - public void setSentAt(OffsetDateTime sentAt) { - this.sentAt = sentAt; + @JsonProperty("status") + public void setStatus(SmsMessageStatus status) { + this.status = status; } /** - * Sets smsCount. - *

- * Field description: - * The number of parts the message content was split into. + * Sets error. * - * @param smsCount + * @param error * @return This {@link SmsLog instance}. */ - public SmsLog smsCount(Integer smsCount) { - this.smsCount = smsCount; + public SmsLog error(SmsMessageError error) { + this.error = error; return this; } /** - * Returns smsCount. - *

- * Field description: - * The number of parts the message content was split into. + * Returns error. * - * @return smsCount + * @return error */ - @JsonProperty("smsCount") - public Integer getSmsCount() { - return smsCount; + @JsonProperty("error") + public SmsMessageError getError() { + return error; } /** - * Sets smsCount. - *

- * Field description: - * The number of parts the message content was split into. + * Sets error. * - * @param smsCount + * @param error */ - @JsonProperty("smsCount") - public void setSmsCount(Integer smsCount) { - this.smsCount = smsCount; + @JsonProperty("error") + public void setError(SmsMessageError error) { + this.error = error; } /** - * Sets status. + * Sets platform. * - * @param status + * @param platform * @return This {@link SmsLog instance}. */ - public SmsLog status(MessageStatus status) { - this.status = status; + public SmsLog platform(SmsPlatform platform) { + this.platform = platform; return this; } /** - * Returns status. + * Returns platform. * - * @return status + * @return platform */ - @JsonProperty("status") - public MessageStatus getStatus() { - return status; + @JsonProperty("platform") + public SmsPlatform getPlatform() { + return platform; } /** - * Sets status. + * Sets platform. * - * @param status + * @param platform */ - @JsonProperty("status") - public void setStatus(MessageStatus status) { - this.status = status; + @JsonProperty("platform") + public void setPlatform(SmsPlatform platform) { + this.platform = platform; } /** - * Sets text. + * Sets content. + * + * @param content + * @return This {@link SmsLog instance}. + */ + public SmsLog content(SmsMessageContent content) { + this.content = content; + return this; + } + + /** + * Returns content. + * + * @return content + */ + @JsonProperty("content") + public SmsMessageContent getContent() { + return content; + } + + /** + * Sets content. + * + * @param content + */ + @JsonProperty("content") + public void setContent(SmsMessageContent content) { + this.content = content; + } + + /** + * Sets campaignReferenceId. *

* Field description: - * Content of the message being sent. + * ID of a campaign that was sent in the message. * - * @param text + * @param campaignReferenceId * @return This {@link SmsLog instance}. */ - public SmsLog text(String text) { - this.text = text; + public SmsLog campaignReferenceId(String campaignReferenceId) { + this.campaignReferenceId = campaignReferenceId; return this; } /** - * Returns text. + * Returns campaignReferenceId. *

* Field description: - * Content of the message being sent. + * ID of a campaign that was sent in the message. * - * @return text + * @return campaignReferenceId */ - @JsonProperty("text") - public String getText() { - return text; + @JsonProperty("campaignReferenceId") + public String getCampaignReferenceId() { + return campaignReferenceId; } /** - * Sets text. + * Sets campaignReferenceId. *

* Field description: - * Content of the message being sent. + * ID of a campaign that was sent in the message. * - * @param text + * @param campaignReferenceId */ - @JsonProperty("text") - public void setText(String text) { - this.text = text; + @JsonProperty("campaignReferenceId") + public void setCampaignReferenceId(String campaignReferenceId) { + this.campaignReferenceId = campaignReferenceId; } /** - * Sets to. + * Sets mccMnc. *

* Field description: - * The destination address of the message. + * Mobile country and network codes. * - * @param to + * @param mccMnc * @return This {@link SmsLog instance}. */ - public SmsLog to(String to) { - this.to = to; + public SmsLog mccMnc(String mccMnc) { + this.mccMnc = mccMnc; return this; } /** - * Returns to. + * Returns mccMnc. *

* Field description: - * The destination address of the message. + * Mobile country and network codes. * - * @return to + * @return mccMnc */ - @JsonProperty("to") - public String getTo() { - return to; + @JsonProperty("mccMnc") + public String getMccMnc() { + return mccMnc; } /** - * Sets to. + * Sets mccMnc. *

* Field description: - * The destination address of the message. + * Mobile country and network codes. * - * @param to + * @param mccMnc */ - @JsonProperty("to") - public void setTo(String to) { - this.to = to; + @JsonProperty("mccMnc") + public void setMccMnc(String mccMnc) { + this.mccMnc = mccMnc; } @Override @@ -588,39 +570,39 @@ public boolean equals(Object o) { return false; } SmsLog smsLog = (SmsLog) o; - return Objects.equals(this.applicationId, smsLog.applicationId) + return Objects.equals(this.sender, smsLog.sender) + && Objects.equals(this.destination, smsLog.destination) && Objects.equals(this.bulkId, smsLog.bulkId) - && Objects.equals(this.doneAt, smsLog.doneAt) - && Objects.equals(this.entityId, smsLog.entityId) - && Objects.equals(this.error, smsLog.error) - && Objects.equals(this.from, smsLog.from) - && Objects.equals(this.mccMnc, smsLog.mccMnc) && Objects.equals(this.messageId, smsLog.messageId) - && Objects.equals(this.price, smsLog.price) && Objects.equals(this.sentAt, smsLog.sentAt) - && Objects.equals(this.smsCount, smsLog.smsCount) + && Objects.equals(this.doneAt, smsLog.doneAt) + && Objects.equals(this.messageCount, smsLog.messageCount) + && Objects.equals(this.price, smsLog.price) && Objects.equals(this.status, smsLog.status) - && Objects.equals(this.text, smsLog.text) - && Objects.equals(this.to, smsLog.to); + && Objects.equals(this.error, smsLog.error) + && Objects.equals(this.platform, smsLog.platform) + && Objects.equals(this.content, smsLog.content) + && Objects.equals(this.campaignReferenceId, smsLog.campaignReferenceId) + && Objects.equals(this.mccMnc, smsLog.mccMnc); } @Override public int hashCode() { return Objects.hash( - applicationId, + sender, + destination, bulkId, - doneAt, - entityId, - error, - from, - mccMnc, messageId, - price, sentAt, - smsCount, + doneAt, + messageCount, + price, status, - text, - to); + error, + platform, + content, + campaignReferenceId, + mccMnc); } @Override @@ -629,47 +611,47 @@ public String toString() { return new StringBuilder() .append("class SmsLog {") .append(newLine) - .append(" applicationId: ") - .append(toIndentedString(applicationId)) + .append(" sender: ") + .append(toIndentedString(sender)) + .append(newLine) + .append(" destination: ") + .append(toIndentedString(destination)) .append(newLine) .append(" bulkId: ") .append(toIndentedString(bulkId)) .append(newLine) - .append(" doneAt: ") - .append(toIndentedString(doneAt)) - .append(newLine) - .append(" entityId: ") - .append(toIndentedString(entityId)) - .append(newLine) - .append(" error: ") - .append(toIndentedString(error)) - .append(newLine) - .append(" from: ") - .append(toIndentedString(from)) - .append(newLine) - .append(" mccMnc: ") - .append(toIndentedString(mccMnc)) - .append(newLine) .append(" messageId: ") .append(toIndentedString(messageId)) .append(newLine) - .append(" price: ") - .append(toIndentedString(price)) - .append(newLine) .append(" sentAt: ") .append(toIndentedString(sentAt)) .append(newLine) - .append(" smsCount: ") - .append(toIndentedString(smsCount)) + .append(" doneAt: ") + .append(toIndentedString(doneAt)) + .append(newLine) + .append(" messageCount: ") + .append(toIndentedString(messageCount)) + .append(newLine) + .append(" price: ") + .append(toIndentedString(price)) .append(newLine) .append(" status: ") .append(toIndentedString(status)) .append(newLine) - .append(" text: ") - .append(toIndentedString(text)) + .append(" error: ") + .append(toIndentedString(error)) + .append(newLine) + .append(" platform: ") + .append(toIndentedString(platform)) .append(newLine) - .append(" to: ") - .append(toIndentedString(to)) + .append(" content: ") + .append(toIndentedString(content)) + .append(newLine) + .append(" campaignReferenceId: ") + .append(toIndentedString(campaignReferenceId)) + .append(newLine) + .append(" mccMnc: ") + .append(toIndentedString(mccMnc)) .append(newLine) .append("}") .toString(); diff --git a/src/main/java/com/infobip/model/SmsLogsResponse.java b/src/main/java/com/infobip/model/SmsLogsResponse.java index 04e277a..3236f90 100644 --- a/src/main/java/com/infobip/model/SmsLogsResponse.java +++ b/src/main/java/com/infobip/model/SmsLogsResponse.java @@ -25,7 +25,7 @@ public class SmsLogsResponse { * Sets results. *

* Field description: - * Collection of logs. + * An array of message log results, one object per each message log entry. * * @param results * @return This {@link SmsLogsResponse instance}. @@ -39,7 +39,7 @@ public SmsLogsResponse results(List results) { * Adds and item into results. *

* Field description: - * Collection of logs. + * An array of message log results, one object per each message log entry. * * @param resultsItem The item to be added to the list. * @return This {@link SmsLogsResponse instance}. @@ -56,7 +56,7 @@ public SmsLogsResponse addResultsItem(SmsLog resultsItem) { * Returns results. *

* Field description: - * Collection of logs. + * An array of message log results, one object per each message log entry. * * @return results */ @@ -69,7 +69,7 @@ public List getResults() { * Sets results. *

* Field description: - * Collection of logs. + * An array of message log results, one object per each message log entry. * * @param results */ diff --git a/src/main/java/com/infobip/model/SmsMessage.java b/src/main/java/com/infobip/model/SmsMessage.java new file mode 100644 index 0000000..f86b023 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsMessage.java @@ -0,0 +1,296 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * An array of message objects of a single message or multiple messages sent under one bulk ID. + */ +public class SmsMessage { + + private String sender; + + private List destinations = new ArrayList<>(); + + private SmsMessageContent content; + + private SmsMessageOptions options; + + private SmsWebhooks webhooks; + + /** + * Sets sender. + *

+ * Field description: + * The sender ID. It can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names). + *

+ * The field is required. + * + * @param sender + * @return This {@link SmsMessage instance}. + */ + public SmsMessage sender(String sender) { + this.sender = sender; + return this; + } + + /** + * Returns sender. + *

+ * Field description: + * The sender ID. It can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names). + *

+ * The field is required. + * + * @return sender + */ + @JsonProperty("sender") + public String getSender() { + return sender; + } + + /** + * Sets sender. + *

+ * Field description: + * The sender ID. It can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names). + *

+ * The field is required. + * + * @param sender + */ + @JsonProperty("sender") + public void setSender(String sender) { + this.sender = sender; + } + + /** + * Sets destinations. + *

+ * Field description: + * An array of destination objects for where messages are being sent. A valid destination is required. + *

+ * The field is required. + * + * @param destinations + * @return This {@link SmsMessage instance}. + */ + public SmsMessage destinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Adds and item into destinations. + *

+ * Field description: + * An array of destination objects for where messages are being sent. A valid destination is required. + *

+ * The field is required. + * + * @param destinationsItem The item to be added to the list. + * @return This {@link SmsMessage instance}. + */ + public SmsMessage addDestinationsItem(SmsDestination destinationsItem) { + if (this.destinations == null) { + this.destinations = new ArrayList<>(); + } + this.destinations.add(destinationsItem); + return this; + } + + /** + * Returns destinations. + *

+ * Field description: + * An array of destination objects for where messages are being sent. A valid destination is required. + *

+ * The field is required. + * + * @return destinations + */ + @JsonProperty("destinations") + public List getDestinations() { + return destinations; + } + + /** + * Sets destinations. + *

+ * Field description: + * An array of destination objects for where messages are being sent. A valid destination is required. + *

+ * The field is required. + * + * @param destinations + */ + @JsonProperty("destinations") + public void setDestinations(List destinations) { + this.destinations = destinations; + } + + /** + * Sets content. + *

+ * The field is required. + * + * @param content + * @return This {@link SmsMessage instance}. + */ + public SmsMessage content(SmsMessageContent content) { + this.content = content; + return this; + } + + /** + * Returns content. + *

+ * The field is required. + * + * @return content + */ + @JsonProperty("content") + public SmsMessageContent getContent() { + return content; + } + + /** + * Sets content. + *

+ * The field is required. + * + * @param content + */ + @JsonProperty("content") + public void setContent(SmsMessageContent content) { + this.content = content; + } + + /** + * Sets options. + * + * @param options + * @return This {@link SmsMessage instance}. + */ + public SmsMessage options(SmsMessageOptions options) { + this.options = options; + return this; + } + + /** + * Returns options. + * + * @return options + */ + @JsonProperty("options") + public SmsMessageOptions getOptions() { + return options; + } + + /** + * Sets options. + * + * @param options + */ + @JsonProperty("options") + public void setOptions(SmsMessageOptions options) { + this.options = options; + } + + /** + * Sets webhooks. + * + * @param webhooks + * @return This {@link SmsMessage instance}. + */ + public SmsMessage webhooks(SmsWebhooks webhooks) { + this.webhooks = webhooks; + return this; + } + + /** + * Returns webhooks. + * + * @return webhooks + */ + @JsonProperty("webhooks") + public SmsWebhooks getWebhooks() { + return webhooks; + } + + /** + * Sets webhooks. + * + * @param webhooks + */ + @JsonProperty("webhooks") + public void setWebhooks(SmsWebhooks webhooks) { + this.webhooks = webhooks; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsMessage smsMessage = (SmsMessage) o; + return Objects.equals(this.sender, smsMessage.sender) + && Objects.equals(this.destinations, smsMessage.destinations) + && Objects.equals(this.content, smsMessage.content) + && Objects.equals(this.options, smsMessage.options) + && Objects.equals(this.webhooks, smsMessage.webhooks); + } + + @Override + public int hashCode() { + return Objects.hash(sender, destinations, content, options, webhooks); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsMessage {") + .append(newLine) + .append(" sender: ") + .append(toIndentedString(sender)) + .append(newLine) + .append(" destinations: ") + .append(toIndentedString(destinations)) + .append(newLine) + .append(" content: ") + .append(toIndentedString(content)) + .append(newLine) + .append(" options: ") + .append(toIndentedString(options)) + .append(newLine) + .append(" webhooks: ") + .append(toIndentedString(webhooks)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/SmsMessageContent.java b/src/main/java/com/infobip/model/SmsMessageContent.java new file mode 100644 index 0000000..59f1437 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsMessageContent.java @@ -0,0 +1,12 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +public interface SmsMessageContent {} diff --git a/src/main/java/com/infobip/model/SmsMessageDeliveryReporting.java b/src/main/java/com/infobip/model/SmsMessageDeliveryReporting.java new file mode 100644 index 0000000..0b43a8c --- /dev/null +++ b/src/main/java/com/infobip/model/SmsMessageDeliveryReporting.java @@ -0,0 +1,192 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Provides options for configuring the delivery report behavior. + */ +public class SmsMessageDeliveryReporting { + + private String url; + + private Boolean intermediateReport; + + private Boolean notify; + + /** + * Sets url. + *

+ * Field description: + * The URL on your call back server where a delivery report will be sent. If your URL becomes unavailable then the [retry cycle](https://www.infobip.com/docs/sms/api#notify-url) uses the following formula: `1min + (1min * retryNumber * retryNumber)`. + * + * @param url + * @return This {@link SmsMessageDeliveryReporting instance}. + */ + public SmsMessageDeliveryReporting url(String url) { + this.url = url; + return this; + } + + /** + * Returns url. + *

+ * Field description: + * The URL on your call back server where a delivery report will be sent. If your URL becomes unavailable then the [retry cycle](https://www.infobip.com/docs/sms/api#notify-url) uses the following formula: `1min + (1min * retryNumber * retryNumber)`. + * + * @return url + */ + @JsonProperty("url") + public String getUrl() { + return url; + } + + /** + * Sets url. + *

+ * Field description: + * The URL on your call back server where a delivery report will be sent. If your URL becomes unavailable then the [retry cycle](https://www.infobip.com/docs/sms/api#notify-url) uses the following formula: `1min + (1min * retryNumber * retryNumber)`. + * + * @param url + */ + @JsonProperty("url") + public void setUrl(String url) { + this.url = url; + } + + /** + * Sets intermediateReport. + *

+ * Field description: + * The real-time intermediate delivery report containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`. + * + * @param intermediateReport + * @return This {@link SmsMessageDeliveryReporting instance}. + */ + public SmsMessageDeliveryReporting intermediateReport(Boolean intermediateReport) { + this.intermediateReport = intermediateReport; + return this; + } + + /** + * Returns intermediateReport. + *

+ * Field description: + * The real-time intermediate delivery report containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`. + * + * @return intermediateReport + */ + @JsonProperty("intermediateReport") + public Boolean getIntermediateReport() { + return intermediateReport; + } + + /** + * Sets intermediateReport. + *

+ * Field description: + * The real-time intermediate delivery report containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`. + * + * @param intermediateReport + */ + @JsonProperty("intermediateReport") + public void setIntermediateReport(Boolean intermediateReport) { + this.intermediateReport = intermediateReport; + } + + /** + * Sets notify. + *

+ * Field description: + * Notify enables you to specify your preferences for receiving DLRs. If set to false, no DLR will be sent. Note: When no webhook is specified in the request and notify is set to 'true' or not defined, your Subscription settings will apply. + * + * @param notify + * @return This {@link SmsMessageDeliveryReporting instance}. + */ + public SmsMessageDeliveryReporting notify(Boolean notify) { + this.notify = notify; + return this; + } + + /** + * Returns notify. + *

+ * Field description: + * Notify enables you to specify your preferences for receiving DLRs. If set to false, no DLR will be sent. Note: When no webhook is specified in the request and notify is set to 'true' or not defined, your Subscription settings will apply. + * + * @return notify + */ + @JsonProperty("notify") + public Boolean getNotify() { + return notify; + } + + /** + * Sets notify. + *

+ * Field description: + * Notify enables you to specify your preferences for receiving DLRs. If set to false, no DLR will be sent. Note: When no webhook is specified in the request and notify is set to 'true' or not defined, your Subscription settings will apply. + * + * @param notify + */ + @JsonProperty("notify") + public void setNotify(Boolean notify) { + this.notify = notify; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsMessageDeliveryReporting smsMessageDeliveryReporting = (SmsMessageDeliveryReporting) o; + return Objects.equals(this.url, smsMessageDeliveryReporting.url) + && Objects.equals(this.intermediateReport, smsMessageDeliveryReporting.intermediateReport) + && Objects.equals(this.notify, smsMessageDeliveryReporting.notify); + } + + @Override + public int hashCode() { + return Objects.hash(url, intermediateReport, notify); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsMessageDeliveryReporting {") + .append(newLine) + .append(" url: ") + .append(toIndentedString(url)) + .append(newLine) + .append(" intermediateReport: ") + .append(toIndentedString(intermediateReport)) + .append(newLine) + .append(" notify: ") + .append(toIndentedString(notify)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/SmsMessageError.java b/src/main/java/com/infobip/model/SmsMessageError.java new file mode 100644 index 0000000..9e14b5d --- /dev/null +++ b/src/main/java/com/infobip/model/SmsMessageError.java @@ -0,0 +1,321 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Indicates whether an [error](https://www.infobip.com/docs/essentials/response-status-and-error-codes#error-codes) occurred during the query execution. + */ +public class SmsMessageError { + + private Integer groupId; + + private SmsMessageErrorGroup groupName; + + private Integer id; + + private String name; + + private String description; + + private Boolean permanent; + + /** + * Sets groupId. + *

+ * Field description: + * Error group ID. + * + * @param groupId + * @return This {@link SmsMessageError instance}. + */ + public SmsMessageError groupId(Integer groupId) { + this.groupId = groupId; + return this; + } + + /** + * Returns groupId. + *

+ * Field description: + * Error group ID. + * + * @return groupId + */ + @JsonProperty("groupId") + public Integer getGroupId() { + return groupId; + } + + /** + * Sets groupId. + *

+ * Field description: + * Error group ID. + * + * @param groupId + */ + @JsonProperty("groupId") + public void setGroupId(Integer groupId) { + this.groupId = groupId; + } + + /** + * Sets groupName. + * + * @param groupName + * @return This {@link SmsMessageError instance}. + */ + public SmsMessageError groupName(SmsMessageErrorGroup groupName) { + this.groupName = groupName; + return this; + } + + /** + * Returns groupName. + * + * @return groupName + */ + @JsonProperty("groupName") + public SmsMessageErrorGroup getGroupName() { + return groupName; + } + + /** + * Sets groupName. + * + * @param groupName + */ + @JsonProperty("groupName") + public void setGroupName(SmsMessageErrorGroup groupName) { + this.groupName = groupName; + } + + /** + * Sets id. + *

+ * Field description: + * Error ID. + * + * @param id + * @return This {@link SmsMessageError instance}. + */ + public SmsMessageError id(Integer id) { + this.id = id; + return this; + } + + /** + * Returns id. + *

+ * Field description: + * Error ID. + * + * @return id + */ + @JsonProperty("id") + public Integer getId() { + return id; + } + + /** + * Sets id. + *

+ * Field description: + * Error ID. + * + * @param id + */ + @JsonProperty("id") + public void setId(Integer id) { + this.id = id; + } + + /** + * Sets name. + *

+ * Field description: + * [Error name](https://www.infobip.com/docs/essentials/response-status-and-error-codes#error-codes). + * + * @param name + * @return This {@link SmsMessageError instance}. + */ + public SmsMessageError name(String name) { + this.name = name; + return this; + } + + /** + * Returns name. + *

+ * Field description: + * [Error name](https://www.infobip.com/docs/essentials/response-status-and-error-codes#error-codes). + * + * @return name + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * Sets name. + *

+ * Field description: + * [Error name](https://www.infobip.com/docs/essentials/response-status-and-error-codes#error-codes). + * + * @param name + */ + @JsonProperty("name") + public void setName(String name) { + this.name = name; + } + + /** + * Sets description. + *

+ * Field description: + * Human-readable description of the error. + * + * @param description + * @return This {@link SmsMessageError instance}. + */ + public SmsMessageError description(String description) { + this.description = description; + return this; + } + + /** + * Returns description. + *

+ * Field description: + * Human-readable description of the error. + * + * @return description + */ + @JsonProperty("description") + public String getDescription() { + return description; + } + + /** + * Sets description. + *

+ * Field description: + * Human-readable description of the error. + * + * @param description + */ + @JsonProperty("description") + public void setDescription(String description) { + this.description = description; + } + + /** + * Sets permanent. + *

+ * Field description: + * Indicates whether the error is recoverable or not. + * + * @param permanent + * @return This {@link SmsMessageError instance}. + */ + public SmsMessageError permanent(Boolean permanent) { + this.permanent = permanent; + return this; + } + + /** + * Returns permanent. + *

+ * Field description: + * Indicates whether the error is recoverable or not. + * + * @return permanent + */ + @JsonProperty("permanent") + public Boolean getPermanent() { + return permanent; + } + + /** + * Sets permanent. + *

+ * Field description: + * Indicates whether the error is recoverable or not. + * + * @param permanent + */ + @JsonProperty("permanent") + public void setPermanent(Boolean permanent) { + this.permanent = permanent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsMessageError smsMessageError = (SmsMessageError) o; + return Objects.equals(this.groupId, smsMessageError.groupId) + && Objects.equals(this.groupName, smsMessageError.groupName) + && Objects.equals(this.id, smsMessageError.id) + && Objects.equals(this.name, smsMessageError.name) + && Objects.equals(this.description, smsMessageError.description) + && Objects.equals(this.permanent, smsMessageError.permanent); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, groupName, id, name, description, permanent); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsMessageError {") + .append(newLine) + .append(" groupId: ") + .append(toIndentedString(groupId)) + .append(newLine) + .append(" groupName: ") + .append(toIndentedString(groupName)) + .append(newLine) + .append(" id: ") + .append(toIndentedString(id)) + .append(newLine) + .append(" name: ") + .append(toIndentedString(name)) + .append(newLine) + .append(" description: ") + .append(toIndentedString(description)) + .append(newLine) + .append(" permanent: ") + .append(toIndentedString(permanent)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/CallsDeliveryDay.java b/src/main/java/com/infobip/model/SmsMessageErrorGroup.java similarity index 69% rename from src/main/java/com/infobip/model/CallsDeliveryDay.java rename to src/main/java/com/infobip/model/SmsMessageErrorGroup.java index bb271eb..cfbe642 100644 --- a/src/main/java/com/infobip/model/CallsDeliveryDay.java +++ b/src/main/java/com/infobip/model/SmsMessageErrorGroup.java @@ -13,20 +13,17 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * Represents CallsDeliveryDay enumeration. + * Error group name that describes which category the error code belongs to. */ -public enum CallsDeliveryDay { - MONDAY("MONDAY"), - TUESDAY("TUESDAY"), - WEDNESDAY("WEDNESDAY"), - THURSDAY("THURSDAY"), - FRIDAY("FRIDAY"), - SATURDAY("SATURDAY"), - SUNDAY("SUNDAY"); +public enum SmsMessageErrorGroup { + OK("OK"), + HANDSET_ERRORS("HANDSET_ERRORS"), + USER_ERRORS("USER_ERRORS"), + OPERATOR_ERRORS("OPERATOR_ERRORS"); private final String value; - CallsDeliveryDay(String value) { + SmsMessageErrorGroup(String value) { this.value = value; } @@ -41,8 +38,8 @@ public String toString() { } @JsonCreator - public static CallsDeliveryDay fromValue(String value) { - for (CallsDeliveryDay enumElement : CallsDeliveryDay.values()) { + public static SmsMessageErrorGroup fromValue(String value) { + for (SmsMessageErrorGroup enumElement : SmsMessageErrorGroup.values()) { if (enumElement.value.equals(value)) { return enumElement; } diff --git a/src/main/java/com/infobip/model/SmsMessageGeneralStatus.java b/src/main/java/com/infobip/model/SmsMessageGeneralStatus.java new file mode 100644 index 0000000..5172b96 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsMessageGeneralStatus.java @@ -0,0 +1,51 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Status group name that describes which category the status code belongs to, i.e., [PENDING](https://www.infobip.com/docs/essentials/response-status-and-error-codes#pending-general-status-codes), [UNDELIVERABLE](https://www.infobip.com/docs/essentials/response-status-and-error-codes#undeliverable-general-status-codes), [DELIVERED](https://www.infobip.com/docs/essentials/response-status-and-error-codes#delivered-general-status-codes), [EXPIRED](https://www.infobip.com/docs/essentials/response-status-and-error-codes#expired-general-status-codes), [REJECTED](https://www.infobip.com/docs/essentials/response-status-and-error-codes#rejected-general-status-codes). + */ +public enum SmsMessageGeneralStatus { + ACCEPTED("ACCEPTED"), + PENDING("PENDING"), + UNDELIVERABLE("UNDELIVERABLE"), + DELIVERED("DELIVERED"), + EXPIRED("EXPIRED"), + REJECTED("REJECTED"); + + private final String value; + + SmsMessageGeneralStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SmsMessageGeneralStatus fromValue(String value) { + for (SmsMessageGeneralStatus enumElement : SmsMessageGeneralStatus.values()) { + if (enumElement.value.equals(value)) { + return enumElement; + } + } + throw new IllegalArgumentException("Unexpected enum value '" + value + "'."); + } +} diff --git a/src/main/java/com/infobip/model/SmsMessageOptions.java b/src/main/java/com/infobip/model/SmsMessageOptions.java new file mode 100644 index 0000000..bb21ab5 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsMessageOptions.java @@ -0,0 +1,294 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Message options. + */ +public class SmsMessageOptions { + + private SmsPlatform platform; + + private SmsValidityPeriod validityPeriod; + + private DeliveryTimeWindow deliveryTimeWindow; + + private String campaignReferenceId; + + private SmsRegionalOptions regional; + + private Boolean flash; + + /** + * Sets platform. + * + * @param platform + * @return This {@link SmsMessageOptions instance}. + */ + public SmsMessageOptions platform(SmsPlatform platform) { + this.platform = platform; + return this; + } + + /** + * Returns platform. + * + * @return platform + */ + @JsonProperty("platform") + public SmsPlatform getPlatform() { + return platform; + } + + /** + * Sets platform. + * + * @param platform + */ + @JsonProperty("platform") + public void setPlatform(SmsPlatform platform) { + this.platform = platform; + } + + /** + * Sets validityPeriod. + * + * @param validityPeriod + * @return This {@link SmsMessageOptions instance}. + */ + public SmsMessageOptions validityPeriod(SmsValidityPeriod validityPeriod) { + this.validityPeriod = validityPeriod; + return this; + } + + /** + * Returns validityPeriod. + * + * @return validityPeriod + */ + @JsonProperty("validityPeriod") + public SmsValidityPeriod getValidityPeriod() { + return validityPeriod; + } + + /** + * Sets validityPeriod. + * + * @param validityPeriod + */ + @JsonProperty("validityPeriod") + public void setValidityPeriod(SmsValidityPeriod validityPeriod) { + this.validityPeriod = validityPeriod; + } + + /** + * Sets deliveryTimeWindow. + * + * @param deliveryTimeWindow + * @return This {@link SmsMessageOptions instance}. + */ + public SmsMessageOptions deliveryTimeWindow(DeliveryTimeWindow deliveryTimeWindow) { + this.deliveryTimeWindow = deliveryTimeWindow; + return this; + } + + /** + * Returns deliveryTimeWindow. + * + * @return deliveryTimeWindow + */ + @JsonProperty("deliveryTimeWindow") + public DeliveryTimeWindow getDeliveryTimeWindow() { + return deliveryTimeWindow; + } + + /** + * Sets deliveryTimeWindow. + * + * @param deliveryTimeWindow + */ + @JsonProperty("deliveryTimeWindow") + public void setDeliveryTimeWindow(DeliveryTimeWindow deliveryTimeWindow) { + this.deliveryTimeWindow = deliveryTimeWindow; + } + + /** + * Sets campaignReferenceId. + *

+ * Field description: + * ID that allows you to track, analyze, and show an aggregated overview and the performance of individual campaigns per sending channel. + * + * @param campaignReferenceId + * @return This {@link SmsMessageOptions instance}. + */ + public SmsMessageOptions campaignReferenceId(String campaignReferenceId) { + this.campaignReferenceId = campaignReferenceId; + return this; + } + + /** + * Returns campaignReferenceId. + *

+ * Field description: + * ID that allows you to track, analyze, and show an aggregated overview and the performance of individual campaigns per sending channel. + * + * @return campaignReferenceId + */ + @JsonProperty("campaignReferenceId") + public String getCampaignReferenceId() { + return campaignReferenceId; + } + + /** + * Sets campaignReferenceId. + *

+ * Field description: + * ID that allows you to track, analyze, and show an aggregated overview and the performance of individual campaigns per sending channel. + * + * @param campaignReferenceId + */ + @JsonProperty("campaignReferenceId") + public void setCampaignReferenceId(String campaignReferenceId) { + this.campaignReferenceId = campaignReferenceId; + } + + /** + * Sets regional. + * + * @param regional + * @return This {@link SmsMessageOptions instance}. + */ + public SmsMessageOptions regional(SmsRegionalOptions regional) { + this.regional = regional; + return this; + } + + /** + * Returns regional. + * + * @return regional + */ + @JsonProperty("regional") + public SmsRegionalOptions getRegional() { + return regional; + } + + /** + * Sets regional. + * + * @param regional + */ + @JsonProperty("regional") + public void setRegional(SmsRegionalOptions regional) { + this.regional = regional; + } + + /** + * Sets flash. + *

+ * Field description: + * Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS. + * + * @param flash + * @return This {@link SmsMessageOptions instance}. + */ + public SmsMessageOptions flash(Boolean flash) { + this.flash = flash; + return this; + } + + /** + * Returns flash. + *

+ * Field description: + * Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS. + * + * @return flash + */ + @JsonProperty("flash") + public Boolean getFlash() { + return flash; + } + + /** + * Sets flash. + *

+ * Field description: + * Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS. + * + * @param flash + */ + @JsonProperty("flash") + public void setFlash(Boolean flash) { + this.flash = flash; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsMessageOptions smsMessageOptions = (SmsMessageOptions) o; + return Objects.equals(this.platform, smsMessageOptions.platform) + && Objects.equals(this.validityPeriod, smsMessageOptions.validityPeriod) + && Objects.equals(this.deliveryTimeWindow, smsMessageOptions.deliveryTimeWindow) + && Objects.equals(this.campaignReferenceId, smsMessageOptions.campaignReferenceId) + && Objects.equals(this.regional, smsMessageOptions.regional) + && Objects.equals(this.flash, smsMessageOptions.flash); + } + + @Override + public int hashCode() { + return Objects.hash(platform, validityPeriod, deliveryTimeWindow, campaignReferenceId, regional, flash); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsMessageOptions {") + .append(newLine) + .append(" platform: ") + .append(toIndentedString(platform)) + .append(newLine) + .append(" validityPeriod: ") + .append(toIndentedString(validityPeriod)) + .append(newLine) + .append(" deliveryTimeWindow: ") + .append(toIndentedString(deliveryTimeWindow)) + .append(newLine) + .append(" campaignReferenceId: ") + .append(toIndentedString(campaignReferenceId)) + .append(newLine) + .append(" regional: ") + .append(toIndentedString(regional)) + .append(newLine) + .append(" flash: ") + .append(toIndentedString(flash)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/SmsMessageRequestOptions.java b/src/main/java/com/infobip/model/SmsMessageRequestOptions.java new file mode 100644 index 0000000..7175135 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsMessageRequestOptions.java @@ -0,0 +1,211 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Options applicable to all messages in the request. + */ +public class SmsMessageRequestOptions { + + private SmsRequestSchedulingSettings schedule; + + private SmsUrlOptions tracking; + + private Boolean includeSmsCountInResponse; + + private SmsTracking conversionTracking; + + /** + * Sets schedule. + * + * @param schedule + * @return This {@link SmsMessageRequestOptions instance}. + */ + public SmsMessageRequestOptions schedule(SmsRequestSchedulingSettings schedule) { + this.schedule = schedule; + return this; + } + + /** + * Returns schedule. + * + * @return schedule + */ + @JsonProperty("schedule") + public SmsRequestSchedulingSettings getSchedule() { + return schedule; + } + + /** + * Sets schedule. + * + * @param schedule + */ + @JsonProperty("schedule") + public void setSchedule(SmsRequestSchedulingSettings schedule) { + this.schedule = schedule; + } + + /** + * Sets tracking. + * + * @param tracking + * @return This {@link SmsMessageRequestOptions instance}. + */ + public SmsMessageRequestOptions tracking(SmsUrlOptions tracking) { + this.tracking = tracking; + return this; + } + + /** + * Returns tracking. + * + * @return tracking + */ + @JsonProperty("tracking") + public SmsUrlOptions getTracking() { + return tracking; + } + + /** + * Sets tracking. + * + * @param tracking + */ + @JsonProperty("tracking") + public void setTracking(SmsUrlOptions tracking) { + this.tracking = tracking; + } + + /** + * Sets includeSmsCountInResponse. + *

+ * Field description: + * Set to true to return smsCount in the response. Default is false. smsCount is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. + * + * @param includeSmsCountInResponse + * @return This {@link SmsMessageRequestOptions instance}. + */ + public SmsMessageRequestOptions includeSmsCountInResponse(Boolean includeSmsCountInResponse) { + this.includeSmsCountInResponse = includeSmsCountInResponse; + return this; + } + + /** + * Returns includeSmsCountInResponse. + *

+ * Field description: + * Set to true to return smsCount in the response. Default is false. smsCount is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. + * + * @return includeSmsCountInResponse + */ + @JsonProperty("includeSmsCountInResponse") + public Boolean getIncludeSmsCountInResponse() { + return includeSmsCountInResponse; + } + + /** + * Sets includeSmsCountInResponse. + *

+ * Field description: + * Set to true to return smsCount in the response. Default is false. smsCount is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. + * + * @param includeSmsCountInResponse + */ + @JsonProperty("includeSmsCountInResponse") + public void setIncludeSmsCountInResponse(Boolean includeSmsCountInResponse) { + this.includeSmsCountInResponse = includeSmsCountInResponse; + } + + /** + * Sets conversionTracking. + * + * @param conversionTracking + * @return This {@link SmsMessageRequestOptions instance}. + */ + public SmsMessageRequestOptions conversionTracking(SmsTracking conversionTracking) { + this.conversionTracking = conversionTracking; + return this; + } + + /** + * Returns conversionTracking. + * + * @return conversionTracking + */ + @JsonProperty("conversionTracking") + public SmsTracking getConversionTracking() { + return conversionTracking; + } + + /** + * Sets conversionTracking. + * + * @param conversionTracking + */ + @JsonProperty("conversionTracking") + public void setConversionTracking(SmsTracking conversionTracking) { + this.conversionTracking = conversionTracking; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsMessageRequestOptions smsMessageRequestOptions = (SmsMessageRequestOptions) o; + return Objects.equals(this.schedule, smsMessageRequestOptions.schedule) + && Objects.equals(this.tracking, smsMessageRequestOptions.tracking) + && Objects.equals(this.includeSmsCountInResponse, smsMessageRequestOptions.includeSmsCountInResponse) + && Objects.equals(this.conversionTracking, smsMessageRequestOptions.conversionTracking); + } + + @Override + public int hashCode() { + return Objects.hash(schedule, tracking, includeSmsCountInResponse, conversionTracking); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsMessageRequestOptions {") + .append(newLine) + .append(" schedule: ") + .append(toIndentedString(schedule)) + .append(newLine) + .append(" tracking: ") + .append(toIndentedString(tracking)) + .append(newLine) + .append(" includeSmsCountInResponse: ") + .append(toIndentedString(includeSmsCountInResponse)) + .append(newLine) + .append(" conversionTracking: ") + .append(toIndentedString(conversionTracking)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/SmsMessageResponseDetails.java b/src/main/java/com/infobip/model/SmsMessageResponseDetails.java new file mode 100644 index 0000000..b5fee47 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsMessageResponseDetails.java @@ -0,0 +1,100 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Other details of the message. + */ +public class SmsMessageResponseDetails { + + private Integer messageCount; + + /** + * Sets messageCount. + *

+ * Field description: + * Number of SMS message parts required to deliver the message. + * + * @param messageCount + * @return This {@link SmsMessageResponseDetails instance}. + */ + public SmsMessageResponseDetails messageCount(Integer messageCount) { + this.messageCount = messageCount; + return this; + } + + /** + * Returns messageCount. + *

+ * Field description: + * Number of SMS message parts required to deliver the message. + * + * @return messageCount + */ + @JsonProperty("messageCount") + public Integer getMessageCount() { + return messageCount; + } + + /** + * Sets messageCount. + *

+ * Field description: + * Number of SMS message parts required to deliver the message. + * + * @param messageCount + */ + @JsonProperty("messageCount") + public void setMessageCount(Integer messageCount) { + this.messageCount = messageCount; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsMessageResponseDetails smsMessageResponseDetails = (SmsMessageResponseDetails) o; + return Objects.equals(this.messageCount, smsMessageResponseDetails.messageCount); + } + + @Override + public int hashCode() { + return Objects.hash(messageCount); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsMessageResponseDetails {") + .append(newLine) + .append(" messageCount: ") + .append(toIndentedString(messageCount)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/SmsMessageStatus.java b/src/main/java/com/infobip/model/SmsMessageStatus.java new file mode 100644 index 0000000..7838d00 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsMessageStatus.java @@ -0,0 +1,321 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Indicates the [status](https://www.infobip.com/docs/essentials/response-status-and-error-codes#api-status-codes) of the message and how to recover from an error should there be any. + */ +public class SmsMessageStatus { + + private Integer groupId; + + private SmsMessageGeneralStatus groupName; + + private Integer id; + + private String name; + + private String description; + + private String action; + + /** + * Sets groupId. + *

+ * Field description: + * Status group ID. + * + * @param groupId + * @return This {@link SmsMessageStatus instance}. + */ + public SmsMessageStatus groupId(Integer groupId) { + this.groupId = groupId; + return this; + } + + /** + * Returns groupId. + *

+ * Field description: + * Status group ID. + * + * @return groupId + */ + @JsonProperty("groupId") + public Integer getGroupId() { + return groupId; + } + + /** + * Sets groupId. + *

+ * Field description: + * Status group ID. + * + * @param groupId + */ + @JsonProperty("groupId") + public void setGroupId(Integer groupId) { + this.groupId = groupId; + } + + /** + * Sets groupName. + * + * @param groupName + * @return This {@link SmsMessageStatus instance}. + */ + public SmsMessageStatus groupName(SmsMessageGeneralStatus groupName) { + this.groupName = groupName; + return this; + } + + /** + * Returns groupName. + * + * @return groupName + */ + @JsonProperty("groupName") + public SmsMessageGeneralStatus getGroupName() { + return groupName; + } + + /** + * Sets groupName. + * + * @param groupName + */ + @JsonProperty("groupName") + public void setGroupName(SmsMessageGeneralStatus groupName) { + this.groupName = groupName; + } + + /** + * Sets id. + *

+ * Field description: + * Status code ID. + * + * @param id + * @return This {@link SmsMessageStatus instance}. + */ + public SmsMessageStatus id(Integer id) { + this.id = id; + return this; + } + + /** + * Returns id. + *

+ * Field description: + * Status code ID. + * + * @return id + */ + @JsonProperty("id") + public Integer getId() { + return id; + } + + /** + * Sets id. + *

+ * Field description: + * Status code ID. + * + * @param id + */ + @JsonProperty("id") + public void setId(Integer id) { + this.id = id; + } + + /** + * Sets name. + *

+ * Field description: + * [Status code](https://www.infobip.com/docs/essentials/response-status-and-error-codes#api-status-codes) name. + * + * @param name + * @return This {@link SmsMessageStatus instance}. + */ + public SmsMessageStatus name(String name) { + this.name = name; + return this; + } + + /** + * Returns name. + *

+ * Field description: + * [Status code](https://www.infobip.com/docs/essentials/response-status-and-error-codes#api-status-codes) name. + * + * @return name + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * Sets name. + *

+ * Field description: + * [Status code](https://www.infobip.com/docs/essentials/response-status-and-error-codes#api-status-codes) name. + * + * @param name + */ + @JsonProperty("name") + public void setName(String name) { + this.name = name; + } + + /** + * Sets description. + *

+ * Field description: + * Human-readable description of the status. + * + * @param description + * @return This {@link SmsMessageStatus instance}. + */ + public SmsMessageStatus description(String description) { + this.description = description; + return this; + } + + /** + * Returns description. + *

+ * Field description: + * Human-readable description of the status. + * + * @return description + */ + @JsonProperty("description") + public String getDescription() { + return description; + } + + /** + * Sets description. + *

+ * Field description: + * Human-readable description of the status. + * + * @param description + */ + @JsonProperty("description") + public void setDescription(String description) { + this.description = description; + } + + /** + * Sets action. + *

+ * Field description: + * Action to take to recover from the error. + * + * @param action + * @return This {@link SmsMessageStatus instance}. + */ + public SmsMessageStatus action(String action) { + this.action = action; + return this; + } + + /** + * Returns action. + *

+ * Field description: + * Action to take to recover from the error. + * + * @return action + */ + @JsonProperty("action") + public String getAction() { + return action; + } + + /** + * Sets action. + *

+ * Field description: + * Action to take to recover from the error. + * + * @param action + */ + @JsonProperty("action") + public void setAction(String action) { + this.action = action; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsMessageStatus smsMessageStatus = (SmsMessageStatus) o; + return Objects.equals(this.groupId, smsMessageStatus.groupId) + && Objects.equals(this.groupName, smsMessageStatus.groupName) + && Objects.equals(this.id, smsMessageStatus.id) + && Objects.equals(this.name, smsMessageStatus.name) + && Objects.equals(this.description, smsMessageStatus.description) + && Objects.equals(this.action, smsMessageStatus.action); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, groupName, id, name, description, action); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsMessageStatus {") + .append(newLine) + .append(" groupId: ") + .append(toIndentedString(groupId)) + .append(newLine) + .append(" groupName: ") + .append(toIndentedString(groupName)) + .append(newLine) + .append(" id: ") + .append(toIndentedString(id)) + .append(newLine) + .append(" name: ") + .append(toIndentedString(name)) + .append(newLine) + .append(" description: ") + .append(toIndentedString(description)) + .append(newLine) + .append(" action: ") + .append(toIndentedString(action)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/SmsPlatform.java b/src/main/java/com/infobip/model/SmsPlatform.java new file mode 100644 index 0000000..f4d24a1 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsPlatform.java @@ -0,0 +1,146 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Platform options. For more details, see [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + */ +public class SmsPlatform { + + private String entityId; + + private String applicationId; + + /** + * Sets entityId. + *

+ * Field description: + * Used when specifying an entity in outbound send requests. It is also returned in notification events. For detailed usage, refer to the [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * + * @param entityId + * @return This {@link SmsPlatform instance}. + */ + public SmsPlatform entityId(String entityId) { + this.entityId = entityId; + return this; + } + + /** + * Returns entityId. + *

+ * Field description: + * Used when specifying an entity in outbound send requests. It is also returned in notification events. For detailed usage, refer to the [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * + * @return entityId + */ + @JsonProperty("entityId") + public String getEntityId() { + return entityId; + } + + /** + * Sets entityId. + *

+ * Field description: + * Used when specifying an entity in outbound send requests. It is also returned in notification events. For detailed usage, refer to the [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * + * @param entityId + */ + @JsonProperty("entityId") + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + /** + * Sets applicationId. + *

+ * Field description: + * Used when specifying an application in outbound send requests. It is also returned in notification events. For detailed usage, refer to the [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * + * @param applicationId + * @return This {@link SmsPlatform instance}. + */ + public SmsPlatform applicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Returns applicationId. + *

+ * Field description: + * Used when specifying an application in outbound send requests. It is also returned in notification events. For detailed usage, refer to the [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * + * @return applicationId + */ + @JsonProperty("applicationId") + public String getApplicationId() { + return applicationId; + } + + /** + * Sets applicationId. + *

+ * Field description: + * Used when specifying an application in outbound send requests. It is also returned in notification events. For detailed usage, refer to the [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). + * + * @param applicationId + */ + @JsonProperty("applicationId") + public void setApplicationId(String applicationId) { + this.applicationId = applicationId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsPlatform smsPlatform = (SmsPlatform) o; + return Objects.equals(this.entityId, smsPlatform.entityId) + && Objects.equals(this.applicationId, smsPlatform.applicationId); + } + + @Override + public int hashCode() { + return Objects.hash(entityId, applicationId); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsPlatform {") + .append(newLine) + .append(" entityId: ") + .append(toIndentedString(entityId)) + .append(newLine) + .append(" applicationId: ") + .append(toIndentedString(applicationId)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/SmsReport.java b/src/main/java/com/infobip/model/SmsReport.java index d4aec87..cb2c0e1 100644 --- a/src/main/java/com/infobip/model/SmsReport.java +++ b/src/main/java/com/infobip/model/SmsReport.java @@ -46,6 +46,8 @@ public class SmsReport { private String applicationId; + private String campaignReferenceId; + /** * Sets bulkId. *

@@ -579,6 +581,46 @@ public void setApplicationId(String applicationId) { this.applicationId = applicationId; } + /** + * Sets campaignReferenceId. + *

+ * Field description: + * ID that allows you to track, analyze, and show an aggregated overview and the performance of individual campaigns per sending channel. + * + * @param campaignReferenceId + * @return This {@link SmsReport instance}. + */ + public SmsReport campaignReferenceId(String campaignReferenceId) { + this.campaignReferenceId = campaignReferenceId; + return this; + } + + /** + * Returns campaignReferenceId. + *

+ * Field description: + * ID that allows you to track, analyze, and show an aggregated overview and the performance of individual campaigns per sending channel. + * + * @return campaignReferenceId + */ + @JsonProperty("campaignReferenceId") + public String getCampaignReferenceId() { + return campaignReferenceId; + } + + /** + * Sets campaignReferenceId. + *

+ * Field description: + * ID that allows you to track, analyze, and show an aggregated overview and the performance of individual campaigns per sending channel. + * + * @param campaignReferenceId + */ + @JsonProperty("campaignReferenceId") + public void setCampaignReferenceId(String campaignReferenceId) { + this.campaignReferenceId = campaignReferenceId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -601,7 +643,8 @@ public boolean equals(Object o) { && Objects.equals(this.status, smsReport.status) && Objects.equals(this.error, smsReport.error) && Objects.equals(this.entityId, smsReport.entityId) - && Objects.equals(this.applicationId, smsReport.applicationId); + && Objects.equals(this.applicationId, smsReport.applicationId) + && Objects.equals(this.campaignReferenceId, smsReport.campaignReferenceId); } @Override @@ -620,7 +663,8 @@ public int hashCode() { status, error, entityId, - applicationId); + applicationId, + campaignReferenceId); } @Override @@ -671,6 +715,9 @@ public String toString() { .append(" applicationId: ") .append(toIndentedString(applicationId)) .append(newLine) + .append(" campaignReferenceId: ") + .append(toIndentedString(campaignReferenceId)) + .append(newLine) .append("}") .toString(); } diff --git a/src/main/java/com/infobip/model/SmsRequestEnvelope.java b/src/main/java/com/infobip/model/SmsRequestEnvelope.java new file mode 100644 index 0000000..20e7c66 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsRequestEnvelope.java @@ -0,0 +1,164 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Represents SmsRequestEnvelope model. + */ +public class SmsRequestEnvelope { + + private List messages = new ArrayList<>(); + + private SmsMessageRequestOptions options; + + /** + * Sets messages. + *

+ * Field description: + * An array of message objects of a single message or multiple messages sent under one bulk ID. + *

+ * The field is required. + * + * @param messages + * @return This {@link SmsRequestEnvelope instance}. + */ + public SmsRequestEnvelope messages(List messages) { + this.messages = messages; + return this; + } + + /** + * Adds and item into messages. + *

+ * Field description: + * An array of message objects of a single message or multiple messages sent under one bulk ID. + *

+ * The field is required. + * + * @param messagesItem The item to be added to the list. + * @return This {@link SmsRequestEnvelope instance}. + */ + public SmsRequestEnvelope addMessagesItem(SmsMessage messagesItem) { + if (this.messages == null) { + this.messages = new ArrayList<>(); + } + this.messages.add(messagesItem); + return this; + } + + /** + * Returns messages. + *

+ * Field description: + * An array of message objects of a single message or multiple messages sent under one bulk ID. + *

+ * The field is required. + * + * @return messages + */ + @JsonProperty("messages") + public List getMessages() { + return messages; + } + + /** + * Sets messages. + *

+ * Field description: + * An array of message objects of a single message or multiple messages sent under one bulk ID. + *

+ * The field is required. + * + * @param messages + */ + @JsonProperty("messages") + public void setMessages(List messages) { + this.messages = messages; + } + + /** + * Sets options. + * + * @param options + * @return This {@link SmsRequestEnvelope instance}. + */ + public SmsRequestEnvelope options(SmsMessageRequestOptions options) { + this.options = options; + return this; + } + + /** + * Returns options. + * + * @return options + */ + @JsonProperty("options") + public SmsMessageRequestOptions getOptions() { + return options; + } + + /** + * Sets options. + * + * @param options + */ + @JsonProperty("options") + public void setOptions(SmsMessageRequestOptions options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsRequestEnvelope smsRequestEnvelope = (SmsRequestEnvelope) o; + return Objects.equals(this.messages, smsRequestEnvelope.messages) + && Objects.equals(this.options, smsRequestEnvelope.options); + } + + @Override + public int hashCode() { + return Objects.hash(messages, options); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsRequestEnvelope {") + .append(newLine) + .append(" messages: ") + .append(toIndentedString(messages)) + .append(newLine) + .append(" options: ") + .append(toIndentedString(options)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/SmsAdvancedBinaryRequest.java b/src/main/java/com/infobip/model/SmsRequestSchedulingSettings.java similarity index 53% rename from src/main/java/com/infobip/model/SmsAdvancedBinaryRequest.java rename to src/main/java/com/infobip/model/SmsRequestSchedulingSettings.java index 3419190..9d54b4f 100644 --- a/src/main/java/com/infobip/model/SmsAdvancedBinaryRequest.java +++ b/src/main/java/com/infobip/model/SmsRequestSchedulingSettings.java @@ -10,18 +10,17 @@ package com.infobip.model; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.List; +import java.time.OffsetDateTime; import java.util.Objects; /** - * Represents SmsAdvancedBinaryRequest model. + * Options for scheduling a message. */ -public class SmsAdvancedBinaryRequest { +public class SmsRequestSchedulingSettings { private String bulkId; - private List messages = new ArrayList<>(); + private OffsetDateTime sendAt; private SmsSendingSpeedLimit sendingSpeedLimit; @@ -29,12 +28,12 @@ public class SmsAdvancedBinaryRequest { * Sets bulkId. *

* Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. * * @param bulkId - * @return This {@link SmsAdvancedBinaryRequest instance}. + * @return This {@link SmsRequestSchedulingSettings instance}. */ - public SmsAdvancedBinaryRequest bulkId(String bulkId) { + public SmsRequestSchedulingSettings bulkId(String bulkId) { this.bulkId = bulkId; return this; } @@ -43,7 +42,7 @@ public SmsAdvancedBinaryRequest bulkId(String bulkId) { * Returns bulkId. *

* Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. * * @return bulkId */ @@ -56,7 +55,7 @@ public String getBulkId() { * Sets bulkId. *

* Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. * * @param bulkId */ @@ -66,77 +65,52 @@ public void setBulkId(String bulkId) { } /** - * Sets messages. + * Sets sendAt. *

* Field description: - * An array of message objects of a single message or multiple messages sent under one bulk ID. - *

- * The field is required. + * Date and time when the message is to be sent. Used for scheduled messages. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. * - * @param messages - * @return This {@link SmsAdvancedBinaryRequest instance}. + * @param sendAt + * @return This {@link SmsRequestSchedulingSettings instance}. */ - public SmsAdvancedBinaryRequest messages(List messages) { - this.messages = messages; + public SmsRequestSchedulingSettings sendAt(OffsetDateTime sendAt) { + this.sendAt = sendAt; return this; } /** - * Adds and item into messages. + * Returns sendAt. *

* Field description: - * An array of message objects of a single message or multiple messages sent under one bulk ID. - *

- * The field is required. + * Date and time when the message is to be sent. Used for scheduled messages. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. * - * @param messagesItem The item to be added to the list. - * @return This {@link SmsAdvancedBinaryRequest instance}. + * @return sendAt */ - public SmsAdvancedBinaryRequest addMessagesItem(SmsBinaryMessage messagesItem) { - if (this.messages == null) { - this.messages = new ArrayList<>(); - } - this.messages.add(messagesItem); - return this; + @JsonProperty("sendAt") + public OffsetDateTime getSendAt() { + return sendAt; } /** - * Returns messages. + * Sets sendAt. *

* Field description: - * An array of message objects of a single message or multiple messages sent under one bulk ID. - *

- * The field is required. - * - * @return messages - */ - @JsonProperty("messages") - public List getMessages() { - return messages; - } - - /** - * Sets messages. - *

- * Field description: - * An array of message objects of a single message or multiple messages sent under one bulk ID. - *

- * The field is required. + * Date and time when the message is to be sent. Used for scheduled messages. Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. * - * @param messages + * @param sendAt */ - @JsonProperty("messages") - public void setMessages(List messages) { - this.messages = messages; + @JsonProperty("sendAt") + public void setSendAt(OffsetDateTime sendAt) { + this.sendAt = sendAt; } /** * Sets sendingSpeedLimit. * * @param sendingSpeedLimit - * @return This {@link SmsAdvancedBinaryRequest instance}. + * @return This {@link SmsRequestSchedulingSettings instance}. */ - public SmsAdvancedBinaryRequest sendingSpeedLimit(SmsSendingSpeedLimit sendingSpeedLimit) { + public SmsRequestSchedulingSettings sendingSpeedLimit(SmsSendingSpeedLimit sendingSpeedLimit) { this.sendingSpeedLimit = sendingSpeedLimit; return this; } @@ -169,28 +143,28 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SmsAdvancedBinaryRequest smsAdvancedBinaryRequest = (SmsAdvancedBinaryRequest) o; - return Objects.equals(this.bulkId, smsAdvancedBinaryRequest.bulkId) - && Objects.equals(this.messages, smsAdvancedBinaryRequest.messages) - && Objects.equals(this.sendingSpeedLimit, smsAdvancedBinaryRequest.sendingSpeedLimit); + SmsRequestSchedulingSettings smsRequestSchedulingSettings = (SmsRequestSchedulingSettings) o; + return Objects.equals(this.bulkId, smsRequestSchedulingSettings.bulkId) + && Objects.equals(this.sendAt, smsRequestSchedulingSettings.sendAt) + && Objects.equals(this.sendingSpeedLimit, smsRequestSchedulingSettings.sendingSpeedLimit); } @Override public int hashCode() { - return Objects.hash(bulkId, messages, sendingSpeedLimit); + return Objects.hash(bulkId, sendAt, sendingSpeedLimit); } @Override public String toString() { String newLine = System.lineSeparator(); return new StringBuilder() - .append("class SmsAdvancedBinaryRequest {") + .append("class SmsRequestSchedulingSettings {") .append(newLine) .append(" bulkId: ") .append(toIndentedString(bulkId)) .append(newLine) - .append(" messages: ") - .append(toIndentedString(messages)) + .append(" sendAt: ") + .append(toIndentedString(sendAt)) .append(newLine) .append(" sendingSpeedLimit: ") .append(toIndentedString(sendingSpeedLimit)) diff --git a/src/main/java/com/infobip/model/SmsResponse.java b/src/main/java/com/infobip/model/SmsResponse.java index 68b8b80..0df78e2 100644 --- a/src/main/java/com/infobip/model/SmsResponse.java +++ b/src/main/java/com/infobip/model/SmsResponse.java @@ -21,13 +21,13 @@ public class SmsResponse { private String bulkId; - private List messages = null; + private List messages = new ArrayList<>(); /** * Sets bulkId. *

* Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically used for fetching delivery reports and message logs. * * @param bulkId * @return This {@link SmsResponse instance}. @@ -41,7 +41,7 @@ public SmsResponse bulkId(String bulkId) { * Returns bulkId. *

* Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically used for fetching delivery reports and message logs. * * @return bulkId */ @@ -54,7 +54,7 @@ public String getBulkId() { * Sets bulkId. *

* Field description: - * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. Typically, used to fetch [delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports) and [message logs](#channels/sms/get-outbound-sms-message-logs). + * Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. If not provided, it will be auto-generated and returned in the API response. Typically used for fetching delivery reports and message logs. * * @param bulkId */ @@ -68,6 +68,8 @@ public void setBulkId(String bulkId) { *

* Field description: * An array of message objects of a single message or multiple messages sent under one bulk ID. + *

+ * The field is required. * * @param messages * @return This {@link SmsResponse instance}. @@ -82,6 +84,8 @@ public SmsResponse messages(List messages) { *

* Field description: * An array of message objects of a single message or multiple messages sent under one bulk ID. + *

+ * The field is required. * * @param messagesItem The item to be added to the list. * @return This {@link SmsResponse instance}. @@ -99,6 +103,8 @@ public SmsResponse addMessagesItem(SmsResponseDetails messagesItem) { *

* Field description: * An array of message objects of a single message or multiple messages sent under one bulk ID. + *

+ * The field is required. * * @return messages */ @@ -112,6 +118,8 @@ public List getMessages() { *

* Field description: * An array of message objects of a single message or multiple messages sent under one bulk ID. + *

+ * The field is required. * * @param messages */ diff --git a/src/main/java/com/infobip/model/SmsResponseDetails.java b/src/main/java/com/infobip/model/SmsResponseDetails.java index ea9a300..42d5dfd 100644 --- a/src/main/java/com/infobip/model/SmsResponseDetails.java +++ b/src/main/java/com/infobip/model/SmsResponseDetails.java @@ -19,17 +19,17 @@ public class SmsResponseDetails { private String messageId; - private MessageStatus status; + private SmsMessageStatus status; - private String to; + private String destination; - private Integer smsCount; + private SmsMessageResponseDetails details; /** * Sets messageId. *

* Field description: - * Unique message ID. If not passed, it will be automatically generated and returned in a response. + * Unique message ID. If not provided, it will be auto-generated and returned in the API response. * * @param messageId * @return This {@link SmsResponseDetails instance}. @@ -43,7 +43,7 @@ public SmsResponseDetails messageId(String messageId) { * Returns messageId. *

* Field description: - * Unique message ID. If not passed, it will be automatically generated and returned in a response. + * Unique message ID. If not provided, it will be auto-generated and returned in the API response. * * @return messageId */ @@ -56,7 +56,7 @@ public String getMessageId() { * Sets messageId. *

* Field description: - * Unique message ID. If not passed, it will be automatically generated and returned in a response. + * Unique message ID. If not provided, it will be auto-generated and returned in the API response. * * @param messageId */ @@ -71,7 +71,7 @@ public void setMessageId(String messageId) { * @param status * @return This {@link SmsResponseDetails instance}. */ - public SmsResponseDetails status(MessageStatus status) { + public SmsResponseDetails status(SmsMessageStatus status) { this.status = status; return this; } @@ -82,7 +82,7 @@ public SmsResponseDetails status(MessageStatus status) { * @return status */ @JsonProperty("status") - public MessageStatus getStatus() { + public SmsMessageStatus getStatus() { return status; } @@ -92,88 +92,79 @@ public MessageStatus getStatus() { * @param status */ @JsonProperty("status") - public void setStatus(MessageStatus status) { + public void setStatus(SmsMessageStatus status) { this.status = status; } /** - * Sets to. + * Sets destination. *

* Field description: - * The destination address of the message. + * The destination address of the message, i.e., its recipient. * - * @param to + * @param destination * @return This {@link SmsResponseDetails instance}. */ - public SmsResponseDetails to(String to) { - this.to = to; + public SmsResponseDetails destination(String destination) { + this.destination = destination; return this; } /** - * Returns to. + * Returns destination. *

* Field description: - * The destination address of the message. + * The destination address of the message, i.e., its recipient. * - * @return to + * @return destination */ - @JsonProperty("to") - public String getTo() { - return to; + @JsonProperty("destination") + public String getDestination() { + return destination; } /** - * Sets to. + * Sets destination. *

* Field description: - * The destination address of the message. + * The destination address of the message, i.e., its recipient. * - * @param to + * @param destination */ - @JsonProperty("to") - public void setTo(String to) { - this.to = to; + @JsonProperty("destination") + public void setDestination(String destination) { + this.destination = destination; } /** - * Sets smsCount. - *

- * Field description: - * This is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. + * Sets details. * - * @param smsCount + * @param details * @return This {@link SmsResponseDetails instance}. */ - public SmsResponseDetails smsCount(Integer smsCount) { - this.smsCount = smsCount; + public SmsResponseDetails details(SmsMessageResponseDetails details) { + this.details = details; return this; } /** - * Returns smsCount. - *

- * Field description: - * This is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. + * Returns details. * - * @return smsCount + * @return details */ - @JsonProperty("smsCount") - public Integer getSmsCount() { - return smsCount; + @JsonProperty("details") + public SmsMessageResponseDetails getDetails() { + return details; } /** - * Sets smsCount. - *

- * Field description: - * This is the total count of SMS submitted in the request. SMS messages have a character limit and messages longer than that limit will be split into multiple SMS and reflected in the total count of SMS submitted. + * Sets details. * - * @param smsCount + * @param details */ - @JsonProperty("smsCount") - public void setSmsCount(Integer smsCount) { - this.smsCount = smsCount; + @JsonProperty("details") + public void setDetails(SmsMessageResponseDetails details) { + this.details = details; } @Override @@ -187,13 +178,13 @@ public boolean equals(Object o) { SmsResponseDetails smsResponseDetails = (SmsResponseDetails) o; return Objects.equals(this.messageId, smsResponseDetails.messageId) && Objects.equals(this.status, smsResponseDetails.status) - && Objects.equals(this.to, smsResponseDetails.to) - && Objects.equals(this.smsCount, smsResponseDetails.smsCount); + && Objects.equals(this.destination, smsResponseDetails.destination) + && Objects.equals(this.details, smsResponseDetails.details); } @Override public int hashCode() { - return Objects.hash(messageId, status, to, smsCount); + return Objects.hash(messageId, status, destination, details); } @Override @@ -208,11 +199,11 @@ public String toString() { .append(" status: ") .append(toIndentedString(status)) .append(newLine) - .append(" to: ") - .append(toIndentedString(to)) + .append(" destination: ") + .append(toIndentedString(destination)) .append(newLine) - .append(" smsCount: ") - .append(toIndentedString(smsCount)) + .append(" details: ") + .append(toIndentedString(details)) .append(newLine) .append("}") .toString(); diff --git a/src/main/java/com/infobip/model/SmsSouthKoreaOptions.java b/src/main/java/com/infobip/model/SmsSouthKoreaOptions.java index 3ad2bc3..9db70e0 100644 --- a/src/main/java/com/infobip/model/SmsSouthKoreaOptions.java +++ b/src/main/java/com/infobip/model/SmsSouthKoreaOptions.java @@ -17,88 +17,88 @@ */ public class SmsSouthKoreaOptions { - private Integer resellerCode; - private String title; + private Integer resellerCode; + /** - * Sets resellerCode. + * Sets title. *

* Field description: - * Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending. + * Title of the message. * - * @param resellerCode + * @param title * @return This {@link SmsSouthKoreaOptions instance}. */ - public SmsSouthKoreaOptions resellerCode(Integer resellerCode) { - this.resellerCode = resellerCode; + public SmsSouthKoreaOptions title(String title) { + this.title = title; return this; } /** - * Returns resellerCode. + * Returns title. *

* Field description: - * Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending. + * Title of the message. * - * @return resellerCode + * @return title */ - @JsonProperty("resellerCode") - public Integer getResellerCode() { - return resellerCode; + @JsonProperty("title") + public String getTitle() { + return title; } /** - * Sets resellerCode. + * Sets title. *

* Field description: - * Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending. + * Title of the message. * - * @param resellerCode + * @param title */ - @JsonProperty("resellerCode") - public void setResellerCode(Integer resellerCode) { - this.resellerCode = resellerCode; + @JsonProperty("title") + public void setTitle(String title) { + this.title = title; } /** - * Sets title. + * Sets resellerCode. *

* Field description: - * Set the title or subject of a message. South Korea only. + * Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending. * - * @param title + * @param resellerCode * @return This {@link SmsSouthKoreaOptions instance}. */ - public SmsSouthKoreaOptions title(String title) { - this.title = title; + public SmsSouthKoreaOptions resellerCode(Integer resellerCode) { + this.resellerCode = resellerCode; return this; } /** - * Returns title. + * Returns resellerCode. *

* Field description: - * Set the title or subject of a message. South Korea only. + * Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending. * - * @return title + * @return resellerCode */ - @JsonProperty("title") - public String getTitle() { - return title; + @JsonProperty("resellerCode") + public Integer getResellerCode() { + return resellerCode; } /** - * Sets title. + * Sets resellerCode. *

* Field description: - * Set the title or subject of a message. South Korea only. + * Reseller identification code: 9-digit registration number in the business registration certificate for South Korea. Resellers should submit this when sending. * - * @param title + * @param resellerCode */ - @JsonProperty("title") - public void setTitle(String title) { - this.title = title; + @JsonProperty("resellerCode") + public void setResellerCode(Integer resellerCode) { + this.resellerCode = resellerCode; } @Override @@ -110,13 +110,13 @@ public boolean equals(Object o) { return false; } SmsSouthKoreaOptions smsSouthKoreaOptions = (SmsSouthKoreaOptions) o; - return Objects.equals(this.resellerCode, smsSouthKoreaOptions.resellerCode) - && Objects.equals(this.title, smsSouthKoreaOptions.title); + return Objects.equals(this.title, smsSouthKoreaOptions.title) + && Objects.equals(this.resellerCode, smsSouthKoreaOptions.resellerCode); } @Override public int hashCode() { - return Objects.hash(resellerCode, title); + return Objects.hash(title, resellerCode); } @Override @@ -125,12 +125,12 @@ public String toString() { return new StringBuilder() .append("class SmsSouthKoreaOptions {") .append(newLine) - .append(" resellerCode: ") - .append(toIndentedString(resellerCode)) - .append(newLine) .append(" title: ") .append(toIndentedString(title)) .append(newLine) + .append(" resellerCode: ") + .append(toIndentedString(resellerCode)) + .append(newLine) .append("}") .toString(); } diff --git a/src/main/java/com/infobip/model/SmsTextMessageContent.java b/src/main/java/com/infobip/model/SmsTextMessageContent.java new file mode 100644 index 0000000..8b301e4 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsTextMessageContent.java @@ -0,0 +1,180 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Represents SmsTextMessageContent model. + */ +public class SmsTextMessageContent implements SmsMessageContent { + + private String text; + + private SmsTransliterationCode transliteration; + + private SmsLanguage language; + + /** + * Sets text. + *

+ * Field description: + * Content of the message being sent. + *

+ * The field is required. + * + * @param text + * @return This {@link SmsTextMessageContent instance}. + */ + public SmsTextMessageContent text(String text) { + this.text = text; + return this; + } + + /** + * Returns text. + *

+ * Field description: + * Content of the message being sent. + *

+ * The field is required. + * + * @return text + */ + @JsonProperty("text") + public String getText() { + return text; + } + + /** + * Sets text. + *

+ * Field description: + * Content of the message being sent. + *

+ * The field is required. + * + * @param text + */ + @JsonProperty("text") + public void setText(String text) { + this.text = text; + } + + /** + * Sets transliteration. + * + * @param transliteration + * @return This {@link SmsTextMessageContent instance}. + */ + public SmsTextMessageContent transliteration(SmsTransliterationCode transliteration) { + this.transliteration = transliteration; + return this; + } + + /** + * Returns transliteration. + * + * @return transliteration + */ + @JsonProperty("transliteration") + public SmsTransliterationCode getTransliteration() { + return transliteration; + } + + /** + * Sets transliteration. + * + * @param transliteration + */ + @JsonProperty("transliteration") + public void setTransliteration(SmsTransliterationCode transliteration) { + this.transliteration = transliteration; + } + + /** + * Sets language. + * + * @param language + * @return This {@link SmsTextMessageContent instance}. + */ + public SmsTextMessageContent language(SmsLanguage language) { + this.language = language; + return this; + } + + /** + * Returns language. + * + * @return language + */ + @JsonProperty("language") + public SmsLanguage getLanguage() { + return language; + } + + /** + * Sets language. + * + * @param language + */ + @JsonProperty("language") + public void setLanguage(SmsLanguage language) { + this.language = language; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsTextMessageContent smsTextMessageContent = (SmsTextMessageContent) o; + return Objects.equals(this.text, smsTextMessageContent.text) + && Objects.equals(this.transliteration, smsTextMessageContent.transliteration) + && Objects.equals(this.language, smsTextMessageContent.language); + } + + @Override + public int hashCode() { + return Objects.hash(text, transliteration, language); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsTextMessageContent {") + .append(newLine) + .append(" text: ") + .append(toIndentedString(text)) + .append(newLine) + .append(" transliteration: ") + .append(toIndentedString(transliteration)) + .append(newLine) + .append(" language: ") + .append(toIndentedString(language)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/SmsTextualMessage.java b/src/main/java/com/infobip/model/SmsTextualMessage.java deleted file mode 100644 index 35b3ac4..0000000 --- a/src/main/java/com/infobip/model/SmsTextualMessage.java +++ /dev/null @@ -1,807 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * An array of message objects of a single message or multiple messages sent under one bulk ID. - */ -public class SmsTextualMessage { - - private String callbackData; - - private SmsDeliveryTimeWindow deliveryTimeWindow; - - private List destinations = new ArrayList<>(); - - private Boolean flash; - - private String from; - - private Boolean intermediateReport; - - private SmsLanguage language; - - private String notifyContentType; - - private String notifyUrl; - - private SmsRegionalOptions regional; - - private OffsetDateTime sendAt; - - private String text; - - private String transliteration; - - private Long validityPeriod; - - private String entityId; - - private String applicationId; - - /** - * Sets callbackData. - *

- * Field description: - * Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports). The maximum value is 4000 characters. - * - * @param callbackData - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage callbackData(String callbackData) { - this.callbackData = callbackData; - return this; - } - - /** - * Returns callbackData. - *

- * Field description: - * Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports). The maximum value is 4000 characters. - * - * @return callbackData - */ - @JsonProperty("callbackData") - public String getCallbackData() { - return callbackData; - } - - /** - * Sets callbackData. - *

- * Field description: - * Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message [Delivery Report](#channels/sms/get-outbound-sms-message-delivery-reports). The maximum value is 4000 characters. - * - * @param callbackData - */ - @JsonProperty("callbackData") - public void setCallbackData(String callbackData) { - this.callbackData = callbackData; - } - - /** - * Sets deliveryTimeWindow. - * - * @param deliveryTimeWindow - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage deliveryTimeWindow(SmsDeliveryTimeWindow deliveryTimeWindow) { - this.deliveryTimeWindow = deliveryTimeWindow; - return this; - } - - /** - * Returns deliveryTimeWindow. - * - * @return deliveryTimeWindow - */ - @JsonProperty("deliveryTimeWindow") - public SmsDeliveryTimeWindow getDeliveryTimeWindow() { - return deliveryTimeWindow; - } - - /** - * Sets deliveryTimeWindow. - * - * @param deliveryTimeWindow - */ - @JsonProperty("deliveryTimeWindow") - public void setDeliveryTimeWindow(SmsDeliveryTimeWindow deliveryTimeWindow) { - this.deliveryTimeWindow = deliveryTimeWindow; - } - - /** - * Sets destinations. - *

- * Field description: - * An array of destination objects for where messages are being sent. A valid destination is required. - *

- * The field is required. - * - * @param destinations - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage destinations(List destinations) { - this.destinations = destinations; - return this; - } - - /** - * Adds and item into destinations. - *

- * Field description: - * An array of destination objects for where messages are being sent. A valid destination is required. - *

- * The field is required. - * - * @param destinationsItem The item to be added to the list. - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage addDestinationsItem(SmsDestination destinationsItem) { - if (this.destinations == null) { - this.destinations = new ArrayList<>(); - } - this.destinations.add(destinationsItem); - return this; - } - - /** - * Returns destinations. - *

- * Field description: - * An array of destination objects for where messages are being sent. A valid destination is required. - *

- * The field is required. - * - * @return destinations - */ - @JsonProperty("destinations") - public List getDestinations() { - return destinations; - } - - /** - * Sets destinations. - *

- * Field description: - * An array of destination objects for where messages are being sent. A valid destination is required. - *

- * The field is required. - * - * @param destinations - */ - @JsonProperty("destinations") - public void setDestinations(List destinations) { - this.destinations = destinations; - } - - /** - * Sets flash. - *

- * Field description: - * Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS. - * - * @param flash - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage flash(Boolean flash) { - this.flash = flash; - return this; - } - - /** - * Returns flash. - *

- * Field description: - * Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS. - * - * @return flash - */ - @JsonProperty("flash") - public Boolean getFlash() { - return flash; - } - - /** - * Sets flash. - *

- * Field description: - * Allows for sending a [flash SMS](https://www.infobip.com/docs/sms/message-types#flash-sms) to automatically appear on recipient devices without interaction. Set to `true` to enable flash SMS, or leave the default value, `false` to send a standard SMS. - * - * @param flash - */ - @JsonProperty("flash") - public void setFlash(Boolean flash) { - this.flash = flash; - } - - /** - * Sets from. - *

- * Field description: - * The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names). - * - * @param from - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage from(String from) { - this.from = from; - return this; - } - - /** - * Returns from. - *

- * Field description: - * The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names). - * - * @return from - */ - @JsonProperty("from") - public String getFrom() { - return from; - } - - /** - * Sets from. - *

- * Field description: - * The sender ID which can be alphanumeric or numeric (e.g., `CompanyName`). Make sure you don't exceed [character limit](https://www.infobip.com/docs/sms/get-started#sender-names). - * - * @param from - */ - @JsonProperty("from") - public void setFrom(String from) { - this.from = from; - } - - /** - * Sets intermediateReport. - *

- * Field description: - * The [real-time intermediate delivery report](#channels/sms/receive-outbound-sms-message-report) containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`. - * - * @param intermediateReport - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage intermediateReport(Boolean intermediateReport) { - this.intermediateReport = intermediateReport; - return this; - } - - /** - * Returns intermediateReport. - *

- * Field description: - * The [real-time intermediate delivery report](#channels/sms/receive-outbound-sms-message-report) containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`. - * - * @return intermediateReport - */ - @JsonProperty("intermediateReport") - public Boolean getIntermediateReport() { - return intermediateReport; - } - - /** - * Sets intermediateReport. - *

- * Field description: - * The [real-time intermediate delivery report](#channels/sms/receive-outbound-sms-message-report) containing GSM error codes, messages status, pricing, network and country codes, etc., which will be sent on your callback server. Defaults to `false`. - * - * @param intermediateReport - */ - @JsonProperty("intermediateReport") - public void setIntermediateReport(Boolean intermediateReport) { - this.intermediateReport = intermediateReport; - } - - /** - * Sets language. - * - * @param language - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage language(SmsLanguage language) { - this.language = language; - return this; - } - - /** - * Returns language. - * - * @return language - */ - @JsonProperty("language") - public SmsLanguage getLanguage() { - return language; - } - - /** - * Sets language. - * - * @param language - */ - @JsonProperty("language") - public void setLanguage(SmsLanguage language) { - this.language = language; - } - - /** - * Sets notifyContentType. - *

- * Field description: - * Preferred delivery report content type, `application/json` or `application/xml`. - * - * @param notifyContentType - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage notifyContentType(String notifyContentType) { - this.notifyContentType = notifyContentType; - return this; - } - - /** - * Returns notifyContentType. - *

- * Field description: - * Preferred delivery report content type, `application/json` or `application/xml`. - * - * @return notifyContentType - */ - @JsonProperty("notifyContentType") - public String getNotifyContentType() { - return notifyContentType; - } - - /** - * Sets notifyContentType. - *

- * Field description: - * Preferred delivery report content type, `application/json` or `application/xml`. - * - * @param notifyContentType - */ - @JsonProperty("notifyContentType") - public void setNotifyContentType(String notifyContentType) { - this.notifyContentType = notifyContentType; - } - - /** - * Sets notifyUrl. - *

- * Field description: - * The URL on your call back server on to which a delivery report will be sent. The [retry cycle](https://www.infobip.com/docs/sms/api#notify-url) for when your URL becomes unavailable uses the following formula: `1min + (1min * retryNumber * retryNumber)`. - * - * @param notifyUrl - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage notifyUrl(String notifyUrl) { - this.notifyUrl = notifyUrl; - return this; - } - - /** - * Returns notifyUrl. - *

- * Field description: - * The URL on your call back server on to which a delivery report will be sent. The [retry cycle](https://www.infobip.com/docs/sms/api#notify-url) for when your URL becomes unavailable uses the following formula: `1min + (1min * retryNumber * retryNumber)`. - * - * @return notifyUrl - */ - @JsonProperty("notifyUrl") - public String getNotifyUrl() { - return notifyUrl; - } - - /** - * Sets notifyUrl. - *

- * Field description: - * The URL on your call back server on to which a delivery report will be sent. The [retry cycle](https://www.infobip.com/docs/sms/api#notify-url) for when your URL becomes unavailable uses the following formula: `1min + (1min * retryNumber * retryNumber)`. - * - * @param notifyUrl - */ - @JsonProperty("notifyUrl") - public void setNotifyUrl(String notifyUrl) { - this.notifyUrl = notifyUrl; - } - - /** - * Sets regional. - * - * @param regional - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage regional(SmsRegionalOptions regional) { - this.regional = regional; - return this; - } - - /** - * Returns regional. - * - * @return regional - */ - @JsonProperty("regional") - public SmsRegionalOptions getRegional() { - return regional; - } - - /** - * Sets regional. - * - * @param regional - */ - @JsonProperty("regional") - public void setRegional(SmsRegionalOptions regional) { - this.regional = regional; - } - - /** - * Sets sendAt. - *

- * Field description: - * Date and time when the message is to be sent. Used for [scheduled SMS](#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. - * - * @param sendAt - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage sendAt(OffsetDateTime sendAt) { - this.sendAt = sendAt; - return this; - } - - /** - * Returns sendAt. - *

- * Field description: - * Date and time when the message is to be sent. Used for [scheduled SMS](#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. - * - * @return sendAt - */ - @JsonProperty("sendAt") - public OffsetDateTime getSendAt() { - return sendAt; - } - - /** - * Sets sendAt. - *

- * Field description: - * Date and time when the message is to be sent. Used for [scheduled SMS](#channels/sms/get-scheduled-sms-messages). Has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`, and can only be scheduled for no later than 180 days in advance. - * - * @param sendAt - */ - @JsonProperty("sendAt") - public void setSendAt(OffsetDateTime sendAt) { - this.sendAt = sendAt; - } - - /** - * Sets text. - *

- * Field description: - * Content of the message being sent. - * - * @param text - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage text(String text) { - this.text = text; - return this; - } - - /** - * Returns text. - *

- * Field description: - * Content of the message being sent. - * - * @return text - */ - @JsonProperty("text") - public String getText() { - return text; - } - - /** - * Sets text. - *

- * Field description: - * Content of the message being sent. - * - * @param text - */ - @JsonProperty("text") - public void setText(String text) { - this.text = text; - } - - /** - * Sets transliteration. - *

- * Field description: - * The transliteration of your sent message from one script to another. Transliteration is used to replace characters which are not recognized as part of your defaulted alphabet. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `BULGARIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC`, `PORTUGUESE`, `COLOMBIAN`, and `NON_UNICODE`. - * - * @param transliteration - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage transliteration(String transliteration) { - this.transliteration = transliteration; - return this; - } - - /** - * Returns transliteration. - *

- * Field description: - * The transliteration of your sent message from one script to another. Transliteration is used to replace characters which are not recognized as part of your defaulted alphabet. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `BULGARIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC`, `PORTUGUESE`, `COLOMBIAN`, and `NON_UNICODE`. - * - * @return transliteration - */ - @JsonProperty("transliteration") - public String getTransliteration() { - return transliteration; - } - - /** - * Sets transliteration. - *

- * Field description: - * The transliteration of your sent message from one script to another. Transliteration is used to replace characters which are not recognized as part of your defaulted alphabet. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `BULGARIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC`, `PORTUGUESE`, `COLOMBIAN`, and `NON_UNICODE`. - * - * @param transliteration - */ - @JsonProperty("transliteration") - public void setTransliteration(String transliteration) { - this.transliteration = transliteration; - } - - /** - * Sets validityPeriod. - *

- * Field description: - * The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported. Any bigger value will automatically default back to `2880`. - * - * @param validityPeriod - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage validityPeriod(Long validityPeriod) { - this.validityPeriod = validityPeriod; - return this; - } - - /** - * Returns validityPeriod. - *

- * Field description: - * The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported. Any bigger value will automatically default back to `2880`. - * - * @return validityPeriod - */ - @JsonProperty("validityPeriod") - public Long getValidityPeriod() { - return validityPeriod; - } - - /** - * Sets validityPeriod. - *

- * Field description: - * The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported. Any bigger value will automatically default back to `2880`. - * - * @param validityPeriod - */ - @JsonProperty("validityPeriod") - public void setValidityPeriod(Long validityPeriod) { - this.validityPeriod = validityPeriod; - } - - /** - * Sets entityId. - *

- * Field description: - * Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @param entityId - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage entityId(String entityId) { - this.entityId = entityId; - return this; - } - - /** - * Returns entityId. - *

- * Field description: - * Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @return entityId - */ - @JsonProperty("entityId") - public String getEntityId() { - return entityId; - } - - /** - * Sets entityId. - *

- * Field description: - * Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @param entityId - */ - @JsonProperty("entityId") - public void setEntityId(String entityId) { - this.entityId = entityId; - } - - /** - * Sets applicationId. - *

- * Field description: - * Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @param applicationId - * @return This {@link SmsTextualMessage instance}. - */ - public SmsTextualMessage applicationId(String applicationId) { - this.applicationId = applicationId; - return this; - } - - /** - * Returns applicationId. - *

- * Field description: - * Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @return applicationId - */ - @JsonProperty("applicationId") - public String getApplicationId() { - return applicationId; - } - - /** - * Sets applicationId. - *

- * Field description: - * Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). - * - * @param applicationId - */ - @JsonProperty("applicationId") - public void setApplicationId(String applicationId) { - this.applicationId = applicationId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsTextualMessage smsTextualMessage = (SmsTextualMessage) o; - return Objects.equals(this.callbackData, smsTextualMessage.callbackData) - && Objects.equals(this.deliveryTimeWindow, smsTextualMessage.deliveryTimeWindow) - && Objects.equals(this.destinations, smsTextualMessage.destinations) - && Objects.equals(this.flash, smsTextualMessage.flash) - && Objects.equals(this.from, smsTextualMessage.from) - && Objects.equals(this.intermediateReport, smsTextualMessage.intermediateReport) - && Objects.equals(this.language, smsTextualMessage.language) - && Objects.equals(this.notifyContentType, smsTextualMessage.notifyContentType) - && Objects.equals(this.notifyUrl, smsTextualMessage.notifyUrl) - && Objects.equals(this.regional, smsTextualMessage.regional) - && Objects.equals(this.sendAt, smsTextualMessage.sendAt) - && Objects.equals(this.text, smsTextualMessage.text) - && Objects.equals(this.transliteration, smsTextualMessage.transliteration) - && Objects.equals(this.validityPeriod, smsTextualMessage.validityPeriod) - && Objects.equals(this.entityId, smsTextualMessage.entityId) - && Objects.equals(this.applicationId, smsTextualMessage.applicationId); - } - - @Override - public int hashCode() { - return Objects.hash( - callbackData, - deliveryTimeWindow, - destinations, - flash, - from, - intermediateReport, - language, - notifyContentType, - notifyUrl, - regional, - sendAt, - text, - transliteration, - validityPeriod, - entityId, - applicationId); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class SmsTextualMessage {") - .append(newLine) - .append(" callbackData: ") - .append(toIndentedString(callbackData)) - .append(newLine) - .append(" deliveryTimeWindow: ") - .append(toIndentedString(deliveryTimeWindow)) - .append(newLine) - .append(" destinations: ") - .append(toIndentedString(destinations)) - .append(newLine) - .append(" flash: ") - .append(toIndentedString(flash)) - .append(newLine) - .append(" from: ") - .append(toIndentedString(from)) - .append(newLine) - .append(" intermediateReport: ") - .append(toIndentedString(intermediateReport)) - .append(newLine) - .append(" language: ") - .append(toIndentedString(language)) - .append(newLine) - .append(" notifyContentType: ") - .append(toIndentedString(notifyContentType)) - .append(newLine) - .append(" notifyUrl: ") - .append(toIndentedString(notifyUrl)) - .append(newLine) - .append(" regional: ") - .append(toIndentedString(regional)) - .append(newLine) - .append(" sendAt: ") - .append(toIndentedString(sendAt)) - .append(newLine) - .append(" text: ") - .append(toIndentedString(text)) - .append(newLine) - .append(" transliteration: ") - .append(toIndentedString(transliteration)) - .append(newLine) - .append(" validityPeriod: ") - .append(toIndentedString(validityPeriod)) - .append(newLine) - .append(" entityId: ") - .append(toIndentedString(entityId)) - .append(newLine) - .append(" applicationId: ") - .append(toIndentedString(applicationId)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/main/java/com/infobip/model/SmsTracking.java b/src/main/java/com/infobip/model/SmsTracking.java index b8863a0..98f3d41 100644 --- a/src/main/java/com/infobip/model/SmsTracking.java +++ b/src/main/java/com/infobip/model/SmsTracking.java @@ -13,176 +13,92 @@ import java.util.Objects; /** - * Sets up tracking parameters to track conversion metrics and type. + * Allows you to set up tracking parameters to track conversion metrics. For more details on SMS Conversion, see: [Track Conversion](https://www.infobip.com/docs/sms/api#track-conversion). */ public class SmsTracking { - private String baseUrl; + private Boolean useConversionTracking; - private String processKey; - - private String track; - - private String type; - - /** - * Sets baseUrl. - *

- * Field description: - * Custom base URL for shortened links in messages when tracking URL conversions. Legacy - use `urlOptions` instead. - * - * @param baseUrl - * @return This {@link SmsTracking instance}. - */ - public SmsTracking baseUrl(String baseUrl) { - this.baseUrl = baseUrl; - return this; - } - - /** - * Returns baseUrl. - *

- * Field description: - * Custom base URL for shortened links in messages when tracking URL conversions. Legacy - use `urlOptions` instead. - * - * @return baseUrl - */ - @JsonProperty("baseUrl") - public String getBaseUrl() { - return baseUrl; - } - - /** - * Sets baseUrl. - *

- * Field description: - * Custom base URL for shortened links in messages when tracking URL conversions. Legacy - use `urlOptions` instead. - * - * @param baseUrl - */ - @JsonProperty("baseUrl") - public void setBaseUrl(String baseUrl) { - this.baseUrl = baseUrl; - } + private String conversionTrackingName; /** - * Sets processKey. + * Sets useConversionTracking. *

* Field description: - * The process key which uniquely identifies conversion tracking. + * Indicates if a message has to be tracked for conversion rates. Default \"false\". * - * @param processKey + * @param useConversionTracking * @return This {@link SmsTracking instance}. */ - public SmsTracking processKey(String processKey) { - this.processKey = processKey; + public SmsTracking useConversionTracking(Boolean useConversionTracking) { + this.useConversionTracking = useConversionTracking; return this; } /** - * Returns processKey. + * Returns useConversionTracking. *

* Field description: - * The process key which uniquely identifies conversion tracking. + * Indicates if a message has to be tracked for conversion rates. Default \"false\". * - * @return processKey + * @return useConversionTracking */ - @JsonProperty("processKey") - public String getProcessKey() { - return processKey; + @JsonProperty("useConversionTracking") + public Boolean getUseConversionTracking() { + return useConversionTracking; } /** - * Sets processKey. + * Sets useConversionTracking. *

* Field description: - * The process key which uniquely identifies conversion tracking. + * Indicates if a message has to be tracked for conversion rates. Default \"false\". * - * @param processKey + * @param useConversionTracking */ - @JsonProperty("processKey") - public void setProcessKey(String processKey) { - this.processKey = processKey; + @JsonProperty("useConversionTracking") + public void setUseConversionTracking(Boolean useConversionTracking) { + this.useConversionTracking = useConversionTracking; } /** - * Sets track. - *

- * Field description: - * Indicates if a message has to be tracked for conversion rates. Values are: `SMS` and `URL`. `URL` is a legacy value. Use `urlOptions` instead. For more details on SMS Conversion, see: [Track Conversion](https://www.infobip.com/docs/sms/api#track-conversion). - * - * @param track - * @return This {@link SmsTracking instance}. - */ - public SmsTracking track(String track) { - this.track = track; - return this; - } - - /** - * Returns track. - *

- * Field description: - * Indicates if a message has to be tracked for conversion rates. Values are: `SMS` and `URL`. `URL` is a legacy value. Use `urlOptions` instead. For more details on SMS Conversion, see: [Track Conversion](https://www.infobip.com/docs/sms/api#track-conversion). - * - * @return track - */ - @JsonProperty("track") - public String getTrack() { - return track; - } - - /** - * Sets track. - *

- * Field description: - * Indicates if a message has to be tracked for conversion rates. Values are: `SMS` and `URL`. `URL` is a legacy value. Use `urlOptions` instead. For more details on SMS Conversion, see: [Track Conversion](https://www.infobip.com/docs/sms/api#track-conversion). - * - * @param track - */ - @JsonProperty("track") - public void setTrack(String track) { - this.track = track; - } - - /** - * Sets type. + * Sets conversionTrackingName. *

* Field description: * Sets a custom conversion type naming convention, e.g. `ONE_TIME_PIN` or `SOCIAL_INVITES`. * - * @param type + * @param conversionTrackingName * @return This {@link SmsTracking instance}. */ - public SmsTracking type(String type) { - this.type = type; + public SmsTracking conversionTrackingName(String conversionTrackingName) { + this.conversionTrackingName = conversionTrackingName; return this; } /** - * Returns type. + * Returns conversionTrackingName. *

* Field description: * Sets a custom conversion type naming convention, e.g. `ONE_TIME_PIN` or `SOCIAL_INVITES`. * - * @return type + * @return conversionTrackingName */ - @JsonProperty("type") - public String getType() { - return type; + @JsonProperty("conversionTrackingName") + public String getConversionTrackingName() { + return conversionTrackingName; } /** - * Sets type. + * Sets conversionTrackingName. *

* Field description: * Sets a custom conversion type naming convention, e.g. `ONE_TIME_PIN` or `SOCIAL_INVITES`. * - * @param type + * @param conversionTrackingName */ - @JsonProperty("type") - public void setType(String type) { - this.type = type; + @JsonProperty("conversionTrackingName") + public void setConversionTrackingName(String conversionTrackingName) { + this.conversionTrackingName = conversionTrackingName; } @Override @@ -194,15 +110,13 @@ public boolean equals(Object o) { return false; } SmsTracking smsTracking = (SmsTracking) o; - return Objects.equals(this.baseUrl, smsTracking.baseUrl) - && Objects.equals(this.processKey, smsTracking.processKey) - && Objects.equals(this.track, smsTracking.track) - && Objects.equals(this.type, smsTracking.type); + return Objects.equals(this.useConversionTracking, smsTracking.useConversionTracking) + && Objects.equals(this.conversionTrackingName, smsTracking.conversionTrackingName); } @Override public int hashCode() { - return Objects.hash(baseUrl, processKey, track, type); + return Objects.hash(useConversionTracking, conversionTrackingName); } @Override @@ -211,17 +125,11 @@ public String toString() { return new StringBuilder() .append("class SmsTracking {") .append(newLine) - .append(" baseUrl: ") - .append(toIndentedString(baseUrl)) - .append(newLine) - .append(" processKey: ") - .append(toIndentedString(processKey)) - .append(newLine) - .append(" track: ") - .append(toIndentedString(track)) + .append(" useConversionTracking: ") + .append(toIndentedString(useConversionTracking)) .append(newLine) - .append(" type: ") - .append(toIndentedString(type)) + .append(" conversionTrackingName: ") + .append(toIndentedString(conversionTrackingName)) .append(newLine) .append("}") .toString(); diff --git a/src/main/java/com/infobip/model/SmsTransliterationCode.java b/src/main/java/com/infobip/model/SmsTransliterationCode.java new file mode 100644 index 0000000..63175b0 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsTransliterationCode.java @@ -0,0 +1,57 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The transliteration of your sent message from one script to another. Transliteration is used to replace characters which are not recognized as part of your defaulted alphabet. Possible values: `TURKISH`, `GREEK`, `CYRILLIC`, `SERBIAN_CYRILLIC`, `BULGARIAN_CYRILLIC`, `CENTRAL_EUROPEAN`, `BALTIC`, `PORTUGUESE`, `COLOMBIAN`, and `NON_UNICODE`. + */ +public enum SmsTransliterationCode { + NONE("NONE"), + TURKISH("TURKISH"), + GREEK("GREEK"), + CYRILLIC("CYRILLIC"), + SERBIAN_CYRILLIC("SERBIAN_CYRILLIC"), + CENTRAL_EUROPEAN("CENTRAL_EUROPEAN"), + BALTIC("BALTIC"), + NON_UNICODE("NON_UNICODE"), + PORTUGUESE("PORTUGUESE"), + COLOMBIAN("COLOMBIAN"), + BULGARIAN_CYRILLIC("BULGARIAN_CYRILLIC"), + ALL("ALL"); + + private final String value; + + SmsTransliterationCode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SmsTransliterationCode fromValue(String value) { + for (SmsTransliterationCode enumElement : SmsTransliterationCode.values()) { + if (enumElement.value.equals(value)) { + return enumElement; + } + } + throw new IllegalArgumentException("Unexpected enum value '" + value + "'."); + } +} diff --git a/src/main/java/com/infobip/model/SmsTurkeyIysOptions.java b/src/main/java/com/infobip/model/SmsTurkeyIysOptions.java index dfd80e7..e2f918f 100644 --- a/src/main/java/com/infobip/model/SmsTurkeyIysOptions.java +++ b/src/main/java/com/infobip/model/SmsTurkeyIysOptions.java @@ -19,7 +19,7 @@ public class SmsTurkeyIysOptions { private Integer brandCode; - private SmsIysRecipientType recipientType; + private RecipientType recipientType; /** * Sets brandCode. @@ -69,7 +69,7 @@ public void setBrandCode(Integer brandCode) { * @param recipientType * @return This {@link SmsTurkeyIysOptions instance}. */ - public SmsTurkeyIysOptions recipientType(SmsIysRecipientType recipientType) { + public SmsTurkeyIysOptions recipientType(RecipientType recipientType) { this.recipientType = recipientType; return this; } @@ -82,7 +82,7 @@ public SmsTurkeyIysOptions recipientType(SmsIysRecipientType recipientType) { * @return recipientType */ @JsonProperty("recipientType") - public SmsIysRecipientType getRecipientType() { + public RecipientType getRecipientType() { return recipientType; } @@ -94,7 +94,7 @@ public SmsIysRecipientType getRecipientType() { * @param recipientType */ @JsonProperty("recipientType") - public void setRecipientType(SmsIysRecipientType recipientType) { + public void setRecipientType(RecipientType recipientType) { this.recipientType = recipientType; } diff --git a/src/main/java/com/infobip/model/SmsValidityPeriod.java b/src/main/java/com/infobip/model/SmsValidityPeriod.java new file mode 100644 index 0000000..602139f --- /dev/null +++ b/src/main/java/com/infobip/model/SmsValidityPeriod.java @@ -0,0 +1,143 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Message validity period. Once expired, the message won't be sent. Validity period longer than 48h is not supported. If exceeded, it will be automatically set to 48h. + */ +public class SmsValidityPeriod { + + private Integer amount; + + private SmsValidityPeriodTimeUnit timeUnit; + + /** + * Sets amount. + *

+ * Field description: + * Message validity period's value. If `timeUnit` is not set, it will default to `MINUTES`. + *

+ * The field is required. + * + * @param amount + * @return This {@link SmsValidityPeriod instance}. + */ + public SmsValidityPeriod amount(Integer amount) { + this.amount = amount; + return this; + } + + /** + * Returns amount. + *

+ * Field description: + * Message validity period's value. If `timeUnit` is not set, it will default to `MINUTES`. + *

+ * The field is required. + * + * @return amount + */ + @JsonProperty("amount") + public Integer getAmount() { + return amount; + } + + /** + * Sets amount. + *

+ * Field description: + * Message validity period's value. If `timeUnit` is not set, it will default to `MINUTES`. + *

+ * The field is required. + * + * @param amount + */ + @JsonProperty("amount") + public void setAmount(Integer amount) { + this.amount = amount; + } + + /** + * Sets timeUnit. + * + * @param timeUnit + * @return This {@link SmsValidityPeriod instance}. + */ + public SmsValidityPeriod timeUnit(SmsValidityPeriodTimeUnit timeUnit) { + this.timeUnit = timeUnit; + return this; + } + + /** + * Returns timeUnit. + * + * @return timeUnit + */ + @JsonProperty("timeUnit") + public SmsValidityPeriodTimeUnit getTimeUnit() { + return timeUnit; + } + + /** + * Sets timeUnit. + * + * @param timeUnit + */ + @JsonProperty("timeUnit") + public void setTimeUnit(SmsValidityPeriodTimeUnit timeUnit) { + this.timeUnit = timeUnit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsValidityPeriod smsValidityPeriod = (SmsValidityPeriod) o; + return Objects.equals(this.amount, smsValidityPeriod.amount) + && Objects.equals(this.timeUnit, smsValidityPeriod.timeUnit); + } + + @Override + public int hashCode() { + return Objects.hash(amount, timeUnit); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsValidityPeriod {") + .append(newLine) + .append(" amount: ") + .append(toIndentedString(amount)) + .append(newLine) + .append(" timeUnit: ") + .append(toIndentedString(timeUnit)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/CallRoutingAllowedDay.java b/src/main/java/com/infobip/model/SmsValidityPeriodTimeUnit.java similarity index 69% rename from src/main/java/com/infobip/model/CallRoutingAllowedDay.java rename to src/main/java/com/infobip/model/SmsValidityPeriodTimeUnit.java index 35e806e..d9cc1ae 100644 --- a/src/main/java/com/infobip/model/CallRoutingAllowedDay.java +++ b/src/main/java/com/infobip/model/SmsValidityPeriodTimeUnit.java @@ -13,20 +13,16 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * Allowed day. + * Message validity period time unit. */ -public enum CallRoutingAllowedDay { - MONDAY("MONDAY"), - TUESDAY("TUESDAY"), - WEDNESDAY("WEDNESDAY"), - THURSDAY("THURSDAY"), - FRIDAY("FRIDAY"), - SATURDAY("SATURDAY"), - SUNDAY("SUNDAY"); +public enum SmsValidityPeriodTimeUnit { + SECONDS("SECONDS"), + MINUTES("MINUTES"), + HOURS("HOURS"); private final String value; - CallRoutingAllowedDay(String value) { + SmsValidityPeriodTimeUnit(String value) { this.value = value; } @@ -41,8 +37,8 @@ public String toString() { } @JsonCreator - public static CallRoutingAllowedDay fromValue(String value) { - for (CallRoutingAllowedDay enumElement : CallRoutingAllowedDay.values()) { + public static SmsValidityPeriodTimeUnit fromValue(String value) { + for (SmsValidityPeriodTimeUnit enumElement : SmsValidityPeriodTimeUnit.values()) { if (enumElement.value.equals(value)) { return enumElement; } diff --git a/src/main/java/com/infobip/model/SmsWebhookInboundReportResponse.java b/src/main/java/com/infobip/model/SmsWebhookInboundReportResponse.java index a414eb5..3f53cfb 100644 --- a/src/main/java/com/infobip/model/SmsWebhookInboundReportResponse.java +++ b/src/main/java/com/infobip/model/SmsWebhookInboundReportResponse.java @@ -19,56 +19,11 @@ */ public class SmsWebhookInboundReportResponse { - private List results = null; - private Integer messageCount; private Integer pendingMessageCount; - /** - * Sets results. - * - * @param results - * @return This {@link SmsWebhookInboundReportResponse instance}. - */ - public SmsWebhookInboundReportResponse results(List results) { - this.results = results; - return this; - } - - /** - * Adds and item into results. - * - * @param resultsItem The item to be added to the list. - * @return This {@link SmsWebhookInboundReportResponse instance}. - */ - public SmsWebhookInboundReportResponse addResultsItem(SmsWebhookInboundReport resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * Returns results. - * - * @return results - */ - @JsonProperty("results") - public List getResults() { - return results; - } - - /** - * Sets results. - * - * @param results - */ - @JsonProperty("results") - public void setResults(List results) { - this.results = results; - } + private List results = null; /** * Sets messageCount. @@ -150,6 +105,51 @@ public void setPendingMessageCount(Integer pendingMessageCount) { this.pendingMessageCount = pendingMessageCount; } + /** + * Sets results. + * + * @param results + * @return This {@link SmsWebhookInboundReportResponse instance}. + */ + public SmsWebhookInboundReportResponse results(List results) { + this.results = results; + return this; + } + + /** + * Adds and item into results. + * + * @param resultsItem The item to be added to the list. + * @return This {@link SmsWebhookInboundReportResponse instance}. + */ + public SmsWebhookInboundReportResponse addResultsItem(SmsWebhookInboundReport resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Returns results. + * + * @return results + */ + @JsonProperty("results") + public List getResults() { + return results; + } + + /** + * Sets results. + * + * @param results + */ + @JsonProperty("results") + public void setResults(List results) { + this.results = results; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -159,14 +159,14 @@ public boolean equals(Object o) { return false; } SmsWebhookInboundReportResponse smsWebhookInboundReportResponse = (SmsWebhookInboundReportResponse) o; - return Objects.equals(this.results, smsWebhookInboundReportResponse.results) - && Objects.equals(this.messageCount, smsWebhookInboundReportResponse.messageCount) - && Objects.equals(this.pendingMessageCount, smsWebhookInboundReportResponse.pendingMessageCount); + return Objects.equals(this.messageCount, smsWebhookInboundReportResponse.messageCount) + && Objects.equals(this.pendingMessageCount, smsWebhookInboundReportResponse.pendingMessageCount) + && Objects.equals(this.results, smsWebhookInboundReportResponse.results); } @Override public int hashCode() { - return Objects.hash(results, messageCount, pendingMessageCount); + return Objects.hash(messageCount, pendingMessageCount, results); } @Override @@ -175,15 +175,15 @@ public String toString() { return new StringBuilder() .append("class SmsWebhookInboundReportResponse {") .append(newLine) - .append(" results: ") - .append(toIndentedString(results)) - .append(newLine) .append(" messageCount: ") .append(toIndentedString(messageCount)) .append(newLine) .append(" pendingMessageCount: ") .append(toIndentedString(pendingMessageCount)) .append(newLine) + .append(" results: ") + .append(toIndentedString(results)) + .append(newLine) .append("}") .toString(); } diff --git a/src/main/java/com/infobip/model/SmsWebhooks.java b/src/main/java/com/infobip/model/SmsWebhooks.java new file mode 100644 index 0000000..4fca123 --- /dev/null +++ b/src/main/java/com/infobip/model/SmsWebhooks.java @@ -0,0 +1,183 @@ +/* + * This class is auto generated from the Infobip OpenAPI specification + * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), + * powered by the OpenAPI Generator (https://openapi-generator.tech). + * + * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide + * or contact us @ support@infobip.com. + */ + +package com.infobip.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Provides options for configuring message webhooks. + */ +public class SmsWebhooks { + + private SmsMessageDeliveryReporting delivery; + + private String contentType; + + private String callbackData; + + /** + * Sets delivery. + * + * @param delivery + * @return This {@link SmsWebhooks instance}. + */ + public SmsWebhooks delivery(SmsMessageDeliveryReporting delivery) { + this.delivery = delivery; + return this; + } + + /** + * Returns delivery. + * + * @return delivery + */ + @JsonProperty("delivery") + public SmsMessageDeliveryReporting getDelivery() { + return delivery; + } + + /** + * Sets delivery. + * + * @param delivery + */ + @JsonProperty("delivery") + public void setDelivery(SmsMessageDeliveryReporting delivery) { + this.delivery = delivery; + } + + /** + * Sets contentType. + *

+ * Field description: + * Preferred delivery report content type, `application/json` or `application/xml`. + * + * @param contentType + * @return This {@link SmsWebhooks instance}. + */ + public SmsWebhooks contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Returns contentType. + *

+ * Field description: + * Preferred delivery report content type, `application/json` or `application/xml`. + * + * @return contentType + */ + @JsonProperty("contentType") + public String getContentType() { + return contentType; + } + + /** + * Sets contentType. + *

+ * Field description: + * Preferred delivery report content type, `application/json` or `application/xml`. + * + * @param contentType + */ + @JsonProperty("contentType") + public void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Sets callbackData. + *

+ * Field description: + * Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message Delivery Report. The maximum value is 4000 characters. + * + * @param callbackData + * @return This {@link SmsWebhooks instance}. + */ + public SmsWebhooks callbackData(String callbackData) { + this.callbackData = callbackData; + return this; + } + + /** + * Returns callbackData. + *

+ * Field description: + * Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message Delivery Report. The maximum value is 4000 characters. + * + * @return callbackData + */ + @JsonProperty("callbackData") + public String getCallbackData() { + return callbackData; + } + + /** + * Sets callbackData. + *

+ * Field description: + * Additional data that can be used for identifying, managing, or monitoring a message. Data included here will also be automatically included in the message Delivery Report. The maximum value is 4000 characters. + * + * @param callbackData + */ + @JsonProperty("callbackData") + public void setCallbackData(String callbackData) { + this.callbackData = callbackData; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsWebhooks smsWebhooks = (SmsWebhooks) o; + return Objects.equals(this.delivery, smsWebhooks.delivery) + && Objects.equals(this.contentType, smsWebhooks.contentType) + && Objects.equals(this.callbackData, smsWebhooks.callbackData); + } + + @Override + public int hashCode() { + return Objects.hash(delivery, contentType, callbackData); + } + + @Override + public String toString() { + String newLine = System.lineSeparator(); + return new StringBuilder() + .append("class SmsWebhooks {") + .append(newLine) + .append(" delivery: ") + .append(toIndentedString(delivery)) + .append(newLine) + .append(" contentType: ") + .append(toIndentedString(contentType)) + .append(newLine) + .append(" callbackData: ") + .append(toIndentedString(callbackData)) + .append(newLine) + .append("}") + .toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + String lineSeparator = System.lineSeparator(); + String lineSeparatorFollowedByIndentation = lineSeparator + " "; + return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); + } +} diff --git a/src/main/java/com/infobip/model/ViberDeliveryDay.java b/src/main/java/com/infobip/model/ViberDeliveryDay.java deleted file mode 100644 index 1b4c9d1..0000000 --- a/src/main/java/com/infobip/model/ViberDeliveryDay.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Days of the week which are included in the delivery time window. At least one day must be provided. Separate multiple days with a comma. - */ -public enum ViberDeliveryDay { - MONDAY("MONDAY"), - TUESDAY("TUESDAY"), - WEDNESDAY("WEDNESDAY"), - THURSDAY("THURSDAY"), - FRIDAY("FRIDAY"), - SATURDAY("SATURDAY"), - SUNDAY("SUNDAY"); - - private final String value; - - ViberDeliveryDay(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ViberDeliveryDay fromValue(String value) { - for (ViberDeliveryDay enumElement : ViberDeliveryDay.values()) { - if (enumElement.value.equals(value)) { - return enumElement; - } - } - throw new IllegalArgumentException("Unexpected enum value '" + value + "'."); - } -} diff --git a/src/main/java/com/infobip/model/ViberMessageOptions.java b/src/main/java/com/infobip/model/ViberMessageOptions.java index 7107aef..11bbcf5 100644 --- a/src/main/java/com/infobip/model/ViberMessageOptions.java +++ b/src/main/java/com/infobip/model/ViberMessageOptions.java @@ -21,7 +21,7 @@ public class ViberMessageOptions { private ViberValidityPeriod validityPeriod; - private ViberDeliveryTimeWindow deliveryTimeWindow; + private DeliveryTimeWindow deliveryTimeWindow; private ViberDefaultSmsFailover smsFailover; @@ -101,7 +101,7 @@ public void setValidityPeriod(ViberValidityPeriod validityPeriod) { * @param deliveryTimeWindow * @return This {@link ViberMessageOptions instance}. */ - public ViberMessageOptions deliveryTimeWindow(ViberDeliveryTimeWindow deliveryTimeWindow) { + public ViberMessageOptions deliveryTimeWindow(DeliveryTimeWindow deliveryTimeWindow) { this.deliveryTimeWindow = deliveryTimeWindow; return this; } @@ -112,7 +112,7 @@ public ViberMessageOptions deliveryTimeWindow(ViberDeliveryTimeWindow deliveryTi * @return deliveryTimeWindow */ @JsonProperty("deliveryTimeWindow") - public ViberDeliveryTimeWindow getDeliveryTimeWindow() { + public DeliveryTimeWindow getDeliveryTimeWindow() { return deliveryTimeWindow; } @@ -122,7 +122,7 @@ public ViberDeliveryTimeWindow getDeliveryTimeWindow() { * @param deliveryTimeWindow */ @JsonProperty("deliveryTimeWindow") - public void setDeliveryTimeWindow(ViberDeliveryTimeWindow deliveryTimeWindow) { + public void setDeliveryTimeWindow(DeliveryTimeWindow deliveryTimeWindow) { this.deliveryTimeWindow = deliveryTimeWindow; } diff --git a/src/main/java/com/infobip/model/WebRtcAcceptableHours.java b/src/main/java/com/infobip/model/WebRtcAcceptableHours.java index 730cd97..e822be4 100644 --- a/src/main/java/com/infobip/model/WebRtcAcceptableHours.java +++ b/src/main/java/com/infobip/model/WebRtcAcceptableHours.java @@ -17,9 +17,9 @@ */ public class WebRtcAcceptableHours { - private WebRtcTimeOfDay start; + private DeliveryTime start; - private WebRtcTimeOfDay end; + private DeliveryTime end; /** * Sets start. @@ -27,7 +27,7 @@ public class WebRtcAcceptableHours { * @param start * @return This {@link WebRtcAcceptableHours instance}. */ - public WebRtcAcceptableHours start(WebRtcTimeOfDay start) { + public WebRtcAcceptableHours start(DeliveryTime start) { this.start = start; return this; } @@ -38,7 +38,7 @@ public WebRtcAcceptableHours start(WebRtcTimeOfDay start) { * @return start */ @JsonProperty("start") - public WebRtcTimeOfDay getStart() { + public DeliveryTime getStart() { return start; } @@ -48,7 +48,7 @@ public WebRtcTimeOfDay getStart() { * @param start */ @JsonProperty("start") - public void setStart(WebRtcTimeOfDay start) { + public void setStart(DeliveryTime start) { this.start = start; } @@ -58,7 +58,7 @@ public void setStart(WebRtcTimeOfDay start) { * @param end * @return This {@link WebRtcAcceptableHours instance}. */ - public WebRtcAcceptableHours end(WebRtcTimeOfDay end) { + public WebRtcAcceptableHours end(DeliveryTime end) { this.end = end; return this; } @@ -69,7 +69,7 @@ public WebRtcAcceptableHours end(WebRtcTimeOfDay end) { * @return end */ @JsonProperty("end") - public WebRtcTimeOfDay getEnd() { + public DeliveryTime getEnd() { return end; } @@ -79,7 +79,7 @@ public WebRtcTimeOfDay getEnd() { * @param end */ @JsonProperty("end") - public void setEnd(WebRtcTimeOfDay end) { + public void setEnd(DeliveryTime end) { this.end = end; } diff --git a/src/main/java/com/infobip/model/WebRtcTimeOfDay.java b/src/main/java/com/infobip/model/WebRtcTimeOfDay.java deleted file mode 100644 index 9dc222e..0000000 --- a/src/main/java/com/infobip/model/WebRtcTimeOfDay.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This class is auto generated from the Infobip OpenAPI specification - * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR), - * powered by the OpenAPI Generator (https://openapi-generator.tech). - * - * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide - * or contact us @ support@infobip.com. - */ - -package com.infobip.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Objects; - -/** - * Represents WebRtcTimeOfDay model. - */ -public class WebRtcTimeOfDay { - - private Integer hour; - - private Integer minute; - - /** - * Sets hour. - * - * @param hour - * @return This {@link WebRtcTimeOfDay instance}. - */ - public WebRtcTimeOfDay hour(Integer hour) { - this.hour = hour; - return this; - } - - /** - * Returns hour. - * - * @return hour - */ - @JsonProperty("hour") - public Integer getHour() { - return hour; - } - - /** - * Sets hour. - * - * @param hour - */ - @JsonProperty("hour") - public void setHour(Integer hour) { - this.hour = hour; - } - - /** - * Sets minute. - * - * @param minute - * @return This {@link WebRtcTimeOfDay instance}. - */ - public WebRtcTimeOfDay minute(Integer minute) { - this.minute = minute; - return this; - } - - /** - * Returns minute. - * - * @return minute - */ - @JsonProperty("minute") - public Integer getMinute() { - return minute; - } - - /** - * Sets minute. - * - * @param minute - */ - @JsonProperty("minute") - public void setMinute(Integer minute) { - this.minute = minute; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebRtcTimeOfDay webRtcTimeOfDay = (WebRtcTimeOfDay) o; - return Objects.equals(this.hour, webRtcTimeOfDay.hour) && Objects.equals(this.minute, webRtcTimeOfDay.minute); - } - - @Override - public int hashCode() { - return Objects.hash(hour, minute); - } - - @Override - public String toString() { - String newLine = System.lineSeparator(); - return new StringBuilder() - .append("class WebRtcTimeOfDay {") - .append(newLine) - .append(" hour: ") - .append(toIndentedString(hour)) - .append(newLine) - .append(" minute: ") - .append(toIndentedString(minute)) - .append(newLine) - .append("}") - .toString(); - } - - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - String lineSeparator = System.lineSeparator(); - String lineSeparatorFollowedByIndentation = lineSeparator + " "; - return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation); - } -} diff --git a/src/test/java/com/infobip/RequestFactoryTest.java b/src/test/java/com/infobip/RequestFactoryTest.java index ba3bb46..11905a5 100644 --- a/src/test/java/com/infobip/RequestFactoryTest.java +++ b/src/test/java/com/infobip/RequestFactoryTest.java @@ -38,7 +38,7 @@ class RequestFactoryTest { private static final String GIVEN_API_KEY_VALUE = "apiKeyValue"; private static final ApiKey GIVEN_API_KEY = ApiKey.from(GIVEN_API_KEY_VALUE); - private static final String EXPECTED_USER_AGENT_HEADER_VALUE = "infobip-api-client-java/4.3.1"; + private static final String EXPECTED_USER_AGENT_HEADER_VALUE = "infobip-api-client-java/4.4.0"; private final OkHttpClient client = new OkHttpClient(); private final JSON json = new JSON(); diff --git a/src/test/java/com/infobip/StringRepresentationTest.java b/src/test/java/com/infobip/StringRepresentationTest.java index d8a9ead..aa0db1a 100644 --- a/src/test/java/com/infobip/StringRepresentationTest.java +++ b/src/test/java/com/infobip/StringRepresentationTest.java @@ -11,53 +11,32 @@ class StringRepresentationTest { @Test void shouldGenerateProperSmsTextualMessageRepresentation() { // given - var givenIncludeSmsCountInResponse = false; - - SmsAdvancedTextualRequest request = new SmsAdvancedTextualRequest() - .messages(List.of(new SmsTextualMessage() - .from("ServiceSMS") + SmsRequestEnvelope request = new SmsRequestEnvelope() + .messages(List.of(new SmsMessage() + .sender("InfoSMS") .destinations(List.of(new SmsDestination().to("385991112222"))) - .text("Hello world from Infobip API Client: https://www.infobip.com/docs/sdk."))) - .urlOptions(new SmsUrlOptions().shortenUrl(true)) - .includeSmsCountInResponse(givenIncludeSmsCountInResponse); - + .content(new SmsTextMessageContent().text("This is a sample message")))); // when String representation = request.toString(); // then then(representation) - .isEqualToIgnoringNewLines("class SmsAdvancedTextualRequest {\n" + " bulkId: null\n" - + " messages: [class SmsTextualMessage {\n" - + " callbackData: null\n" - + " deliveryTimeWindow: null\n" + .isEqualToIgnoringNewLines("class SmsRequestEnvelope {\n" + " messages: [class SmsMessage {\n" + + " sender: InfoSMS\n" + " destinations: [class SmsDestination {\n" - + " messageId: null\n" + " to: 385991112222\n" + + " messageId: null\n" + + " networkId: null\n" + " }]\n" - + " flash: null\n" - + " from: ServiceSMS\n" - + " intermediateReport: null\n" - + " language: null\n" - + " notifyContentType: null\n" - + " notifyUrl: null\n" - + " regional: null\n" - + " sendAt: null\n" - + " text: Hello world from Infobip API Client: https://www.infobip.com/docs/sdk.\n" - + " transliteration: null\n" - + " validityPeriod: null\n" - + " entityId: null\n" - + " applicationId: null\n" + + " content: class SmsTextMessageContent {\n" + + " text: This is a sample message\n" + + " transliteration: null\n" + + " language: null\n" + + " }\n" + + " options: null\n" + + " webhooks: null\n" + " }]\n" - + " sendingSpeedLimit: null\n" - + " urlOptions: class SmsUrlOptions {\n" - + " shortenUrl: true\n" - + " trackClicks: null\n" - + " trackingUrl: null\n" - + " removeProtocol: null\n" - + " customDomain: null\n" - + " }\n" - + " tracking: null\n" - + " includeSmsCountInResponse: false\n" + + " options: null\n" + "}"); } diff --git a/src/test/java/com/infobip/api/ApiErrorResponsesTest.java b/src/test/java/com/infobip/api/ApiErrorResponsesTest.java index 085f66a..395c5ec 100644 --- a/src/test/java/com/infobip/api/ApiErrorResponsesTest.java +++ b/src/test/java/com/infobip/api/ApiErrorResponsesTest.java @@ -5,13 +5,9 @@ import com.infobip.ApiCallback; import com.infobip.ApiException; import com.infobip.ApiExceptionDetails; -import com.infobip.model.SmsAdvancedTextualRequest; -import com.infobip.model.SmsDestination; -import com.infobip.model.SmsResponse; -import com.infobip.model.SmsTextualMessage; +import com.infobip.model.*; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.function.Consumer; import java.util.stream.Stream; import org.junit.jupiter.params.ParameterizedTest; @@ -20,7 +16,7 @@ class ApiErrorResponsesTest extends ApiTest { - private static final String SMS_API_ENDPOINT = "/sms/2/text/advanced"; + private static final String SMS_API_ENDPOINT = "/sms/3/messages"; @ParameterizedTest(name = "[{index}] Status code = {0}") @MethodSource("errorResponsesSource") @@ -33,17 +29,19 @@ void shouldProcessErrorResponse( String expectedRequest = String.format( "{\n" + " \"messages\": [\n" + " {\n" + + " \"sender\": \"%s\",\n" + " \"destinations\": [\n" + " {\n" + " \"to\": \"%s\"\n" + " }\n" + " ],\n" - + " \"from\": \"%s\",\n" - + " \"text\": \"%s\"\n" + + " \"content\": {\n" + + " \"text\": \"%s\"\n" + + " }\n" + " }\n" + " ]\n" + "}", - givenTo, givenFrom, givenText); + givenFrom, givenTo, givenText); setUpPostRequest(SMS_API_ENDPOINT, expectedRequest, givenResponse, givenHttpStatusCode); @@ -51,10 +49,12 @@ void shouldProcessErrorResponse( SmsDestination destination = new SmsDestination().to(givenTo); - SmsTextualMessage message = - new SmsTextualMessage().from(givenFrom).text(givenText).destinations(List.of(destination)); + SmsMessage message = new SmsMessage() + .sender("InfoSMS") + .destinations(List.of(destination)) + .content(new SmsTextMessageContent().text(givenText)); - SmsAdvancedTextualRequest request = new SmsAdvancedTextualRequest().messages(List.of(message)); + SmsRequestEnvelope request = new SmsRequestEnvelope().messages(List.of(message)); Consumer assertions = (apiException) -> { then(apiException).isNotNull(); @@ -63,11 +63,11 @@ void shouldProcessErrorResponse( then(apiException.details()).isEqualTo(expectedDetails); }; - testFailedCall(() -> sendSmsApi.sendSmsMessage(request).execute(), assertions); + testFailedCall(() -> sendSmsApi.sendSmsMessages(request).execute(), assertions); testFailedAsyncCall( (ApiCallback apiCallback) -> - sendSmsApi.sendSmsMessage(request).executeAsync(apiCallback), + sendSmsApi.sendSmsMessages(request).executeAsync(apiCallback), assertions); } @@ -76,49 +76,63 @@ private static Stream errorResponsesSource() { } private static Arguments badRequestResponse() { - String badRequestResponse = "{\n" + " \"requestError\": {\n" - + " \"serviceException\": {\n" - + " \"messageId\": \"BAD_REQUEST\",\n" - + " \"text\": \"Bad request\",\n" - + " \"validationErrors\": {\n" - + " \"messages[0].text\": [\n" - + " \"invalid text\"\n" - + " ]\n" - + " }\n" - + " }\n" - + " }\n" - + "}"; + String badRequestResponse = " {\n" + " \"errorCode\": \"E400\",\n" + + " \"description\": \"Request cannot be processed.\",\n" + + " \"action\": \"Check the syntax, violations and adjust the request.\",\n" + + " \"violations\": [],\n" + + " \"resources\": [\n" + + " {\n" + + " \"name\": \"API endpoint documentation\",\n" + + " \"url\": \"https://www.infobip.com/docs/api/send-sms-messages\"\n" + + " }\n" + + " ]\n" + + " }\n"; + + var resource = new ApiExceptionDetails.Resource(); + resource.setName("API endpoint documentation"); + resource.setUrl("https://www.infobip.com/docs/api/send-sms-messages"); - var violation = new ApiExceptionDetails.Violation(); - violation.setViolation("invalid text"); - violation.setProperty("messages[0].text"); List violations = new ArrayList<>(); - violations.add(violation); + List resources = new ArrayList<>(); + resources.add(resource); ApiExceptionDetails expectedDetails = new ApiExceptionDetails(); - expectedDetails.setMessageId("BAD_REQUEST"); - expectedDetails.setText("Bad request"); - expectedDetails.setValidationErrors(Map.of("messages[0].text", List.of("invalid text"))); expectedDetails.setErrorCode("E400"); - expectedDetails.setDescription("Bad request"); + expectedDetails.setDescription("Request cannot be processed."); + expectedDetails.setAction("Check the syntax, violations and adjust the request."); expectedDetails.setViolations(violations); + expectedDetails.setResources(resources); return Arguments.of(400, badRequestResponse, expectedDetails); } private static Arguments internalServerErrorResponse() { - String serverErrorResponse = "{\n" + " \"requestError\": {\n" - + " \"serviceException\": {\n" - + " \"messageId\": \"GENERAL_ERROR\",\n" - + " \"text\": \"Something went wrong. Please contact support.\"\n" + String serverErrorResponse = "{\n" + " \"errorCode\": \"E500\",\n" + + " \"description\": \"Something went wrong.\",\n" + + " \"action\": \"Contact the support.\",\n" + + " \"violations\": [],\n" + + " \"resources\": [\n" + + " {\n" + + " \"name\": \"API endpoint documentation\",\n" + + " \"url\": \"https://www.infobip.com/docs/api/send-sms-messages\"\n" + " }\n" - + " }\n" + + " ]\n" + "}"; + + var resource = new ApiExceptionDetails.Resource(); + resource.setName("API endpoint documentation"); + resource.setUrl("https://www.infobip.com/docs/api/send-sms-messages"); + + List violations = new ArrayList<>(); + List resources = new ArrayList<>(); + resources.add(resource); + ApiExceptionDetails expectedDetails = new ApiExceptionDetails(); - expectedDetails.setMessageId("GENERAL_ERROR"); - expectedDetails.setText("Something went wrong. Please contact support."); expectedDetails.setErrorCode("E500"); - expectedDetails.setDescription("Something went wrong. Please contact support."); + expectedDetails.setDescription("Something went wrong."); + expectedDetails.setAction("Contact the support."); + expectedDetails.setViolations(violations); + expectedDetails.setResources(resources); return Arguments.of(500, serverErrorResponse, expectedDetails); } diff --git a/src/test/java/com/infobip/api/CallLinkApiTest.java b/src/test/java/com/infobip/api/CallLinkApiTest.java index be1f13d..291b2cd 100644 --- a/src/test/java/com/infobip/api/CallLinkApiTest.java +++ b/src/test/java/com/infobip/api/CallLinkApiTest.java @@ -308,10 +308,10 @@ void shouldGetCallLink() { .startTime(givenValidityWindowStartTimeDateTime) .endTime(givenValidityWindowEndTimeDateTime) .acceptableHours(new WebRtcAcceptableHours() - .start(new WebRtcTimeOfDay() + .start(new DeliveryTime() .hour(givenAcceptableHoursStartHour) .minute(givenAcceptableHoursStartMinute)) - .end(new WebRtcTimeOfDay() + .end(new DeliveryTime() .hour(givenAcceptableHoursEndHour) .minute(givenAcceptableHoursEndMinute))) .acceptableDays(List.of(WebRtcValidityWindow.AcceptableDaysEnum.MONDAY))) @@ -424,10 +424,10 @@ void shouldDeleteCallLink() { .startTime(givenValidityWindowStartTimeDateTime) .endTime(givenValidityWindowEndTimeDateTime) .acceptableHours(new WebRtcAcceptableHours() - .start(new WebRtcTimeOfDay() + .start(new DeliveryTime() .hour(givenAcceptableHoursStartHour) .minute(givenAcceptableHoursStartMinute)) - .end(new WebRtcTimeOfDay() + .end(new DeliveryTime() .hour(givenAcceptableHoursEndHour) .minute(givenAcceptableHoursEndMinute))) .acceptableDays(List.of(WebRtcValidityWindow.AcceptableDaysEnum.MONDAY))) diff --git a/src/test/java/com/infobip/api/CallsApiTest.java b/src/test/java/com/infobip/api/CallsApiTest.java index 71bdcb7..345d713 100644 --- a/src/test/java/com/infobip/api/CallsApiTest.java +++ b/src/test/java/com/infobip/api/CallsApiTest.java @@ -4855,14 +4855,12 @@ void shouldCreateBulk() { .maxAttempts(givenMaxAttempts)) .schedulingOptions(new CallsSchedulingOptions() .startTime(givenStartTimeDateTime) - .callingTimeWindow(new CallsTimeWindow() - .from(new CallsTimeWindowPoint() + .callingTimeWindow(new DeliveryTimeWindow() + .from(new DeliveryTime() .hour(givenHourFrom) .minute(givenMinuteFrom)) - .to(new CallsTimeWindowPoint() - .hour(givenHourTo) - .minute(givenMinuteTo)) - .days(List.of(CallsTimeWindow.DaysEnum.MONDAY)))) + .to(new DeliveryTime().hour(givenHourTo).minute(givenMinuteTo)) + .days(List.of(DeliveryDay.MONDAY)))) .customData(Map.of("key2", givenKey2, "key1", givenKey1)))); var call = api.createBulk(voiceBulkRequest); testSuccessfulCall(call::execute, assertions); diff --git a/src/test/java/com/infobip/api/MmsApiTest.java b/src/test/java/com/infobip/api/MmsApiTest.java index 03dac39..6dd4cbb 100644 --- a/src/test/java/com/infobip/api/MmsApiTest.java +++ b/src/test/java/com/infobip/api/MmsApiTest.java @@ -39,7 +39,7 @@ void shouldSendMmsMessage() { String givenTitle = "This is sample subject"; String givenErrorMessage = "string"; String givenCallbackData = "string"; - MmsDeliveryDay givenDay = MmsDeliveryDay.MONDAY; + DeliveryDay givenDay = DeliveryDay.MONDAY; Integer givenFromHour = 0; Integer givenFromMinute = 0; Integer givenToHour = 0; @@ -149,10 +149,10 @@ void shouldSendMmsMessage() { .bulkId(givenBulkId) .messages(List.of(new MmsAdvancedMessage() .callbackData(givenCallbackData) - .deliveryTimeWindow(new MmsDeliveryTimeWindow() + .deliveryTimeWindow(new DeliveryTimeWindow() .days(List.of(givenDay)) - .from(new MmsDeliveryTime().hour(givenFromHour).minute(givenFromMinute)) - .to(new MmsDeliveryTime().hour(givenToHour).minute(givenToMinute))) + .from(new DeliveryTime().hour(givenFromHour).minute(givenFromMinute)) + .to(new DeliveryTime().hour(givenToHour).minute(givenToMinute))) .addDestinationsItem( new MmsDestination().messageId(givenMessageId).to(givenTo)) .from(givenFrom) @@ -196,8 +196,8 @@ void shouldGetOutboundMmsMessageDeliveryReports() { String givenMessageId = "string"; String givenTo = "string"; String givenFrom = "string"; - String givenSentAt = "string"; - String givenDoneAt = "string"; + String givenSentAt = "2023-01-01T17:42:05.390+0100"; + String givenDoneAt = "2023-01-01T17:42:10.390+0100"; Integer givenMmsCount = 0; String givenMccMnc = "string"; String givenCallbackData = "string"; @@ -275,6 +275,9 @@ void shouldGetOutboundMmsMessageDeliveryReports() { givenEntityId, givenApplicationId); + OffsetDateTime expectedSentAt = OffsetDateTime.of(2023, 1, 1, 17, 42, 5, 390_000_000, ZoneOffset.ofHours(1)); + OffsetDateTime expectedDoneAt = OffsetDateTime.of(2023, 1, 1, 17, 42, 10, 390_000_000, ZoneOffset.ofHours(1)); + setUpSuccessGetRequest(REPORTS, Map.of(), givenResponse); MmsApi api = new MmsApi(getApiClient()); @@ -287,8 +290,8 @@ void shouldGetOutboundMmsMessageDeliveryReports() { then(result.getMessageId()).isEqualTo(givenMessageId); then(result.getTo()).isEqualTo(givenTo); then(result.getFrom()).isEqualTo(givenFrom); - then(result.getSentAt()).isEqualTo(givenSentAt); - then(result.getDoneAt()).isEqualTo(givenDoneAt); + then(result.getSentAt()).isEqualTo(expectedSentAt); + then(result.getDoneAt()).isEqualTo(expectedDoneAt); then(result.getMmsCount()).isEqualTo(givenMmsCount); then(result.getMccMnc()).isEqualTo(givenMccMnc); then(result.getCallbackData()).isEqualTo(givenCallbackData); diff --git a/src/test/java/com/infobip/api/SmsApiTest.java b/src/test/java/com/infobip/api/SmsApiTest.java index 81b04c2..c2a2218 100644 --- a/src/test/java/com/infobip/api/SmsApiTest.java +++ b/src/test/java/com/infobip/api/SmsApiTest.java @@ -15,11 +15,10 @@ class SmsApiTest extends ApiTest { - private static final String TEXT_ADVANCED = "/sms/2/text/advanced"; - private static final String BINARY_ADVANCED = "/sms/2/binary/advanced"; + private static final String MESSAGES = "/sms/3/messages"; private static final String PREVIEW = "/sms/1/preview"; - private static final String REPORTS = "/sms/1/reports"; - private static final String LOGS = "/sms/1/logs"; + private static final String REPORTS = "/sms/3/reports"; + private static final String LOGS = "/sms/3/logs"; private static final String INBOX_REPORTS = "/sms/1/inbox/reports"; private static final String BULKS = "/sms/1/bulks"; private static final String BULKS_STATUS = "/sms/1/bulks/status"; @@ -36,30 +35,34 @@ void shouldSendSimpleSms() { String givenText = "This is a sample message"; String expectedRequest = String.format( - "{" + " \"messages\": [" - + " {" - + " \"from\": \"%s\"," - + " \"destinations\": [" - + " {" - + " \"to\": \"%s\"" - + " }" - + " ]," - + " \"text\": \"%s\"" - + " }" - + " ]" + "{\n" + " \"messages\": [\n" + + " {\n" + + " \"sender\": \"%s\",\n" + + " \"destinations\": [\n" + + " {\n" + + " \"to\": \"%s\"\n" + + " }\n" + + " ],\n" + + " \"content\": {\n" + + " \"text\": \"%s\"\n" + + " }\n" + + " }\n" + + " ]\n" + "}", givenFrom, givenTo, givenText); - setUpSuccessPostRequest(TEXT_ADVANCED, expectedRequest, givenResponse); + setUpSuccessPostRequest(MESSAGES, expectedRequest, givenResponse); SmsApi sendSmsApi = new SmsApi(getApiClient()); SmsDestination destination = new SmsDestination().to(givenTo); - SmsTextualMessage message = - new SmsTextualMessage().from(givenFrom).text(givenText).destinations(List.of(destination)); + SmsMessage message = new SmsMessage() + .sender(givenFrom) + .destinations(List.of(destination)) + .content(new SmsTextMessageContent().text(givenText)); - SmsAdvancedTextualRequest request = new SmsAdvancedTextualRequest().messages(List.of(message)); + SmsRequestEnvelope request = new SmsRequestEnvelope().messages(List.of(message)); Consumer assertions = (smsResponse) -> { then(smsResponse).isNotNull(); @@ -70,7 +73,7 @@ void shouldSendSimpleSms() { thenResponseDetailsForMessageHasStatusPending(smsResponseDetails.get(0), givenTo, givenMessageId); }; - var call = sendSmsApi.sendSmsMessage(request); + var call = sendSmsApi.sendSmsMessages(request); testSuccessfulCall(call::execute, assertions); testSuccessfulAsyncCall(call::executeAsync, assertions); } @@ -88,34 +91,38 @@ void shouldSendFlashSms() { boolean isFlash = true; String expectedRequest = String.format( - "{" + " \"messages\": [" - + " {" - + " \"from\": \"%s\"," - + " \"destinations\": [" - + " {" - + " \"to\": \"%s\"" - + " }" - + " ]," - + " \"text\": \"%s\"," - + " \"flash\": %b" - + " }" - + " ]" - + "}", + "{\n" + " \"messages\": [\n" + + " {\n" + + " \"sender\": \"%s\",\n" + + " \"destinations\": [\n" + + " {\n" + + " \"to\": \"%s\"\n" + + " }\n" + + " ],\n" + + " \"content\": {\n" + + " \"text\": \"%s\"\n" + + " },\n" + + " \"options\": {\n" + + " \"flash\": %b\n" + + " }\n" + + " }\n" + + " ]\n" + + "}\n", givenFrom, givenTo, givenText, isFlash); - setUpSuccessPostRequest(TEXT_ADVANCED, expectedRequest, givenResponse); + setUpSuccessPostRequest(MESSAGES, expectedRequest, givenResponse); SmsApi sendSmsApi = new SmsApi(getApiClient()); SmsDestination destination = new SmsDestination().to(givenTo); - SmsTextualMessage message = new SmsTextualMessage() - .from(givenFrom) - .text(givenText) + SmsMessage message = new SmsMessage() + .sender(givenFrom) .destinations(List.of(destination)) - .flash(isFlash); + .content(new SmsTextMessageContent().text(givenText)) + .options(new SmsMessageOptions().flash(isFlash)); - SmsAdvancedTextualRequest request = new SmsAdvancedTextualRequest().messages(List.of(message)); + SmsRequestEnvelope request = new SmsRequestEnvelope().messages(List.of(message)); Consumer assertions = (smsResponse) -> { then(smsResponse).isNotNull(); @@ -127,181 +134,220 @@ void shouldSendFlashSms() { thenResponseDetailsForMessageHasStatusPending(smsResponseDetails.get(0), givenTo, givenMessageId); }; - var call = sendSmsApi.sendSmsMessage(request); + var call = sendSmsApi.sendSmsMessages(request); testSuccessfulCall(call::execute, assertions); testSuccessfulAsyncCall(call::executeAsync, assertions); } @Test void shouldSendFullyFeaturedSmsMessage() { + + String givenBulkId = "BULK-ID-123-xyz"; + String givenFirstDestinationMessageId = "abc123"; + int givenGroupId = 1; + SmsMessageGeneralStatus givenGroupName = SmsMessageGeneralStatus.PENDING; + int givenStatusId = 26; + String givenStatusName = "PENDING_ACCEPTED"; + String givenStatusDescription = "Message sent to next instance"; + String givenFirstDestination = "385991112222"; + int givenDetailsMessageCount = 1; + String givenSecondDestinationMessageId = "xyz100"; + String givenSecondDestination = "385911231234"; + + String expectedMessage = String.format( + " {\n" + " \"bulkId\": \"%s\",\n" + + " \"messages\": [\n" + + " {\n" + + " \"messageId\": \"%s\",\n" + + " \"status\": {\n" + + " \"groupId\": %d,\n" + + " \"groupName\": \"%s\",\n" + + " \"id\": %d,\n" + + " \"name\": \"%s\",\n" + + " \"description\": \"%s\"\n" + + " },\n" + + " \"destination\": \"%s\",\n" + + " \"details\": {\n" + + " \"messageCount\": %d\n" + + " }\n" + + " },\n" + + " {\n" + + " \"messageId\": \"%s\",\n" + + " \"status\": {\n" + + " \"groupId\": %d,\n" + + " \"groupName\": \"%s\",\n" + + " \"id\": %d,\n" + + " \"name\": \"%s\",\n" + + " \"description\": \"%s\"\n" + + " },\n" + + " \"destination\": \"%s\",\n" + + " \"details\": {\n" + + " \"messageCount\": %d\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n", + givenBulkId, + givenFirstDestinationMessageId, + givenGroupId, + givenGroupName, + givenStatusId, + givenStatusName, + givenStatusDescription, + givenFirstDestination, + givenDetailsMessageCount, + givenSecondDestinationMessageId, + givenGroupId, + givenGroupName, + givenStatusId, + givenStatusName, + givenStatusDescription, + givenSecondDestination, + givenDetailsMessageCount); + String givenCallbackData = "transactionId=100"; - String deliveryTimeWindowDayMondayString = "MONDAY"; - SmsDeliveryDay deliveryTimeWindowDayMonday = SmsDeliveryDay.MONDAY; - String deliveryTimeWindowDaySundayString = "SUNDAY"; - SmsDeliveryDay deliveryTimeWindowDaySunday = SmsDeliveryDay.SUNDAY; + DeliveryDay deliveryTimeWindowDayMonday = DeliveryDay.MONDAY; + DeliveryDay deliveryTimeWindowDaySunday = DeliveryDay.SUNDAY; int deliveryTimeWindowFromHours = 12; int deliveryTimeWindowFromMinutes = 10; int deliveryTimeWindowToHours = 20; int deliveryTimeWindowToMinutes = 15; - String givenFirstDestinationMessageId = "abc123"; - String givenFirstDestination = "385991112222"; - String givenSecondDestinationMessageId = "xyz100"; - String givenSecondDestination = "385911231234"; - boolean givenFlash = true; + String givenFrom = "Info"; boolean givenIntermediateReport = true; String givenLanguageCode = "AUTODETECT"; String givenNotifyContentType = "application/json"; String givenNotifyUrl = "https://www.example.com/sms/advanced"; - String givenIndiaDltContentTemplateId = "contentTemplateId"; - String givenIndiaDltPrincipalEntityId = "givenPrincipalEntityId"; - int givenTurkeyIysBrandCode = 123123; - String givenTurkeyIysRecipientTypeString = "TACIR"; - SmsIysRecipientType givenTurkeyIysRecipientType = SmsIysRecipientType.TACIR; - OffsetDateTime givenSendAt = OffsetDateTime.of(2023, 8, 1, 16, 10, 0, 0, ZoneOffset.ofHoursMinutes(5, 30)); String givenSendAtString = "2023-08-01T16:10:00.000+0530"; + OffsetDateTime givenSendAt = OffsetDateTime.of(2023, 8, 1, 16, 10, 0, 0, ZoneOffset.ofHoursMinutes(5, 30)); String givenText = "Laku noć"; - String givenTransliteration = "CENTRAL_EUROPEAN"; - long givenValidityPeriod = 720L; - String givenEntityId = "100aaa100"; - String givenApplicationId = "123abc123"; - var givenResellerCode = 10; - String givenSouthKoreaTitle = "SouthKoreaTitle"; + SmsTransliterationCode givenTransliteration = SmsTransliterationCode.CENTRAL_EUROPEAN; + int givenValidityPeriod = 720; - String expectedMessage = String.format( - "{\n" + " \"callbackData\": \"%s\",\n" - + " \"deliveryTimeWindow\": {\n" - + " \"days\": [\n" - + " \"%s\",\n" - + " \"%s\"\n" - + " ],\n" - + " \"from\": {\n" - + " \"hour\": %d,\n" - + " \"minute\": %d\n" - + " },\n" - + " \"to\": {\n" - + " \"hour\": %d,\n" - + " \"minute\": %d\n" - + " }\n" - + " },\n" - + " \"destinations\": [\n" + SmsValidityPeriodTimeUnit givenValidityPeriodTimeUnit = SmsValidityPeriodTimeUnit.HOURS; + boolean givenUrlOptionsShortenUrl = true; + boolean givenUrlOptionsTrackClicks = false; + String givenUrlOptionsTrackingUrl = "https://ib.com"; + boolean givenUrlOptionsRemoveProtocol = true; + String givenUrlOptionsCustomDomain = "example.com"; + String givenTrackingType = "MY_CAMPAIGN"; + boolean givenIncludeSmsCountInResponse = true; + boolean givenUseConversionTracking = true; + String givenCampaingReferenceId = "summersale"; + + String expectedRequest = String.format( + " {\n" + " \"messages\": [\n" + " {\n" - + " \"messageId\": \"%s\",\n" - + " \"to\": \"%s\"\n" + + " \"sender\": \"%s\",\n" + + " \"destinations\": [\n" + + " {\n" + + " \"to\": \"%s\",\n" + + " \"messageId\": \"%s\"\n" + + " },\n" + + " {\n" + + " \"to\": \"%s\"\n" + + " }\n" + + " ],\n" + + " \"content\": {\n" + + " \"text\": \"%s\",\n" + + " \"transliteration\": \"%s\",\n" + + " \"language\": {\n" + + " \"languageCode\": \"%s\"\n" + + " }\n" + + " },\n" + + " \"options\": {\n" + + " \"validityPeriod\": {\n" + + " \"amount\": %d,\n" + + " \"timeUnit\": \"%s\"\n" + + " },\n" + + " \"campaignReferenceId\": \"%s\"\n" + + " },\n" + + " \"webhooks\": {\n" + + " \"delivery\": {\n" + + " \"url\": \"%s\",\n" + + " \"intermediateReport\": %b\n" + + " },\n" + + " \"contentType\": \"%s\",\n" + + " \"callbackData\": \"%s\"\n" + + " }\n" + " },\n" + " {\n" - + " \"messageId\": \"%s\",\n" - + " \"to\": \"%s\"\n" + + " \"sender\": \"%s\",\n" + + " \"destinations\": [\n" + + " {\n" + + " \"to\": \"%s\"\n" + + " }\n" + + " ],\n" + + " \"content\": {\n" + + " \"text\": \"%s\"\n" + + " },\n" + + " \"options\": {\n" + + " \"deliveryTimeWindow\": {\n" + + " \"days\": [\n" + + " \"MONDAY\",\n" + + " \"SUNDAY\"\n" + + " ],\n" + + " \"from\": {\n" + + " \"hour\": %d,\n" + + " \"minute\": %d\n" + + " },\n" + + " \"to\": {\n" + + " \"hour\": %d,\n" + + " \"minute\": %d\n" + + " }\n" + + " }\n" + + " }\n" + " }\n" - + " ],\n" - + " \"flash\": %b,\n" - + " \"from\": \"%s\",\n" - + " \"intermediateReport\": %b,\n" - + " \"language\": {\n" - + " \"languageCode\": \"%s\"\n" - + " },\n" - + " \"notifyContentType\": \"%s\",\n" - + " \"notifyUrl\": \"%s\",\n" - + " \"regional\": {\n" - + " \"indiaDlt\": {\n" - + " \"contentTemplateId\": \"%s\",\n" - + " \"principalEntityId\": \"%s\"\n" + + " ],\n" + + " \"options\": {\n" + + " \"schedule\": {\n" + + " \"bulkId\": \"%s\",\n" + + " \"sendAt\": \"%s\"\n" + " },\n" - + " \"turkeyIys\": {\n" - + " \"brandCode\": %d,\n" - + " \"recipientType\": \"%s\"\n" + + " \"tracking\": {\n" + + " \"shortenUrl\": %b,\n" + + " \"trackClicks\": %b,\n" + + " \"trackingUrl\": \"%s\",\n" + + " \"removeProtocol\": %b,\n" + + " \"customDomain\": \"%s\"\n" + " },\n" - + " \"southKorea\": {\n" - + " \"resellerCode\": %d,\n" - + " \"title\": \"%s\"\n" + + " \"includeSmsCountInResponse\": %b,\n" + + " \"conversionTracking\": {\n" + + " \"useConversionTracking\": %b,\n" + + " \"conversionTrackingName\": \"%s\"\n" + " }\n" - + " },\n" - + " \"sendAt\": \"%s\",\n" - + " \"text\": \"%s\",\n" - + " \"transliteration\": \"%s\",\n" - + " \"validityPeriod\": %d,\n" - + " \"entityId\": \"%s\",\n" - + " \"applicationId\": \"%s\"\n" - + "}\n", - givenCallbackData, - deliveryTimeWindowDayMondayString, - deliveryTimeWindowDaySundayString, - deliveryTimeWindowFromHours, - deliveryTimeWindowFromMinutes, - deliveryTimeWindowToHours, - deliveryTimeWindowToMinutes, - givenFirstDestinationMessageId, + + " }\n" + + " }\n", + givenFrom, givenFirstDestination, - givenSecondDestinationMessageId, + givenFirstDestinationMessageId, givenSecondDestination, - givenFlash, - givenFrom, - givenIntermediateReport, - givenLanguageCode, - givenNotifyContentType, - givenNotifyUrl, - givenIndiaDltContentTemplateId, - givenIndiaDltPrincipalEntityId, - givenTurkeyIysBrandCode, - givenTurkeyIysRecipientTypeString, - givenResellerCode, - givenSouthKoreaTitle, - givenSendAtString, givenText, givenTransliteration, + givenLanguageCode, givenValidityPeriod, - givenEntityId, - givenApplicationId); - - String givenBulkId = "BULK-ID-123-xyz"; - int givenSendingSpeedLimitAmount = 10; - String givenSendingSpeedLimitTimeUnitString = "HOUR"; - SmsSpeedLimitTimeUnit givenSendingSpeedLimitTimeUnit = SmsSpeedLimitTimeUnit.HOUR; - boolean givenUrlOptionsShortenUrl = true; - boolean givenUrlOptionsTrackClicks = false; - String givenUrlOptionsTrackingUrl = "https://ib.com"; - boolean givenUrlOptionsRemoveProtocol = true; - String givenUrlOptionsCustomDomain = "example.com"; - String givenTracking = "SMS"; - String givenTrackingType = "MY_CAMPAIGN"; - String givenTrackingBaseUrl = "https://example.com"; - String givenTrackingProcessKey = "123"; - - String expectedRequest = String.format( - "{\n" + " \"bulkId\": \"%s\",\n" - + " \"messages\": [\n" - + " %s\n" - + " ],\n" - + " \"sendingSpeedLimit\": {\n" - + " \"amount\": %d,\n" - + " \"timeUnit\": \"%s\"\n" - + " },\n" - + " \"urlOptions\": {\n" - + " \"shortenUrl\": %b,\n" - + " \"trackClicks\": %b,\n" - + " \"trackingUrl\": \"%s\",\n" - + " \"removeProtocol\": %b,\n" - + " \"customDomain\": \"%s\"\n" - + " },\n" - + " \"tracking\": {\n" - + " \"baseUrl\": \"%s\",\n" - + " \"processKey\": \"%s\",\n" - + " \"track\": \"%s\",\n" - + " \"type\": \"%s\"\n" - + " }\n" - + "}", + givenValidityPeriodTimeUnit, + givenCampaingReferenceId, + givenNotifyUrl, + givenIntermediateReport, + givenNotifyContentType, + givenCallbackData, + givenFrom, + givenSecondDestination, + givenText, + deliveryTimeWindowFromHours, + deliveryTimeWindowFromMinutes, + deliveryTimeWindowToHours, + deliveryTimeWindowToMinutes, givenBulkId, - expectedMessage, - givenSendingSpeedLimitAmount, - givenSendingSpeedLimitTimeUnitString, + givenSendAtString, givenUrlOptionsShortenUrl, givenUrlOptionsTrackClicks, givenUrlOptionsTrackingUrl, givenUrlOptionsRemoveProtocol, givenUrlOptionsCustomDomain, - givenTrackingBaseUrl, - givenTrackingProcessKey, - givenTracking, + givenIncludeSmsCountInResponse, + givenUseConversionTracking, givenTrackingType); String givenResponse = givenPendingResponse( @@ -311,70 +357,61 @@ void shouldSendFullyFeaturedSmsMessage() { givenSecondDestination, givenSecondDestinationMessageId); - setUpSuccessPostRequest(TEXT_ADVANCED, expectedRequest, givenResponse); + setUpSuccessPostRequest(MESSAGES, expectedRequest, givenResponse); SmsApi sendSmsApi = new SmsApi(getApiClient()); - SmsDeliveryTimeWindow givenDeliveryTimeWindow = new SmsDeliveryTimeWindow() + DeliveryTimeWindow givenDeliveryTimeWindow = new DeliveryTimeWindow() .days(List.of(deliveryTimeWindowDayMonday, deliveryTimeWindowDaySunday)) - .from(new SmsDeliveryTimeFrom() - .hour(deliveryTimeWindowFromHours) - .minute(deliveryTimeWindowFromMinutes)) - .to(new SmsDeliveryTimeTo().hour(deliveryTimeWindowToHours).minute(deliveryTimeWindowToMinutes)); + .from(new DeliveryTime().hour(deliveryTimeWindowFromHours).minute(deliveryTimeWindowFromMinutes)) + .to(new DeliveryTime().hour(deliveryTimeWindowToHours).minute(deliveryTimeWindowToMinutes)); SmsDestination firstDestination = new SmsDestination().messageId(givenFirstDestinationMessageId).to(givenFirstDestination); - SmsDestination secondDestination = - new SmsDestination().messageId(givenSecondDestinationMessageId).to(givenSecondDestination); - - SmsRegionalOptions regionalOptions = new SmsRegionalOptions() - .indiaDlt(new SmsIndiaDltOptions() - .contentTemplateId(givenIndiaDltContentTemplateId) - .principalEntityId(givenIndiaDltPrincipalEntityId)) - .turkeyIys(new SmsTurkeyIysOptions() - .brandCode(givenTurkeyIysBrandCode) - .recipientType(givenTurkeyIysRecipientType)) - .southKorea(new SmsSouthKoreaOptions() - .resellerCode(givenResellerCode) - .title(givenSouthKoreaTitle)); - - SmsTextualMessage message = new SmsTextualMessage() - .callbackData(givenCallbackData) - .deliveryTimeWindow(givenDeliveryTimeWindow) - .addDestinationsItem(firstDestination) - .addDestinationsItem(secondDestination) - .flash(givenFlash) - .from(givenFrom) - .intermediateReport(givenIntermediateReport) - .language(new SmsLanguage().languageCode(givenLanguageCode)) - .notifyContentType(givenNotifyContentType) - .notifyUrl(givenNotifyUrl) - .regional(regionalOptions) - .sendAt(givenSendAt) - .text(givenText) - .transliteration(givenTransliteration) - .validityPeriod(givenValidityPeriod) - .entityId(givenEntityId) - .applicationId(givenApplicationId); - - SmsAdvancedTextualRequest request = new SmsAdvancedTextualRequest() - .bulkId(givenBulkId) - .addMessagesItem(message) - .sendingSpeedLimit(new SmsSendingSpeedLimit() - .amount(givenSendingSpeedLimitAmount) - .timeUnit(givenSendingSpeedLimitTimeUnit)) - .urlOptions(new SmsUrlOptions() - .shortenUrl(givenUrlOptionsShortenUrl) - .trackClicks(givenUrlOptionsTrackClicks) - .trackingUrl(givenUrlOptionsTrackingUrl) - .removeProtocol(givenUrlOptionsRemoveProtocol) - .customDomain(givenUrlOptionsCustomDomain)) - .tracking(new SmsTracking() - .baseUrl(givenTrackingBaseUrl) - .processKey(givenTrackingProcessKey) - .track(givenTracking) - .type(givenTrackingType)); + SmsDestination secondDestination = new SmsDestination().to(givenSecondDestination); + + SmsMessage firstMessage = new SmsMessage() + .sender(givenFrom) + .destinations(List.of(firstDestination, secondDestination)) + .content(new SmsTextMessageContent() + .text(givenText) + .transliteration(givenTransliteration) + .language(new SmsLanguage().languageCode(givenLanguageCode))) + .options(new SmsMessageOptions() + .validityPeriod(new SmsValidityPeriod() + .timeUnit(givenValidityPeriodTimeUnit) + .amount(givenValidityPeriod)) + .campaignReferenceId(givenCampaingReferenceId)) + .webhooks(new SmsWebhooks() + .delivery(new SmsMessageDeliveryReporting() + .url(givenNotifyUrl) + .intermediateReport(givenIntermediateReport)) + .contentType(givenNotifyContentType) + .callbackData(givenCallbackData)); + + SmsMessage secondMessage = new SmsMessage() + .sender(givenFrom) + .destinations(List.of(secondDestination)) + .content(new SmsTextMessageContent().text(givenText)) + .options(new SmsMessageOptions().deliveryTimeWindow(givenDeliveryTimeWindow)); + + SmsRequestEnvelope request = new SmsRequestEnvelope() + .messages(List.of(firstMessage, secondMessage)) + .options(new SmsMessageRequestOptions() + .schedule(new SmsRequestSchedulingSettings() + .sendAt(givenSendAt) + .bulkId(givenBulkId)) + .tracking(new SmsUrlOptions() + .shortenUrl(givenUrlOptionsShortenUrl) + .trackClicks(givenUrlOptionsTrackClicks) + .trackingUrl(givenUrlOptionsTrackingUrl) + .removeProtocol(givenUrlOptionsRemoveProtocol) + .customDomain(givenUrlOptionsCustomDomain)) + .includeSmsCountInResponse(givenIncludeSmsCountInResponse) + .conversionTracking(new SmsTracking() + .useConversionTracking(givenUseConversionTracking) + .conversionTrackingName(givenTrackingType))); Consumer assertions = (smsResponse) -> { then(smsResponse).isNotNull(); @@ -390,7 +427,7 @@ void shouldSendFullyFeaturedSmsMessage() { smsResponseDetails.get(1), givenSecondDestination, givenSecondDestinationMessageId); }; - var call = sendSmsApi.sendSmsMessage(request); + var call = sendSmsApi.sendSmsMessages(request); testSuccessfulCall(call::execute, assertions); testSuccessfulAsyncCall(call::executeAsync, assertions); } @@ -408,10 +445,12 @@ void shouldSendFullyFeaturedBinaryMessage() { String givenNotifyUrlMessage1 = "https://www.example.com/sms/advanced"; String givenNotifyContentTypeMessage1 = "application/json"; String givenCallbackDataMessage1 = "DLR callback data"; - Long givenValidityPeriodMessage1 = 720L; + int givenValidityPeriodMessage1 = 720; + SmsValidityPeriodTimeUnit givenValidityPeriodTimeUnit = SmsValidityPeriodTimeUnit.HOURS; String expectedMessage1 = String.format( - "{" + " \"from\": \"%s\"," + "{" + + " \"sender\": \"%s\"," + " \"destinations\": [" + " {" + " \"to\": \"%s\"," @@ -421,16 +460,17 @@ void shouldSendFullyFeaturedBinaryMessage() { + " \"to\": \"%s\"" + " }" + " ]," - + " \"binary\": {" + + " \"content\": {" + " \"hex\": \"%s\"," + " \"dataCoding\": %d," + " \"esmClass\": %d" + " }," - + " \"intermediateReport\": %s," - + " \"notifyUrl\": \"%s\"," - + " \"notifyContentType\": \"%s\"," - + " \"callbackData\": \"%s\"," - + " \"validityPeriod\": %d" + + " \"options\": {" + + " \"validityPeriod\": {" + + " \"amount\": %d," + + " \"timeUnit\": \"%s\"" + + " }" + + " }" + "}", givenFromMessage1, givenToMessage1, @@ -439,11 +479,8 @@ void shouldSendFullyFeaturedBinaryMessage() { givenHexMessage1, givenDataCodingMessage1, givenEsmClassMessage1, - givenIntermediateReportMessage1, - givenNotifyUrlMessage1, - givenNotifyContentTypeMessage1, - givenCallbackDataMessage1, - givenValidityPeriodMessage1); + givenValidityPeriodMessage1, + givenValidityPeriodTimeUnit); String givenFromMessage2 = "41793026700"; String givenToMessage2 = "41793026700"; @@ -457,40 +494,38 @@ void shouldSendFullyFeaturedBinaryMessage() { int givenDeliveryTimeToMinuteMessage2 = 30; String givenContentTemplateIdMessage2 = "contentTemplateId"; String givenPrincipalEntityIdMessage2 = "givenPrincipalEntityId"; + String givenCampaignReferenceId = "summersale"; String expectedMessage2 = String.format( - "{" + " \"from\": \"%s\"," + "{" + + " \"sender\": \"%s\"," + " \"destinations\": [" + " {" + " \"to\": \"%s\"" + " }" + " ]," - + " \"binary\": {" + + " \"content\": {" + " \"hex\": \"%s\"," + " \"dataCoding\": %d," + " \"esmClass\": %d" + " }," - + " \"sendAt\": \"%s\"," - + " \"deliveryTimeWindow\": {" - + " \"from\": {" - + " \"hour\": %d," - + " \"minute\": %d" - + " }," - + " \"to\": {" - + " \"hour\": %d," - + " \"minute\": %d" - + " }," - + " \"days\": [" - + " \"MONDAY\"," - + " \"TUESDAY\"," - + " \"WEDNESDAY\"" - + " ]" - + " }," - + " \"regional\": {" - + " \"indiaDlt\": {" - + " \"contentTemplateId\": \"%s\"," - + " \"principalEntityId\": \"%s\"" - + " }" + + " \"options\": {" + + " \"deliveryTimeWindow\": {" + + " \"from\": {" + + " \"hour\": %d," + + " \"minute\": %d" + + " }," + + " \"to\": {" + + " \"hour\": %d," + + " \"minute\": %d" + + " }," + + " \"days\": [" + + " \"MONDAY\"," + + " \"TUESDAY\"," + + " \"WEDNESDAY\"" + + " ]" + + " }," + + " \"campaignReferenceId\": \"%s\"" + " }" + "}", givenFromMessage2, @@ -498,87 +533,81 @@ void shouldSendFullyFeaturedBinaryMessage() { givenHexMessage2, givenDataCodingMessage2, givenEsmClassMessage2, - givenSendAtMessage2, givenDeliveryTimeFromHourMessage2, givenDeliveryTimeFromMinuteMessage2, givenDeliveryTimeToHourMessage2, givenDeliveryTimeToMinuteMessage2, - givenContentTemplateIdMessage2, - givenPrincipalEntityIdMessage2); + givenCampaignReferenceId); String givenBulkId = "BULK-ID-123-xyz"; int givenSendingSpeedLimitAmount = 10; String givenSendingSpeedLimitTimeUnitString = "HOUR"; SmsSpeedLimitTimeUnit givenSendingSpeedLimitTimeUnit = SmsSpeedLimitTimeUnit.HOUR; + String givenSentAtString = "2019-11-09T16:00:00.000+0000"; + + OffsetDateTime givenSentAt = OffsetDateTime.of(LocalDateTime.of(2019, 11, 9, 16, 0, 0), ZoneOffset.ofHours(0)); String expectedRequest = String.format( "{" + " \"messages\": [" + " %s," + " %s" + " ]," - + " \"bulkId\": \"%s\"," - + " \"sendingSpeedLimit\": {" - + " \"amount\": %d," - + " \"timeUnit\": \"%s\"" + + " \"options\": {" + + " \"schedule\": {" + + " \"bulkId\": \"%s\"," + + " \"sendAt\": \"%s\"\n" + + " }" + " }" + "}", - expectedMessage1, - expectedMessage2, - givenBulkId, - givenSendingSpeedLimitAmount, - givenSendingSpeedLimitTimeUnitString); + expectedMessage1, expectedMessage2, givenBulkId, givenSentAtString); String givenMessageIdMessage2 = "2033247207850523792"; String givenResponse = givenPendingResponse( givenBulkId, givenToMessage1, givenMessageIdMessage1, givenToMessage2, givenMessageIdMessage2); - setUpSuccessPostRequest(BINARY_ADVANCED, expectedRequest, givenResponse); + setUpSuccessPostRequest(MESSAGES, expectedRequest, givenResponse); SmsApi sendSmsApi = new SmsApi(getApiClient()); - SmsBinaryMessage message1 = new SmsBinaryMessage() - .from(givenFromMessage1) + SmsMessage message1 = new SmsMessage() + .sender(givenFromMessage1) .destinations(List.of( new SmsDestination().to(givenToMessage1).messageId(givenMessageIdMessage1), new SmsDestination().to(givenAnotherToMessage1))) - .binary(new SmsBinaryContent() + .content(new SmsBinaryContent() .hex(givenHexMessage1) .dataCoding(givenDataCodingMessage1) .esmClass(givenEsmClassMessage1)) - .intermediateReport(givenIntermediateReportMessage1) - .notifyUrl(givenNotifyUrlMessage1) - .notifyContentType(givenNotifyContentTypeMessage1) - .callbackData(givenCallbackDataMessage1) - .validityPeriod(givenValidityPeriodMessage1); - - SmsBinaryMessage message2 = new SmsBinaryMessage() - .from(givenFromMessage2) + .options(new SmsMessageOptions() + .validityPeriod(new SmsValidityPeriod() + .amount(givenValidityPeriodMessage1) + .timeUnit(givenValidityPeriodTimeUnit))); + + SmsMessage message2 = new SmsMessage() + .sender(givenFromMessage2) .destinations(List.of(new SmsDestination().to(givenToMessage2))) - .binary(new SmsBinaryContent() + .content(new SmsBinaryContent() .hex(givenHexMessage2) .dataCoding(givenDataCodingMessage2) .esmClass(givenEsmClassMessage2)) - .sendAt(OffsetDateTime.of(2021, 8, 8, 16, 10, 0, 0, ZoneOffset.ofHours(5))) - .deliveryTimeWindow(new SmsDeliveryTimeWindow() - .to(new SmsDeliveryTimeTo() - .hour(givenDeliveryTimeToHourMessage2) - .minute(givenDeliveryTimeToMinuteMessage2)) - .from(new SmsDeliveryTimeFrom() - .hour(givenDeliveryTimeFromHourMessage2) - .minute(givenDeliveryTimeFromMinuteMessage2)) - .days(List.of(SmsDeliveryDay.MONDAY, SmsDeliveryDay.TUESDAY, SmsDeliveryDay.WEDNESDAY))) - .regional(new SmsRegionalOptions() - .indiaDlt(new SmsIndiaDltOptions() - .contentTemplateId(givenContentTemplateIdMessage2) - .principalEntityId(givenPrincipalEntityIdMessage2))); - - SmsAdvancedBinaryRequest request = new SmsAdvancedBinaryRequest() + .options(new SmsMessageOptions() + .deliveryTimeWindow(new DeliveryTimeWindow() + .to(new DeliveryTime() + .hour(givenDeliveryTimeToHourMessage2) + .minute(givenDeliveryTimeToMinuteMessage2)) + .from(new DeliveryTime() + .hour(givenDeliveryTimeFromHourMessage2) + .minute(givenDeliveryTimeFromMinuteMessage2)) + .days(List.of(DeliveryDay.MONDAY, DeliveryDay.TUESDAY, DeliveryDay.WEDNESDAY))) + .campaignReferenceId(givenCampaignReferenceId)); + + SmsRequestEnvelope request = new SmsRequestEnvelope() .messages(List.of(message1, message2)) - .bulkId(givenBulkId) - .sendingSpeedLimit(new SmsSendingSpeedLimit() - .amount(givenSendingSpeedLimitAmount) - .timeUnit(givenSendingSpeedLimitTimeUnit)); + .options(new SmsMessageRequestOptions() + .schedule(new SmsRequestSchedulingSettings() + .bulkId(givenBulkId) + .sendAt(givenSentAt))); Consumer assertions = (smsResponse) -> { then(smsResponse).isNotNull(); @@ -594,7 +623,7 @@ void shouldSendFullyFeaturedBinaryMessage() { smsResponseDetails.get(1), givenToMessage2, givenMessageIdMessage2); }; - var call = sendSmsApi.sendBinarySmsMessage(request); + var call = sendSmsApi.sendSmsMessages(request); testSuccessfulCall(call::execute, assertions); testSuccessfulAsyncCall(call::executeAsync, assertions); } @@ -617,39 +646,41 @@ void shouldSendFlashBinarySms() { String expectedRequest = String.format( "{" + " \"messages\": [" + " {" - + " \"from\": \"%s\"," + + " \"sender\": \"%s\"," + " \"destinations\": [" + " {" + " \"to\": \"%s\"" + " }" + " ]," - + " \"binary\": {" + + " \"content\": {" + " \"hex\": \"%s\"," + " \"dataCoding\": %d," + " \"esmClass\": %d" + " }," - + " \"flash\": %b" + + " \"options\": {" + + " \"flash\": %b" + + " }" + " }" + " ]" + "}", givenFrom, givenTo, givenHex, givenDataCoding, givenEsmClass, isFlash); - setUpSuccessPostRequest(BINARY_ADVANCED, expectedRequest, givenResponse); + setUpSuccessPostRequest(MESSAGES, expectedRequest, givenResponse); SmsApi sendSmsApi = new SmsApi(getApiClient()); SmsDestination destination = new SmsDestination().to(givenTo); - SmsBinaryMessage message = new SmsBinaryMessage() - .from(givenFrom) - .binary(new SmsBinaryContent() + SmsMessage message = new SmsMessage() + .sender(givenFrom) + .content(new SmsBinaryContent() .hex(givenHex) .dataCoding(givenDataCoding) .esmClass(givenEsmClass)) .destinations(List.of(destination)) - .flash(isFlash); + .options(new SmsMessageOptions().flash(isFlash)); - SmsAdvancedBinaryRequest request = new SmsAdvancedBinaryRequest().messages(List.of(message)); + SmsRequestEnvelope request = new SmsRequestEnvelope().messages(List.of(message)); Consumer assertions = (smsResponse) -> { then(smsResponse).isNotNull(); @@ -661,7 +692,7 @@ void shouldSendFlashBinarySms() { thenResponseDetailsForMessageHasStatusPending(smsResponseDetails.get(0), givenTo, givenMessageId); }; - var call = sendSmsApi.sendBinarySmsMessage(request); + var call = sendSmsApi.sendSmsMessages(request); testSuccessfulCall(call::execute, assertions); testSuccessfulAsyncCall(call::executeAsync, assertions); } @@ -725,83 +756,91 @@ void shouldGetDeliveryReports() { Double givenPricePerMessage = 0.01; String givenCurrency = "EUR"; Integer givenGroupId = 3; - String givenGroupName = "DELIVERED"; + SmsMessageGeneralStatus givenGroupName = SmsMessageGeneralStatus.DELIVERED; Integer givenId = 5; String givenName = "DELIVERED_TO_HANDSET"; String givenDescription = "Message delivered to handset"; Integer givenErrorGroupId = 0; - String givenErrorGroupName = "Ok"; + SmsMessageErrorGroup givenErrorGroupName = SmsMessageErrorGroup.OK; Integer givenErrorId = 0; String givenErrorName = "NO_ERROR"; String givenErrorDescription = "No Error"; Boolean givenErrorPermanent = false; String givenMessageId2 = "12db39c3-7822-4e72-a3ec-c87442c0ffc5"; String givenTo2 = "41793026834"; + String givenSender = "InfoSMS"; + String givenEntityId = "promotional-traffic-entity"; + String givenApplicationId = "marketing-automation-application"; String givenResponse = String.format( - "{\n" + " \"results\": [\n" - + " {\n" - + " \"bulkId\": \"%s\",\n" - + " \"messageId\": \"%s\",\n" - + " \"to\": \"%s\",\n" - + " \"sentAt\": \"%s\",\n" - + " \"doneAt\": \"%s\",\n" - + " \"smsCount\": %d,\n" - + " \"price\": {\n" - + " \"pricePerMessage\": %f,\n" - + " \"currency\": \"%s\"\n" - + " },\n" - + " \"status\": {\n" - + " \"groupId\": %d,\n" - + " \"groupName\": \"%s\",\n" - + " \"id\": %d,\n" - + " \"name\": \"%s\",\n" - + " \"description\": \"%s\"\n" - + " },\n" - + " \"error\": {\n" - + " \"groupId\": %d,\n" - + " \"groupName\": \"%s\",\n" - + " \"id\": %d,\n" - + " \"name\": \"%s\",\n" - + " \"description\": \"%s\",\n" - + " \"permanent\": %b\n" - + " }\n" - + " },\n" - + " {\n" - + " \"bulkId\": \"%s\",\n" - + " \"messageId\": \"%s\",\n" - + " \"to\": \"%s\",\n" - + " \"sentAt\": \"%s\",\n" - + " \"doneAt\": \"%s\",\n" - + " \"smsCount\": %d,\n" - + " \"price\": {\n" - + " \"pricePerMessage\": %f,\n" - + " \"currency\": \"%s\"\n" - + " },\n" - + " \"status\": {\n" - + " \"groupId\": %d,\n" - + " \"groupName\": \"%s\",\n" - + " \"id\": %d,\n" - + " \"name\": \"%s\",\n" - + " \"description\": \"%s\"\n" - + " },\n" - + " \"error\": {\n" - + " \"groupId\": %d,\n" - + " \"groupName\": \"%s\",\n" - + " \"id\": %d,\n" - + " \"name\": \"%s\",\n" - + " \"description\": \"%s\",\n" - + " \"permanent\": %b\n" - + " }\n" - + " }\n" - + " ]\n" - + "}\n", + " {\n" + " \"results\": [\n" + + " {\n" + + " \"bulkId\": \"%s\",\n" + + " \"price\": {\n" + + " \"pricePerMessage\": %f,\n" + + " \"currency\": \"%s\"\n" + + " },\n" + + " \"status\": {\n" + + " \"groupId\": %d,\n" + + " \"groupName\": \"%s\",\n" + + " \"id\": %d,\n" + + " \"name\": \"%s\",\n" + + " \"description\": \"%s\"\n" + + " },\n" + + " \"error\": {\n" + + " \"groupId\": %d,\n" + + " \"groupName\": \"%s\",\n" + + " \"id\": %d,\n" + + " \"name\": \"%s\",\n" + + " \"description\": \"%s\",\n" + + " \"permanent\": %b\n" + + " },\n" + + " \"messageId\": \"%s\",\n" + + " \"to\": \"%s\",\n" + + " \"sender\": \"%s\",\n" + + " \"sentAt\": \"%s\",\n" + + " \"doneAt\": \"%s\",\n" + + " \"messageCount\": %d,\n" + + " \"platform\": {\n" + + " \"entityId\": \"%s\",\n" + + " \"applicationId\": \"%s\"\n" + + " }\n" + + " },\n" + + " {\n" + + " \"bulkId\": \"%s\",\n" + + " \"price\": {\n" + + " \"pricePerMessage\": %f,\n" + + " \"currency\": \"%s\"\n" + + " },\n" + + " \"status\": {\n" + + " \"groupId\": %d,\n" + + " \"groupName\": \"%s\",\n" + + " \"id\": %d,\n" + + " \"name\": \"%s\",\n" + + " \"description\": \"%s\"\n" + + " },\n" + + " \"error\": {\n" + + " \"groupId\": %d,\n" + + " \"groupName\": \"%s\",\n" + + " \"id\": %d,\n" + + " \"name\": \"%s\",\n" + + " \"description\": \"%s\",\n" + + " \"permanent\": %b\n" + + " },\n" + + " \"messageId\": \"%s\",\n" + + " \"to\": \"%s\",\n" + + " \"sender\": \"%s\",\n" + + " \"sentAt\": \"%s\",\n" + + " \"doneAt\": \"%s\",\n" + + " \"messageCount\": %d,\n" + + " \"platform\": {\n" + + " \"entityId\": \"%s\",\n" + + " \"applicationId\": \"%s\"\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n", givenBulkId, - givenMessageId, - givenTo, - givenSentAt, - givenDoneAt, - givenSmsCount, givenPricePerMessage, givenCurrency, givenGroupId, @@ -815,12 +854,15 @@ void shouldGetDeliveryReports() { givenErrorName, givenErrorDescription, givenErrorPermanent, - givenBulkId, - givenMessageId2, - givenTo2, + givenMessageId, + givenTo, + givenSender, givenSentAt, givenDoneAt, givenSmsCount, + givenEntityId, + givenApplicationId, + givenBulkId, givenPricePerMessage, givenCurrency, givenGroupId, @@ -833,13 +875,21 @@ void shouldGetDeliveryReports() { givenErrorId, givenErrorName, givenErrorDescription, - givenErrorPermanent); + givenErrorPermanent, + givenMessageId2, + givenTo2, + givenSender, + givenSentAt, + givenDoneAt, + givenSmsCount, + givenEntityId, + givenApplicationId); setUpSuccessGetRequest(REPORTS, Map.of(), givenResponse); SmsApi api = new SmsApi(getApiClient()); - Consumer assertions = (response) -> { + Consumer assertions = (response) -> { then(response).isNotNull(); then(response.getResults()).isNotNull(); var results = response.getResults(); @@ -850,7 +900,7 @@ void shouldGetDeliveryReports() { then(result1.getTo()).isEqualTo(givenTo); then(result1.getSentAt()).isEqualTo(givenSentAtDateTime); then(result1.getDoneAt()).isEqualTo(givenDoneAtDateTime); - then(result1.getSmsCount()).isEqualTo(givenSmsCount); + then(result1.getMessageCount()).isEqualTo(givenSmsCount); then(result1.getPrice()).isNotNull(); var price1 = result1.getPrice(); then(price1.getPricePerMessage()).isEqualTo(givenPricePerMessage); @@ -875,7 +925,7 @@ void shouldGetDeliveryReports() { then(result2.getTo()).isEqualTo(givenTo2); then(result2.getSentAt()).isEqualTo(givenSentAtDateTime); then(result2.getDoneAt()).isEqualTo(givenDoneAtDateTime); - then(result2.getSmsCount()).isEqualTo(givenSmsCount); + then(result2.getMessageCount()).isEqualTo(givenSmsCount); then(result2.getPrice()).isNotNull(); var price2 = result2.getPrice(); then(price2.getPricePerMessage()).isEqualTo(givenPricePerMessage); @@ -895,7 +945,7 @@ void shouldGetDeliveryReports() { then(error2.getPermanent()).isEqualTo(givenErrorPermanent); }; - var call = api.getOutboundSmsMessageDeliveryReports(); + var call = api.getOutboundSmsMessageDeliveryReportsV3(); testSuccessfulCall(call::execute, assertions); testSuccessfulAsyncCall(call::executeAsync, assertions); } @@ -929,10 +979,12 @@ void shouldGetSmsLogs() { "{" + " \"results\": [" + " {" + " \"bulkId\": \"%s\"," - + " \"applicationId\": \"%s\"," - + " \"entityId\": \"%s\"," + + " \"platform\": {" + + " \"applicationId\": \"%s\"," + + " \"entityId\": \"%s\"" + + " }," + " \"messageId\": \"%s\"," - + " \"to\": \"%s\"," + + " \"destination\": \"%s\"," + " \"sentAt\": \"%s\"," + " \"doneAt\": \"%s\"," + " \"smsCount\": %d," @@ -959,7 +1011,7 @@ void shouldGetSmsLogs() { + " {" + " \"bulkId\": \"%s\"," + " \"messageId\": \"%s\"," - + " \"to\": \"%s\"," + + " \"destination\": \"%s\"," + " \"sentAt\": \"%s\"," + " \"doneAt\": \"%s\"," + " \"smsCount\": %d," @@ -1051,14 +1103,14 @@ void shouldGetSmsLogs() { then(log).isNotNull(); then(log.getBulkId()).isEqualTo(givenBulkId); then(log.getMessageId()).isEqualTo(givenMessageIdMessage1); - then(log.getTo()).isEqualTo(givenToMessage1); + then(log.getDestination()).isEqualTo(givenToMessage1); then(log.getSentAt()).isEqualTo(expectedSendAtMessage1); then(log.getDoneAt()).isEqualTo(expectedDoneAtMessage1); - then(log.getFrom()).isNull(); - then(log.getText()).isNull(); + then(log.getSender()).isNull(); + then(log.getContent()).isNull(); then(log.getMccMnc()).isNull(); - then(log.getApplicationId()).isEqualTo(givenApplicationId); - then(log.getEntityId()).isEqualTo(givenEntityId); + then(log.getPlatform().getApplicationId()).isEqualTo(givenApplicationId); + then(log.getPlatform().getEntityId()).isEqualTo(givenEntityId); thenPriceIsEqualTo(log.getPrice(), givenPricePerMessageMessage1, givenCurrencyMessage1); thenStatusIsDelivered(log.getStatus()); @@ -1074,11 +1126,11 @@ void shouldGetSmsLogs() { then(anotherLog).isNotNull(); then(anotherLog.getBulkId()).isEqualTo(givenBulkId); then(anotherLog.getMessageId()).isEqualTo(givenMessageIdMessage2); - then(anotherLog.getTo()).isEqualTo(givenToMessage2); + then(anotherLog.getDestination()).isEqualTo(givenToMessage2); then(anotherLog.getSentAt()).isEqualTo(expectedSendAtMessage2); then(anotherLog.getDoneAt()).isEqualTo(expectedDoneAtMessage2); - then(anotherLog.getFrom()).isNull(); - then(anotherLog.getText()).isNull(); + then(anotherLog.getSender()).isNull(); + then(anotherLog.getContent()).isNull(); then(anotherLog.getMccMnc()).isNull(); thenPriceIsEqualTo(anotherLog.getPrice(), givenPricePerMessageMessage2, givenCurrencyMessage2); thenStatusIsDelivered(anotherLog.getStatus()); @@ -1086,9 +1138,9 @@ void shouldGetSmsLogs() { }; var call = sendSmsApi - .getOutboundSmsMessageLogs() + .getOutboundSmsMessageLogsV3() .bulkId(List.of(givenBulkId)) - .sentSince(givenSentSinceDateTime); + .sentSince(givenSentSinceString); testSuccessfulCall(call::execute, assertions); testSuccessfulAsyncCall(call::executeAsync, assertions); } @@ -1114,7 +1166,7 @@ private String givenPendingResponse( private String givenPendingResponseDetails(String givenTo, String givenMessageId) { return String.format( - "{" + " \"to\": \"%s\"," + "{" + " \"destination\": \"%s\"," + " \"status\": {" + " \"groupId\": %d," + " \"groupName\": \"%s\"," @@ -1135,25 +1187,25 @@ private String givenPendingResponseDetails(String givenTo, String givenMessageId private void thenResponseDetailsForMessageHasStatusPending( SmsResponseDetails responseDetails, String expectedTo, String expectedMessageId) { - then(responseDetails.getTo()).isEqualTo(expectedTo); + then(responseDetails.getDestination()).isEqualTo(expectedTo); then(responseDetails.getMessageId()).isEqualTo(expectedMessageId); thenStatusIsPending(responseDetails.getStatus()); } - private void thenStatusIsPending(MessageStatus status) { + private void thenStatusIsPending(SmsMessageStatus status) { then(status).isNotNull(); then(status.getGroupId()).isEqualTo(PENDING_STATUS_GROUP_ID); - then(status.getGroupName()).isEqualTo(PENDING_STATUS_GROUP_NAME); + then(status.getGroupName()).isEqualTo(SmsMessageGeneralStatus.PENDING); then(status.getId()).isEqualTo(PENDING_STATUS_ID); then(status.getName()).isEqualTo(PENDING_STATUS_NAME); then(status.getDescription()).isEqualTo(PENDING_STATUS_DESCRIPTION); then(status.getAction()).isNull(); } - private void thenStatusIsDelivered(MessageStatus status) { + private void thenStatusIsDelivered(SmsMessageStatus status) { then(status).isNotNull(); then(status.getGroupId()).isEqualTo(DELIVERED_STATUS_GROUP_ID); - then(status.getGroupName()).isEqualTo(DELIVERED_STATUS_GROUP_NAME); + then(status.getGroupName()).isEqualTo(SmsMessageGeneralStatus.DELIVERED); then(status.getId()).isEqualTo(DELIVERED_STATUS_ID); then(status.getName()).isEqualTo(DELIVERED_STATUS_NAME); then(status.getDescription()).isEqualTo(DELIVERED_STATUS_DESCRIPTION); @@ -1166,10 +1218,10 @@ private void thenPriceIsEqualTo(MessagePrice price, double expectedPricePerMessa then(price.getCurrency()).isEqualTo(expectedCurrency); } - private void thenNoError(MessageError error) { + private void thenNoError(SmsMessageError error) { then(error).isNotNull(); then(error.getGroupId()).isEqualTo(NO_ERROR_GROUP_ID); - then(error.getGroupName()).isEqualTo(NO_ERROR_GROUP_NAME); + then(error.getGroupName()).isEqualTo(SmsMessageErrorGroup.OK); then(error.getId()).isEqualTo(NO_ERROR_ID); then(error.getName()).isEqualTo(NO_ERROR_NAME); then(error.getDescription()).isEqualTo(NO_ERROR_DESCRIPTION); @@ -1289,13 +1341,13 @@ void shouldSendSMSDeliveryReports() { String givenCurrencyMessage1 = "EUR"; Integer givenStatusGroupIdMessage1 = 3; - String givenStatusGroupNameMessage1 = "DELIVERED"; + SmsMessageGeneralStatus givenStatusGroupNameMessage1 = SmsMessageGeneralStatus.DELIVERED; Integer givenStatusIdMessage1 = 5; String givenStatusNameMessage1 = "DELIVERED_TO_HANDSET"; String givenStatusDescriptionMessage1 = "Message delivered to handset"; Integer givenErrorGroupIdMessage1 = 0; - String givenErrorGroupNameMessage1 = "OK"; + SmsMessageErrorGroup givenErrorGroupNameMessage1 = SmsMessageErrorGroup.OK; Integer givenErrorIdMessage1 = 0; String givenErrorNameMessage1 = "NO_ERROR"; String givenErrorDescriptionMessage1 = "No Error"; @@ -1311,13 +1363,13 @@ void shouldSendSMSDeliveryReports() { String givenCurrencyMessage2 = "EUR"; Integer givenStatusGroupIdMessage2 = 3; - String givenStatusGroupNameMessage2 = "DELIVERED"; + SmsMessageGeneralStatus givenStatusGroupNameMessage2 = SmsMessageGeneralStatus.DELIVERED; Integer givenStatusIdMessage2 = 5; String givenStatusNameMessage2 = "DELIVERED_TO_HANDSET"; String givenStatusDescriptionMessage2 = "Message delivered to handset"; Integer givenErrorGroupIdMessage2 = 0; - String givenErrorGroupNameMessage2 = "OK"; + SmsMessageErrorGroup givenErrorGroupNameMessage2 = SmsMessageErrorGroup.OK; Integer givenErrorIdMessage2 = 0; String givenErrorNameMessage2 = "NO_ERROR"; String givenErrorDescriptionMessage2 = "No Error"; @@ -1329,13 +1381,15 @@ void shouldSendSMSDeliveryReports() { "{" + " \"results\": [" + " {" + " \"bulkId\": \"%s\"," - + " \"applicationId\": \"%s\"," - + " \"entityId\": \"%s\"," + + " \"platform\": {" + + " \"applicationId\": \"%s\"," + + " \"entityId\": \"%s\"" + + " }," + " \"messageId\": \"%s\"," + " \"to\": \"%s\"," + " \"sentAt\": \"%s\"," + " \"doneAt\": \"%s\"," - + " \"smsCount\": %s," + + " \"messageCount\": %s," + " \"price\": {" + " \"pricePerMessage\": %g," + " \"currency\": \"%s\"" @@ -1362,7 +1416,7 @@ void shouldSendSMSDeliveryReports() { + " \"to\": \"%s\"," + " \"sentAt\": \"%s\"," + " \"doneAt\": \"%s\"," - + " \"smsCount\": %s," + + " \"messageCount\": %s," + " \"price\": {" + " \"pricePerMessage\": %g," + " \"currency\": \"%s\"" @@ -1442,56 +1496,56 @@ void shouldSendSMSDeliveryReports() { OffsetDateTime expectedSendAtMessage2 = OffsetDateTime.of(LocalDateTime.of(2019, 11, 9, 17, 0), ZoneOffset.UTC); OffsetDateTime expectedDoneAtMessage2 = OffsetDateTime.of(LocalDateTime.of(2019, 11, 9, 17, 0), ZoneOffset.UTC); - Consumer assertions = (deliveryResult) -> { + Consumer assertions = (deliveryResult) -> { then(deliveryResult).isNotNull(); - List reports = deliveryResult.getResults(); + List reports = deliveryResult.getResults(); then(reports).hasSize(2); - SmsReport report1 = reports.get(0); + SmsDeliveryReport report1 = reports.get(0); then(report1.getBulkId()).isEqualTo(givenBulkId); - then(report1.getApplicationId()).isEqualTo(givenApplicationId); - then(report1.getEntityId()).isEqualTo(givenEntityId); + then(report1.getPlatform().getApplicationId()).isEqualTo(givenApplicationId); + then(report1.getPlatform().getEntityId()).isEqualTo(givenEntityId); then(report1.getMessageId()).isEqualTo(givenMessageIdMessage1); then(report1.getTo()).isEqualTo(givenToMessage1); then(report1.getSentAt()).isEqualTo(expectedSendAtMessage1); then(report1.getDoneAt()).isEqualTo(expectedDoneAtMessage1); - then(report1.getSmsCount()).isEqualTo(givenSmsCountMessage1); + then(report1.getMessageCount()).isEqualTo(givenSmsCountMessage1); MessagePrice price1 = report1.getPrice(); then(report1.getPrice()).isNotNull(); then(price1.getPricePerMessage()).isEqualTo(givenPricePerMessageMessage1); then(price1.getCurrency()).isEqualTo(givenCurrencyMessage1); then(report1.getStatus()).isNotNull(); - MessageStatus status1 = report1.getStatus(); + SmsMessageStatus status1 = report1.getStatus(); then(status1.getGroupId()).isEqualTo(givenStatusGroupIdMessage1); then(status1.getGroupName()).isEqualTo(givenStatusGroupNameMessage1); then(status1.getId()).isEqualTo(givenStatusIdMessage1); then(status1.getDescription()).isEqualTo(givenStatusDescriptionMessage1); then(report1.getError()).isNotNull(); - MessageError error1 = report1.getError(); + SmsMessageError error1 = report1.getError(); then(error1.getGroupId()).isEqualTo(givenErrorGroupIdMessage1); then(error1.getGroupName()).isEqualTo(givenErrorGroupNameMessage1); then(error1.getName()).isEqualTo(givenErrorNameMessage1); then(error1.getDescription()).isEqualTo(givenErrorDescriptionMessage1); then(error1.getPermanent()).isEqualTo(givenErrorPermanentMessage1); - SmsReport report2 = reports.get(1); + SmsDeliveryReport report2 = reports.get(1); then(report2.getBulkId()).isEqualTo(givenBulkId); then(report2.getMessageId()).isEqualTo(givenMessageIdMessage2); then(report2.getTo()).isEqualTo(givenToMessage2); then(report2.getSentAt()).isEqualTo(expectedSendAtMessage2); then(report2.getDoneAt()).isEqualTo(expectedDoneAtMessage2); - then(report2.getSmsCount()).isEqualTo(givenSmsCountMessage2); + then(report2.getMessageCount()).isEqualTo(givenSmsCountMessage2); MessagePrice price2 = report2.getPrice(); then(report2.getPrice()).isNotNull(); then(price2.getPricePerMessage()).isEqualTo(givenPricePerMessageMessage2); then(price2.getCurrency()).isEqualTo(givenCurrencyMessage2); then(report2.getStatus()).isNotNull(); - MessageStatus status2 = report2.getStatus(); + SmsMessageStatus status2 = report2.getStatus(); then(status2.getGroupId()).isEqualTo(givenStatusGroupIdMessage2); then(status2.getGroupName()).isEqualTo(givenStatusGroupNameMessage2); then(status2.getId()).isEqualTo(givenStatusIdMessage2); then(status2.getDescription()).isEqualTo(givenStatusDescriptionMessage2); then(report2.getError()).isNotNull(); - MessageError error2 = report2.getError(); + SmsMessageError error2 = report2.getError(); then(error2.getGroupId()).isEqualTo(givenErrorGroupIdMessage2); then(error2.getGroupName()).isEqualTo(givenErrorGroupNameMessage2); then(error2.getName()).isEqualTo(givenErrorNameMessage2); @@ -1500,7 +1554,7 @@ void shouldSendSMSDeliveryReports() { }; var call = sendSmsApi - .getOutboundSmsMessageDeliveryReports() + .getOutboundSmsMessageDeliveryReportsV3() .bulkId(givenBulkId) .messageId(messageIdParameter) .limit(Integer.valueOf(limitParameter)); From 3b1ad3299e9908c482c36bec002c30bebc36ffcc Mon Sep 17 00:00:00 2001 From: Tamas Juhasz Date: Fri, 2 Aug 2024 13:47:03 +0200 Subject: [PATCH 2/6] Updated SmsApi class and SmsApiTest --- src/main/java/com/infobip/api/SmsApi.java | 132 +++++++++--------- src/test/java/com/infobip/api/SmsApiTest.java | 6 +- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/main/java/com/infobip/api/SmsApi.java b/src/main/java/com/infobip/api/SmsApi.java index 1d7fc07..18e1432 100644 --- a/src/main/java/com/infobip/api/SmsApi.java +++ b/src/main/java/com/infobip/api/SmsApi.java @@ -147,7 +147,7 @@ public GetInboundSmsMessagesRequest getInboundSmsMessages() { return new GetInboundSmsMessagesRequest(); } - private RequestDefinition getOutboundSmsMessageDeliveryReportsV3Definition( + private RequestDefinition getOutboundSmsMessageDeliveryReportsDefinition( String bulkId, String messageId, Integer limit, @@ -180,9 +180,9 @@ private RequestDefinition getOutboundSmsMessageDeliveryReportsV3Definition( } /** - * getOutboundSmsMessageDeliveryReportsV3 request builder class. + * getOutboundSmsMessageDeliveryReports request builder class. */ - public class GetOutboundSmsMessageDeliveryReportsV3Request { + public class GetOutboundSmsMessageDeliveryReportsRequest { private String bulkId; private String messageId; private Integer limit; @@ -190,15 +190,15 @@ public class GetOutboundSmsMessageDeliveryReportsV3Request { private String applicationId; private String campaignReferenceId; - private GetOutboundSmsMessageDeliveryReportsV3Request() {} + private GetOutboundSmsMessageDeliveryReportsRequest() {} /** * Sets bulkId. * * @param bulkId The ID that uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address. (optional) - * @return GetOutboundSmsMessageDeliveryReportsV3Request + * @return GetOutboundSmsMessageDeliveryReportsRequest */ - public GetOutboundSmsMessageDeliveryReportsV3Request bulkId(String bulkId) { + public GetOutboundSmsMessageDeliveryReportsRequest bulkId(String bulkId) { this.bulkId = bulkId; return this; } @@ -207,9 +207,9 @@ public GetOutboundSmsMessageDeliveryReportsV3Request bulkId(String bulkId) { * Sets messageId. * * @param messageId The ID that uniquely identifies the message sent. (optional) - * @return GetOutboundSmsMessageDeliveryReportsV3Request + * @return GetOutboundSmsMessageDeliveryReportsRequest */ - public GetOutboundSmsMessageDeliveryReportsV3Request messageId(String messageId) { + public GetOutboundSmsMessageDeliveryReportsRequest messageId(String messageId) { this.messageId = messageId; return this; } @@ -218,9 +218,9 @@ public GetOutboundSmsMessageDeliveryReportsV3Request messageId(String messageId) * Sets limit. * * @param limit Maximum number of delivery reports to be returned. If not set, the latest 50 records are returned. Maximum limit value is 1000 and you can only access reports for the last 48h (optional, default to 50) - * @return GetOutboundSmsMessageDeliveryReportsV3Request + * @return GetOutboundSmsMessageDeliveryReportsRequest */ - public GetOutboundSmsMessageDeliveryReportsV3Request limit(Integer limit) { + public GetOutboundSmsMessageDeliveryReportsRequest limit(Integer limit) { this.limit = limit; return this; } @@ -229,9 +229,9 @@ public GetOutboundSmsMessageDeliveryReportsV3Request limit(Integer limit) { * Sets entityId. * * @param entityId Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). (optional) - * @return GetOutboundSmsMessageDeliveryReportsV3Request + * @return GetOutboundSmsMessageDeliveryReportsRequest */ - public GetOutboundSmsMessageDeliveryReportsV3Request entityId(String entityId) { + public GetOutboundSmsMessageDeliveryReportsRequest entityId(String entityId) { this.entityId = entityId; return this; } @@ -240,9 +240,9 @@ public GetOutboundSmsMessageDeliveryReportsV3Request entityId(String entityId) { * Sets applicationId. * * @param applicationId Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). (optional) - * @return GetOutboundSmsMessageDeliveryReportsV3Request + * @return GetOutboundSmsMessageDeliveryReportsRequest */ - public GetOutboundSmsMessageDeliveryReportsV3Request applicationId(String applicationId) { + public GetOutboundSmsMessageDeliveryReportsRequest applicationId(String applicationId) { this.applicationId = applicationId; return this; } @@ -251,40 +251,40 @@ public GetOutboundSmsMessageDeliveryReportsV3Request applicationId(String applic * Sets campaignReferenceId. * * @param campaignReferenceId ID of a campaign that was sent in the message. (optional) - * @return GetOutboundSmsMessageDeliveryReportsV3Request + * @return GetOutboundSmsMessageDeliveryReportsRequest */ - public GetOutboundSmsMessageDeliveryReportsV3Request campaignReferenceId(String campaignReferenceId) { + public GetOutboundSmsMessageDeliveryReportsRequest campaignReferenceId(String campaignReferenceId) { this.campaignReferenceId = campaignReferenceId; return this; } /** - * Executes the getOutboundSmsMessageDeliveryReportsV3 request. + * Executes the getOutboundSmsMessageDeliveryReports request. * * @return SmsDeliveryReports The deserialized response. * @throws ApiException If the API call fails or an error occurs during the request or response processing. */ public SmsDeliveryReports execute() throws ApiException { - RequestDefinition getOutboundSmsMessageDeliveryReportsV3Definition = - getOutboundSmsMessageDeliveryReportsV3Definition( + RequestDefinition getOutboundSmsMessageDeliveryReportsDefinition = + getOutboundSmsMessageDeliveryReportsDefinition( bulkId, messageId, limit, entityId, applicationId, campaignReferenceId); return apiClient.execute( - getOutboundSmsMessageDeliveryReportsV3Definition, + getOutboundSmsMessageDeliveryReportsDefinition, new TypeReference() {}.getType()); } /** - * Executes the getOutboundSmsMessageDeliveryReportsV3 request asynchronously. + * Executes the getOutboundSmsMessageDeliveryReports request asynchronously. * * @param callback The {@link ApiCallback} to be invoked. * @return The {@link okhttp3.Call} associated with the API request. */ public okhttp3.Call executeAsync(ApiCallback callback) { - RequestDefinition getOutboundSmsMessageDeliveryReportsV3Definition = - getOutboundSmsMessageDeliveryReportsV3Definition( + RequestDefinition getOutboundSmsMessageDeliveryReportsDefinition = + getOutboundSmsMessageDeliveryReportsDefinition( bulkId, messageId, limit, entityId, applicationId, campaignReferenceId); return apiClient.executeAsync( - getOutboundSmsMessageDeliveryReportsV3Definition, + getOutboundSmsMessageDeliveryReportsDefinition, new TypeReference() {}.getType(), callback); } @@ -295,15 +295,15 @@ public okhttp3.Call executeAsync(ApiCallback callback) { *

* If you are unable to receive real-time message delivery reports towards your endpoint for various reasons, we offer you an API method to fetch batches of message reports to confirm whether specific messages have been delivered. Each request towards this endpoint will return batches of the latest message reports. Please note they will be returned only once. * - * @return GetOutboundSmsMessageDeliveryReportsV3Request + * @return GetOutboundSmsMessageDeliveryReportsRequest * @see Learn more about the SMS channel and its use cases */ @Beta - public GetOutboundSmsMessageDeliveryReportsV3Request getOutboundSmsMessageDeliveryReportsV3() { - return new GetOutboundSmsMessageDeliveryReportsV3Request(); + public GetOutboundSmsMessageDeliveryReportsRequest getOutboundSmsMessageDeliveryReports() { + return new GetOutboundSmsMessageDeliveryReportsRequest(); } - private RequestDefinition getOutboundSmsMessageLogsV3Definition( + private RequestDefinition getOutboundSmsMessageLogsDefinition( String mcc, String mnc, String sender, @@ -370,9 +370,9 @@ private RequestDefinition getOutboundSmsMessageLogsV3Definition( } /** - * getOutboundSmsMessageLogsV3 request builder class. + * getOutboundSmsMessageLogs request builder class. */ - public class GetOutboundSmsMessageLogsV3Request { + public class GetOutboundSmsMessageLogsRequest { private String mcc; private String mnc; private String sender; @@ -387,15 +387,15 @@ public class GetOutboundSmsMessageLogsV3Request { private String applicationId; private List campaignReferenceId; - private GetOutboundSmsMessageLogsV3Request() {} + private GetOutboundSmsMessageLogsRequest() {} /** * Sets mcc. * * @param mcc Mobile Country Code. (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request mcc(String mcc) { + public GetOutboundSmsMessageLogsRequest mcc(String mcc) { this.mcc = mcc; return this; } @@ -404,9 +404,9 @@ public GetOutboundSmsMessageLogsV3Request mcc(String mcc) { * Sets mnc. * * @param mnc Mobile Network Code. (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request mnc(String mnc) { + public GetOutboundSmsMessageLogsRequest mnc(String mnc) { this.mnc = mnc; return this; } @@ -415,9 +415,9 @@ public GetOutboundSmsMessageLogsV3Request mnc(String mnc) { * Sets sender. * * @param sender The sender ID which can be alphanumeric or numeric. (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request sender(String sender) { + public GetOutboundSmsMessageLogsRequest sender(String sender) { this.sender = sender; return this; } @@ -426,9 +426,9 @@ public GetOutboundSmsMessageLogsV3Request sender(String sender) { * Sets destination. * * @param destination Message destination address. (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request destination(String destination) { + public GetOutboundSmsMessageLogsRequest destination(String destination) { this.destination = destination; return this; } @@ -437,9 +437,9 @@ public GetOutboundSmsMessageLogsV3Request destination(String destination) { * Sets bulkId. * * @param bulkId Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request. May contain multiple comma-separated values. Maximum length 2048 characters. (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request bulkId(List bulkId) { + public GetOutboundSmsMessageLogsRequest bulkId(List bulkId) { this.bulkId = bulkId; return this; } @@ -448,9 +448,9 @@ public GetOutboundSmsMessageLogsV3Request bulkId(List bulkId) { * Sets messageId. * * @param messageId Unique message ID for which a log is requested. May contain multiple comma-separated values. Maximum length 2048 characters. (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request messageId(List messageId) { + public GetOutboundSmsMessageLogsRequest messageId(List messageId) { this.messageId = messageId; return this; } @@ -459,9 +459,9 @@ public GetOutboundSmsMessageLogsV3Request messageId(List messageId) { * Sets generalStatus. * * @param generalStatus (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request generalStatus(SmsMessageGeneralStatus generalStatus) { + public GetOutboundSmsMessageLogsRequest generalStatus(SmsMessageGeneralStatus generalStatus) { this.generalStatus = generalStatus; return this; } @@ -470,9 +470,9 @@ public GetOutboundSmsMessageLogsV3Request generalStatus(SmsMessageGeneralStatus * Sets sentSince. * * @param sentSince The logs will only include messages sent after this date. Use it together with sentUntil to return a time range or if you want to fetch more than 1000 logs allowed per call. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request sentSince(String sentSince) { + public GetOutboundSmsMessageLogsRequest sentSince(String sentSince) { this.sentSince = sentSince; return this; } @@ -481,9 +481,9 @@ public GetOutboundSmsMessageLogsV3Request sentSince(String sentSince) { * Sets sentUntil. * * @param sentUntil The logs will only include messages sent before this date. Use it together with sentSince to return a time range or if you want to fetch more than 1000 logs allowed per call. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ. (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request sentUntil(String sentUntil) { + public GetOutboundSmsMessageLogsRequest sentUntil(String sentUntil) { this.sentUntil = sentUntil; return this; } @@ -492,9 +492,9 @@ public GetOutboundSmsMessageLogsV3Request sentUntil(String sentUntil) { * Sets limit. * * @param limit Maximum number of messages to include in logs. If not set, the latest 50 records are returned. Maximum limit value is 1000 and you can only access logs for the last 48h. If you want to fetch more than 1000 logs allowed per call, use sentBefore and sentUntil to retrieve them in pages. (optional, default to 50) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request limit(Integer limit) { + public GetOutboundSmsMessageLogsRequest limit(Integer limit) { this.limit = limit; return this; } @@ -503,9 +503,9 @@ public GetOutboundSmsMessageLogsV3Request limit(Integer limit) { * Sets entityId. * * @param entityId Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request entityId(String entityId) { + public GetOutboundSmsMessageLogsRequest entityId(String entityId) { this.entityId = entityId; return this; } @@ -514,9 +514,9 @@ public GetOutboundSmsMessageLogsV3Request entityId(String entityId) { * Sets applicationId. * * @param applicationId Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management). (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request applicationId(String applicationId) { + public GetOutboundSmsMessageLogsRequest applicationId(String applicationId) { this.applicationId = applicationId; return this; } @@ -525,21 +525,21 @@ public GetOutboundSmsMessageLogsV3Request applicationId(String applicationId) { * Sets campaignReferenceId. * * @param campaignReferenceId ID of a campaign that was sent in the message. May contain multiple comma-separated values. (optional) - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest */ - public GetOutboundSmsMessageLogsV3Request campaignReferenceId(List campaignReferenceId) { + public GetOutboundSmsMessageLogsRequest campaignReferenceId(List campaignReferenceId) { this.campaignReferenceId = campaignReferenceId; return this; } /** - * Executes the getOutboundSmsMessageLogsV3 request. + * Executes the getOutboundSmsMessageLogs request. * * @return SmsLogsResponse The deserialized response. * @throws ApiException If the API call fails or an error occurs during the request or response processing. */ public SmsLogsResponse execute() throws ApiException { - RequestDefinition getOutboundSmsMessageLogsV3Definition = getOutboundSmsMessageLogsV3Definition( + RequestDefinition getOutboundSmsMessageLogsDefinition = getOutboundSmsMessageLogsDefinition( mcc, mnc, sender, @@ -554,17 +554,17 @@ public SmsLogsResponse execute() throws ApiException { applicationId, campaignReferenceId); return apiClient.execute( - getOutboundSmsMessageLogsV3Definition, new TypeReference() {}.getType()); + getOutboundSmsMessageLogsDefinition, new TypeReference() {}.getType()); } /** - * Executes the getOutboundSmsMessageLogsV3 request asynchronously. + * Executes the getOutboundSmsMessageLogs request asynchronously. * * @param callback The {@link ApiCallback} to be invoked. * @return The {@link okhttp3.Call} associated with the API request. */ public okhttp3.Call executeAsync(ApiCallback callback) { - RequestDefinition getOutboundSmsMessageLogsV3Definition = getOutboundSmsMessageLogsV3Definition( + RequestDefinition getOutboundSmsMessageLogsDefinition = getOutboundSmsMessageLogsDefinition( mcc, mnc, sender, @@ -579,7 +579,7 @@ public okhttp3.Call executeAsync(ApiCallback callback) { applicationId, campaignReferenceId); return apiClient.executeAsync( - getOutboundSmsMessageLogsV3Definition, new TypeReference() {}.getType(), callback); + getOutboundSmsMessageLogsDefinition, new TypeReference() {}.getType(), callback); } } @@ -588,12 +588,12 @@ public okhttp3.Call executeAsync(ApiCallback callback) { *

* Use this method for displaying logs, for example, in the user interface. Available are the logs for the last 48 hours and you can only retrieve maximum of 1000 logs per call. See [message delivery reports](#channels/sms/get-outbound-sms-message-delivery-reports-v3) if your use case is to verify message delivery. * - * @return GetOutboundSmsMessageLogsV3Request + * @return GetOutboundSmsMessageLogsRequest * @see Learn more about the SMS channel and its use cases */ @Beta - public GetOutboundSmsMessageLogsV3Request getOutboundSmsMessageLogsV3() { - return new GetOutboundSmsMessageLogsV3Request(); + public GetOutboundSmsMessageLogsRequest getOutboundSmsMessageLogs() { + return new GetOutboundSmsMessageLogsRequest(); } private RequestDefinition getScheduledSmsMessagesDefinition(String bulkId) { diff --git a/src/test/java/com/infobip/api/SmsApiTest.java b/src/test/java/com/infobip/api/SmsApiTest.java index c2a2218..7b83788 100644 --- a/src/test/java/com/infobip/api/SmsApiTest.java +++ b/src/test/java/com/infobip/api/SmsApiTest.java @@ -945,7 +945,7 @@ void shouldGetDeliveryReports() { then(error2.getPermanent()).isEqualTo(givenErrorPermanent); }; - var call = api.getOutboundSmsMessageDeliveryReportsV3(); + var call = api.getOutboundSmsMessageDeliveryReports(); testSuccessfulCall(call::execute, assertions); testSuccessfulAsyncCall(call::executeAsync, assertions); } @@ -1138,7 +1138,7 @@ void shouldGetSmsLogs() { }; var call = sendSmsApi - .getOutboundSmsMessageLogsV3() + .getOutboundSmsMessageLogs() .bulkId(List.of(givenBulkId)) .sentSince(givenSentSinceString); testSuccessfulCall(call::execute, assertions); @@ -1554,7 +1554,7 @@ void shouldSendSMSDeliveryReports() { }; var call = sendSmsApi - .getOutboundSmsMessageDeliveryReportsV3() + .getOutboundSmsMessageDeliveryReports() .bulkId(givenBulkId) .messageId(messageIdParameter) .limit(Integer.valueOf(limitParameter)); From b77c88f2198f544661941a5c685a3186b7917706 Mon Sep 17 00:00:00 2001 From: Tamas Juhasz Date: Fri, 2 Aug 2024 13:48:34 +0200 Subject: [PATCH 3/6] Bumping version to 5.0.0 --- CHANGELOG.md | 2 +- README.md | 2 +- pom.xml | 2 +- src/main/java/com/infobip/RequestFactory.java | 2 +- src/test/java/com/infobip/RequestFactoryTest.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b1279..7bc69b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to the library will be documented in this file. The format of the file is based on [Keep a Changelog](http://keepachangelog.com/) and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file. -## [ [4.4.0](https://github.com/infobip/infobip-api-java-client/releases/tag/4.4.0) ] - 2024-08-02 +## [ [5.0.0](https://github.com/infobip/infobip-api-java-client/releases/tag/5.0.0) ] - 2024-08-02 ⚠️ **IMPORTANT NOTE:** This release contains compile time breaking changes. All changes, including breaking changes, are addressed and explained in the list bellow. diff --git a/README.md b/README.md index ce72d79..b5c203e 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Simply add the following in your project's POM file under `dependencies` tag: com.infobip infobip-api-java-client - 4.4.0 + 5.0.0 ``` diff --git a/pom.xml b/pom.xml index 7cbf8f7..3c1e47b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.infobip infobip-api-java-client - 4.4.0 + 5.0.0 jar infobip-api-java-client diff --git a/src/main/java/com/infobip/RequestFactory.java b/src/main/java/com/infobip/RequestFactory.java index 896a318..388d2e6 100644 --- a/src/main/java/com/infobip/RequestFactory.java +++ b/src/main/java/com/infobip/RequestFactory.java @@ -26,7 +26,7 @@ */ final class RequestFactory { - private static final String USER_AGENT_HEADER_VALUE = "infobip-api-client-java/4.4.0"; + private static final String USER_AGENT_HEADER_VALUE = "infobip-api-client-java/5.0.0"; private final ApiKey apiKey; private final BaseUrl baseUrl; diff --git a/src/test/java/com/infobip/RequestFactoryTest.java b/src/test/java/com/infobip/RequestFactoryTest.java index 11905a5..645c241 100644 --- a/src/test/java/com/infobip/RequestFactoryTest.java +++ b/src/test/java/com/infobip/RequestFactoryTest.java @@ -38,7 +38,7 @@ class RequestFactoryTest { private static final String GIVEN_API_KEY_VALUE = "apiKeyValue"; private static final ApiKey GIVEN_API_KEY = ApiKey.from(GIVEN_API_KEY_VALUE); - private static final String EXPECTED_USER_AGENT_HEADER_VALUE = "infobip-api-client-java/4.4.0"; + private static final String EXPECTED_USER_AGENT_HEADER_VALUE = "infobip-api-client-java/5.0.0"; private final OkHttpClient client = new OkHttpClient(); private final JSON json = new JSON(); From 2daff41323f5ee780d838ce294248eef2e56f7f8 Mon Sep 17 00:00:00 2001 From: Tamas Juhasz Date: Fri, 2 Aug 2024 14:23:50 +0200 Subject: [PATCH 4/6] Updated README send SMS example. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b5c203e..ef5826c 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ See below, a simple example of sending a single SMS message to a single recipien SmsMessage message = new SmsMessage() .sender("InfoSMS") - .destinations(new SmsDestination().to("41793026727")) + .addDestinationsItem(new SmsDestination().to("41793026727")) .content(new SmsTextMessageContent().text("Hello World from infobip-api-java-client!")); SmsRequestEnvelope smsMessageRequest = new SmsRequestEnvelope() From 68c7661fd55deff41f4273f299c44e0248ee367b Mon Sep 17 00:00:00 2001 From: Tamas Juhasz Date: Fri, 2 Aug 2024 14:35:16 +0200 Subject: [PATCH 5/6] Removed @Beta annotation from SMS endpoints. --- src/main/java/com/infobip/api/SmsApi.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/com/infobip/api/SmsApi.java b/src/main/java/com/infobip/api/SmsApi.java index 18e1432..ad5b24f 100644 --- a/src/main/java/com/infobip/api/SmsApi.java +++ b/src/main/java/com/infobip/api/SmsApi.java @@ -10,7 +10,6 @@ package com.infobip.api; import com.fasterxml.jackson.core.type.TypeReference; -import com.google.common.annotations.Beta; import com.infobip.ApiCallback; import com.infobip.ApiClient; import com.infobip.ApiException; @@ -298,7 +297,6 @@ public okhttp3.Call executeAsync(ApiCallback callback) { * @return GetOutboundSmsMessageDeliveryReportsRequest * @see Learn more about the SMS channel and its use cases */ - @Beta public GetOutboundSmsMessageDeliveryReportsRequest getOutboundSmsMessageDeliveryReports() { return new GetOutboundSmsMessageDeliveryReportsRequest(); } @@ -591,7 +589,6 @@ public okhttp3.Call executeAsync(ApiCallback callback) { * @return GetOutboundSmsMessageLogsRequest * @see Learn more about the SMS channel and its use cases */ - @Beta public GetOutboundSmsMessageLogsRequest getOutboundSmsMessageLogs() { return new GetOutboundSmsMessageLogsRequest(); } @@ -893,7 +890,6 @@ public okhttp3.Call executeAsync(ApiCallback callback) { * @return SendSmsMessagesRequest * @see Learn more about the SMS channel and its use cases */ - @Beta public SendSmsMessagesRequest sendSmsMessages(SmsRequestEnvelope smsRequestEnvelope) { return new SendSmsMessagesRequest(smsRequestEnvelope); } From 745a0813b37d2bc0affe5a492a5e21cd337fcd24 Mon Sep 17 00:00:00 2001 From: Tamas Juhasz Date: Tue, 20 Aug 2024 08:39:48 +0200 Subject: [PATCH 6/6] Updated README example. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ef5826c..df026cb 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,9 @@ See below, a simple example of sending a single SMS message to a single recipien SmsApi smsApi = new SmsApi(apiClient); SmsMessage message = new SmsMessage() - .sender("InfoSMS") - .addDestinationsItem(new SmsDestination().to("41793026727")) - .content(new SmsTextMessageContent().text("Hello World from infobip-api-java-client!")); + .sender("InfoSMS") + .addDestinationsItem(new SmsDestination().to("41793026727")) + .content(new SmsTextMessageContent().text("Hello World from infobip-api-java-client!")); SmsRequestEnvelope smsMessageRequest = new SmsRequestEnvelope() .messages(List.of(message));