- * See all scheduled messages and their scheduled date and time. To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
+ * See all [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms) and their scheduled date and time. To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
*
* @param bulkId (required)
* @return GetScheduledSmsMessagesRequest
@@ -720,7 +756,7 @@ public okhttp3.Call executeAsync(ApiCallback
- * See the status of scheduled messages. To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
+ * See the status of [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
*
* @param bulkId (required)
* @return GetScheduledSmsMessagesStatusRequest
@@ -842,7 +878,7 @@ public okhttp3.Call executeAsync(ApiCallback
- * Change the date and time of already scheduled messages. To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
+ * Change the date and time of already [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
*
* @param bulkId (required)
* @param smsBulkRequest (required)
@@ -970,7 +1006,7 @@ public okhttp3.Call executeAsync(ApiCallback
- * Change the status or completely cancel sending of scheduled messages. To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
+ * Change the status or completely cancel sending of [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the `sendAt` field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
*
* @param bulkId (required)
* @param smsUpdateStatusRequest (required)
diff --git a/src/main/java/com/infobip/model/SmsCursorPageInfo.java b/src/main/java/com/infobip/model/SmsCursorPageInfo.java
new file mode 100644
index 0000000..b198cbd
--- /dev/null
+++ b/src/main/java/com/infobip/model/SmsCursorPageInfo.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;
+
+/**
+ * Cursor information.
+ */
+public class SmsCursorPageInfo {
+
+ private Integer limit;
+
+ private String nextCursor;
+
+ /**
+ * Sets limit.
+ *
+ * Field description:
+ * Requested limit.
+ *
+ * @param limit
+ * @return This {@link SmsCursorPageInfo instance}.
+ */
+ public SmsCursorPageInfo limit(Integer limit) {
+ this.limit = limit;
+ return this;
+ }
+
+ /**
+ * Returns limit.
+ *
+ * Field description:
+ * Requested limit.
+ *
+ * @return limit
+ */
+ @JsonProperty("limit")
+ public Integer getLimit() {
+ return limit;
+ }
+
+ /**
+ * Sets limit.
+ *
+ * Field description:
+ * Requested limit.
+ *
+ * @param limit
+ */
+ @JsonProperty("limit")
+ public void setLimit(Integer limit) {
+ this.limit = limit;
+ }
+
+ /**
+ * Sets nextCursor.
+ *
+ * Field description:
+ * The `cursor` value you will use in your next request to fetch the subsequent set of results.
+ *
+ * @param nextCursor
+ * @return This {@link SmsCursorPageInfo instance}.
+ */
+ public SmsCursorPageInfo nextCursor(String nextCursor) {
+ this.nextCursor = nextCursor;
+ return this;
+ }
+
+ /**
+ * Returns nextCursor.
+ *
+ * Field description:
+ * The `cursor` value you will use in your next request to fetch the subsequent set of results.
+ *
+ * @return nextCursor
+ */
+ @JsonProperty("nextCursor")
+ public String getNextCursor() {
+ return nextCursor;
+ }
+
+ /**
+ * Sets nextCursor.
+ *
+ * Field description:
+ * The `cursor` value you will use in your next request to fetch the subsequent set of results.
+ *
+ * @param nextCursor
+ */
+ @JsonProperty("nextCursor")
+ public void setNextCursor(String nextCursor) {
+ this.nextCursor = nextCursor;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ SmsCursorPageInfo smsCursorPageInfo = (SmsCursorPageInfo) o;
+ return Objects.equals(this.limit, smsCursorPageInfo.limit)
+ && Objects.equals(this.nextCursor, smsCursorPageInfo.nextCursor);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(limit, nextCursor);
+ }
+
+ @Override
+ public String toString() {
+ String newLine = System.lineSeparator();
+ return new StringBuilder()
+ .append("class SmsCursorPageInfo {")
+ .append(newLine)
+ .append(" limit: ")
+ .append(toIndentedString(limit))
+ .append(newLine)
+ .append(" nextCursor: ")
+ .append(toIndentedString(nextCursor))
+ .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/SmsLogsResponse.java b/src/main/java/com/infobip/model/SmsLogsResponse.java
index 3236f90..99f8f83 100644
--- a/src/main/java/com/infobip/model/SmsLogsResponse.java
+++ b/src/main/java/com/infobip/model/SmsLogsResponse.java
@@ -21,6 +21,8 @@ public class SmsLogsResponse {
private List
@@ -78,6 +80,37 @@ public void setResults(List
* 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)`.
+ * 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/sms-over-api#push-retry-cycle-notify-url) uses the following formula: `1min + (1min * retryNumber * retryNumber)`.
*
* @param url
* @return This {@link SmsMessageDeliveryReporting instance}.
@@ -41,7 +41,7 @@ public SmsMessageDeliveryReporting url(String url) {
* 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)`.
+ * 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/sms-over-api#push-retry-cycle-notify-url) uses the following formula: `1min + (1min * retryNumber * retryNumber)`.
*
* @return url
*/
@@ -54,7 +54,7 @@ public String getUrl() {
* 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)`.
+ * 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/sms-over-api#push-retry-cycle-notify-url) uses the following formula: `1min + (1min * retryNumber * retryNumber)`.
*
* @param url
*/
diff --git a/src/test/java/com/infobip/RequestFactoryTest.java b/src/test/java/com/infobip/RequestFactoryTest.java
index 61d229a..1aee096 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/6.1.0";
+ private static final String EXPECTED_USER_AGENT_HEADER_VALUE = "infobip-api-client-java/6.1.1";
private final OkHttpClient client = new OkHttpClient();
private final JSON json = new JSON();
diff --git a/src/test/java/com/infobip/api/SmsApiTest.java b/src/test/java/com/infobip/api/SmsApiTest.java
index f3b69cd..345f480 100644
--- a/src/test/java/com/infobip/api/SmsApiTest.java
+++ b/src/test/java/com/infobip/api/SmsApiTest.java
@@ -977,6 +977,10 @@ void shouldGetSmsLogs() {
var givenTextContent = "hello";
var givenContent = new SmsTextContent().text(givenTextContent);
+ var givenNextCursor = "next-cursor-id";
+ var givenCursorLimit = 10;
+ var givenUseCursor = true;
+
String givenResponse = String.format(
"{" + " \"results\": ["
+ " {"
@@ -1040,7 +1044,11 @@ void shouldGetSmsLogs() {
+ " \"permanent\": %b"
+ " }"
+ " }"
- + " ]"
+ + " ],"
+ + " \"cursor\": {"
+ + " \"limit\": %d,"
+ + " \"nextCursor\": \"%s\""
+ + " }"
+ "}",
givenBulkId,
givenApplicationId,
@@ -1082,13 +1090,17 @@ void shouldGetSmsLogs() {
NO_ERROR_ID,
NO_ERROR_NAME,
NO_ERROR_DESCRIPTION,
- NO_ERROR_IS_PERMANENT);
+ NO_ERROR_IS_PERMANENT,
+ givenCursorLimit,
+ givenNextCursor);
setUpSuccessGetRequest(
LOGS,
Map.of(
"bulkId", givenBulkId,
- "sentSince", givenSentSinceString),
+ "sentSince", givenSentSinceString,
+ "useCursor", Boolean.toString(givenUseCursor),
+ "cursor", givenNextCursor),
givenResponse);
SmsApi sendSmsApi = new SmsApi(getApiClient());
@@ -1141,12 +1153,19 @@ void shouldGetSmsLogs() {
thenPriceIsEqualTo(anotherLog.getPrice(), givenPricePerMessageMessage2, givenCurrencyMessage2);
thenStatusIsDelivered(anotherLog.getStatus());
thenNoError(anotherLog.getError());
+
+ SmsCursorPageInfo cursorPageInfo = smsLogsResponse.getCursor();
+ then(cursorPageInfo).isNotNull();
+ then(cursorPageInfo.getNextCursor()).isEqualTo(givenNextCursor);
+ then(cursorPageInfo.getLimit()).isEqualTo(givenCursorLimit);
};
var call = sendSmsApi
.getOutboundSmsMessageLogs()
.bulkId(List.of(givenBulkId))
- .sentSince(givenSentSinceDateTime);
+ .sentSince(givenSentSinceDateTime)
+ .useCursor(givenUseCursor)
+ .cursor(givenNextCursor);
testSuccessfulCall(call::execute, assertions);
testSuccessfulAsyncCall(call::executeAsync, assertions);
}