diff --git a/README.md b/README.md
index 2ddab61..6d1b233 100644
--- a/README.md
+++ b/README.md
@@ -44,7 +44,7 @@ Add this dependency to your project's POM:
com.twitter
twitter-api-java-sdk
- 1.1.1
+ 1.1.2
```
@@ -53,7 +53,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:
```groovy
-implementation "com.twitter:twitter-api-java-sdk:1.1.1"
+implementation "com.twitter:twitter-api-java-sdk:1.1.2"
```
### Others
@@ -66,7 +66,7 @@ mvn clean package
Then manually install the following JARs:
-- `target/twitter-api-java-sdk-1.1.1.jar`
+- `target/twitter-api-java-sdk-1.1.2.jar`
- `target/lib/*.jar`
## Twitter Credentials
@@ -201,6 +201,28 @@ You can implement the callback `ApiClientCallback.onAfterRefreshToken()` in orde
Check this [example](examples/src/main/java/com/twitter/clientlib/auth/OAuth20RefreshToken.java) of implementing `ApiClientCallback`
+## Rate limits retry mechanism
+
+
+Everyday many thousands of developers make requests to the Twitter developer platform. To help manage the sheer volume of these requests, limits are placed on the number of requests that can be made. These limits help us provide the reliable and scalable API that our developer community relies on.
+
+Each of our APIs use rate limits in different ways. To learn more about these differences between platforms, please review the specific rate limit pages within our specific API sections.
+
+To check connection limits response will return [three headers](https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/integrate/handling-disconnections#:~:text=Rate%20limits%20and%20usage). This is useful to understand how many times you can use the rule endpoint, and how many reconnections attempts are allowed for the streaming endpoint.
+
+The Java SDK provides APIs with a build-in retry mechanism to handle the rate limits. In case of getting an http error code 429, the API will check the response headers and will wait until the rate limit is reset.
+
+In order to use the retry mechanism call the APIs with an additional parameter `retries` as a first argument, check the following example:
+
+
+```java
+ int retries = 4;
+ streamResult = apiInstance.tweets().sampleStream(retries, null, tweetFields, null, null, null, null, 0);
+
+```
+
+Read more about Filtered stream and [rate limits](https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/integrate/handling-disconnections)
+
## Documentation for API Endpoints
diff --git a/examples/pom.xml b/examples/pom.xml
index f01dabf..591474c 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -16,7 +16,7 @@
com.twitter
twitter-api-java-sdk
- 1.1.1
+ 1.1.2
compile
diff --git a/examples/src/main/java/com/twitter/clientlib/HelloWorldStreaming.java b/examples/src/main/java/com/twitter/clientlib/HelloWorldStreaming.java
index 4232692..cda01bd 100644
--- a/examples/src/main/java/com/twitter/clientlib/HelloWorldStreaming.java
+++ b/examples/src/main/java/com/twitter/clientlib/HelloWorldStreaming.java
@@ -75,6 +75,11 @@ public static void main(String[] args) {
// BufferedReader reader = new BufferedReader(new InputStreamReader(streamResult));
// String line = reader.readLine();
// while (line != null) {
+// if(line.isEmpty()) {
+// System.err.println("==> " + line.isEmpty());
+// line = reader.readLine();
+// continue;
+// }
// System.out.println(json.getGson().fromJson(line, localVarReturnType).toString());
// line = reader.readLine();
// }
diff --git a/pom.xml b/pom.xml
index 8e292ba..1a7cea9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
twitter-api-java-sdk
jar
twitter-api-java-sdk
- 1.1.1
+ 1.1.2
https://github.com/twitterdev/twitter-api-java-sdk
Twitter API v2 available endpoints
diff --git a/src/main/java/com/twitter/clientlib/ApiClient.java b/src/main/java/com/twitter/clientlib/ApiClient.java
index f57d0a5..a529d1d 100644
--- a/src/main/java/com/twitter/clientlib/ApiClient.java
+++ b/src/main/java/com/twitter/clientlib/ApiClient.java
@@ -232,7 +232,7 @@ private void init() {
json = new JSON();
// Set default User-Agent.
- setUserAgent("twitter-api-java-sdk/1.1.1");
+ setUserAgent("twitter-api-java-sdk/1.1.2");
authentications = new HashMap();
}
@@ -1058,7 +1058,7 @@ public InputStream executeStream(Call call, Type returnType) throws ApiException
try {
Response response = call.execute();
if (!response.isSuccessful()) {
- throw new ApiException(response.code(), response.message());
+ throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), null);
}
if (response.body() == null) {
return null;
diff --git a/src/main/java/com/twitter/clientlib/api/ApiCommon.java b/src/main/java/com/twitter/clientlib/api/ApiCommon.java
index 6b79f4a..66f9b20 100644
--- a/src/main/java/com/twitter/clientlib/api/ApiCommon.java
+++ b/src/main/java/com/twitter/clientlib/api/ApiCommon.java
@@ -24,6 +24,9 @@
import com.github.scribejava.core.model.OAuth2AccessToken;
+import java.util.Calendar;
+import java.util.List;
+
import com.twitter.clientlib.ApiClient;
import com.twitter.clientlib.ApiException;
@@ -45,5 +48,38 @@ protected String[] reduceAuthNames(String[] localVarAuthNames) {
protected boolean isOAUth2AutoRefreshToken() {
return localVarApiClient.isOAUth2AutoRefreshToken();
}
+
+ public boolean handleRateLimit(ApiException e, Integer retries) throws ApiException {
+ boolean retryCall = false;
+ if (e.getCode() == 429 && retries > 0) {
+ long timeToWait = getTimeToWait(e);
+ try {
+ Thread.sleep(timeToWait);
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+ retryCall = true;
+ }
+ return retryCall;
+ }
+
+ long getTimeToWait(ApiException e) {
+ long timeToWait = 1000;
+
+ if (isRateLimitRemaining(e)) {
+ List xRateLimitReset = e.getResponseHeaders().get("x-rate-limit-reset");
+ if (xRateLimitReset != null && xRateLimitReset.get(0) != null) {
+ timeToWait = Long.parseLong(
+ xRateLimitReset.get(0)) * 1000 - Calendar.getInstance().getTimeInMillis();
+ }
+ }
+ return timeToWait;
+ }
+
+ boolean isRateLimitRemaining(ApiException e) {
+ List xRateLimitRemaining = e.getResponseHeaders().get("x-rate-limit-remaining");
+ return xRateLimitRemaining != null && xRateLimitRemaining.get(0) != null
+ && Long.parseLong(xRateLimitRemaining.get(0)) == 0;
+ }
}
diff --git a/src/main/java/com/twitter/clientlib/api/BookmarksApi.java b/src/main/java/com/twitter/clientlib/api/BookmarksApi.java
index fd2388d..070fe35 100644
--- a/src/main/java/com/twitter/clientlib/api/BookmarksApi.java
+++ b/src/main/java/com/twitter/clientlib/api/BookmarksApi.java
@@ -194,6 +194,24 @@ public GenericTweetsTimelineResponse getUsersIdBookmarks(String id, Integer maxR
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public GenericTweetsTimelineResponse getUsersIdBookmarks(Integer retries, String id, Integer maxResults, String paginationToken, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields) throws ApiException {
+ GenericTweetsTimelineResponse localVarResp;
+ try{
+ localVarResp = getUsersIdBookmarks(id, maxResults, paginationToken, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return getUsersIdBookmarks(retries - 1, id, maxResults, paginationToken, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Bookmarks by User
* Returns Tweet objects that have been bookmarked by the requesting user
@@ -351,6 +369,24 @@ public BookmarkMutationResponse postUsersIdBookmarks(AddBookmarkRequest addBookm
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public BookmarkMutationResponse postUsersIdBookmarks(Integer retries, AddBookmarkRequest addBookmarkRequest, String id) throws ApiException {
+ BookmarkMutationResponse localVarResp;
+ try{
+ localVarResp = postUsersIdBookmarks(addBookmarkRequest, id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return postUsersIdBookmarks(retries - 1, addBookmarkRequest, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Add Tweet to Bookmarks
* Adds a Tweet (ID in the body) to the requesting user's (in the path) bookmarks
@@ -495,6 +531,24 @@ public BookmarkMutationResponse usersIdBookmarksDelete(String id, String tweetId
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public BookmarkMutationResponse usersIdBookmarksDelete(Integer retries, String id, String tweetId) throws ApiException {
+ BookmarkMutationResponse localVarResp;
+ try{
+ localVarResp = usersIdBookmarksDelete(id, tweetId);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdBookmarksDelete(retries - 1, id, tweetId);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Remove a bookmarked Tweet
* Removes a Tweet from the requesting user's bookmarked Tweets.
diff --git a/src/main/java/com/twitter/clientlib/api/ComplianceApi.java b/src/main/java/com/twitter/clientlib/api/ComplianceApi.java
index ae68210..8d3f631 100644
--- a/src/main/java/com/twitter/clientlib/api/ComplianceApi.java
+++ b/src/main/java/com/twitter/clientlib/api/ComplianceApi.java
@@ -146,6 +146,24 @@ public SingleComplianceJobResponse createBatchComplianceJob(CreateBatchComplianc
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public SingleComplianceJobResponse createBatchComplianceJob(Integer retries, CreateBatchComplianceJobRequest createBatchComplianceJobRequest) throws ApiException {
+ SingleComplianceJobResponse localVarResp;
+ try{
+ localVarResp = createBatchComplianceJob(createBatchComplianceJobRequest);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return createBatchComplianceJob(retries - 1, createBatchComplianceJobRequest);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Create compliance job
* Creates a compliance for the given job type
@@ -280,6 +298,24 @@ public SingleComplianceJobResponse getBatchComplianceJob(String id) throws ApiEx
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public SingleComplianceJobResponse getBatchComplianceJob(Integer retries, String id) throws ApiException {
+ SingleComplianceJobResponse localVarResp;
+ try{
+ localVarResp = getBatchComplianceJob(id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return getBatchComplianceJob(retries - 1, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Get compliance job
* Returns a single compliance job by ID
@@ -423,6 +459,24 @@ public MultiComplianceJobResponse listBatchComplianceJobs(ComplianceJobType type
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiComplianceJobResponse listBatchComplianceJobs(Integer retries, ComplianceJobType type, ComplianceJobStatus status) throws ApiException {
+ MultiComplianceJobResponse localVarResp;
+ try{
+ localVarResp = listBatchComplianceJobs(type, status);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listBatchComplianceJobs(retries - 1, type, status);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* List compliance jobs
* Returns recent compliance jobs for a given job type and optional job status
diff --git a/src/main/java/com/twitter/clientlib/api/GeneralApi.java b/src/main/java/com/twitter/clientlib/api/GeneralApi.java
index a7ff966..ab1519b 100644
--- a/src/main/java/com/twitter/clientlib/api/GeneralApi.java
+++ b/src/main/java/com/twitter/clientlib/api/GeneralApi.java
@@ -130,6 +130,24 @@ public Object getOpenApiSpec() throws ApiException {
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public Object getOpenApiSpec(Integer retries) throws ApiException {
+ Object localVarResp;
+ try{
+ localVarResp = getOpenApiSpec();
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return getOpenApiSpec(retries - 1);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Returns the open api spec document.
* Full open api spec in JSON format. (See https://github.com/OAI/OpenAPI-Specification/blob/master/README.md)
diff --git a/src/main/java/com/twitter/clientlib/api/ListsApi.java b/src/main/java/com/twitter/clientlib/api/ListsApi.java
index 36d3eee..50fab01 100644
--- a/src/main/java/com/twitter/clientlib/api/ListsApi.java
+++ b/src/main/java/com/twitter/clientlib/api/ListsApi.java
@@ -187,6 +187,24 @@ public MultiListResponse getUserListMemberships(String id, Integer maxResults, L
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiListResponse getUserListMemberships(Integer retries, String id, Integer maxResults, Long paginationToken, Set listFields, Set expansions, Set userFields) throws ApiException {
+ MultiListResponse localVarResp;
+ try{
+ localVarResp = getUserListMemberships(id, maxResults, paginationToken, listFields, expansions, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return getUserListMemberships(retries - 1, id, maxResults, paginationToken, listFields, expansions, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Get a User's List Memberships
* Get a User's List Memberships.
@@ -333,6 +351,24 @@ public ListMemberResponse listAddMember(ListAddMemberRequest listAddMemberReques
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListMemberResponse listAddMember(Integer retries, ListAddMemberRequest listAddMemberRequest, String id) throws ApiException {
+ ListMemberResponse localVarResp;
+ try{
+ localVarResp = listAddMember(listAddMemberRequest, id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listAddMember(retries - 1, listAddMemberRequest, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Add a List member
* Causes a user to become a member of a List.
@@ -463,6 +499,24 @@ public ListCreateResponse listIdCreate(ListCreateRequest listCreateRequest) thro
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListCreateResponse listIdCreate(Integer retries, ListCreateRequest listCreateRequest) throws ApiException {
+ ListCreateResponse localVarResp;
+ try{
+ localVarResp = listIdCreate(listCreateRequest);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listIdCreate(retries - 1, listCreateRequest);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Create List
* Creates a new List.
@@ -597,6 +651,24 @@ public ListDeleteResponse listIdDelete(String id) throws ApiException {
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListDeleteResponse listIdDelete(Integer retries, String id) throws ApiException {
+ ListDeleteResponse localVarResp;
+ try{
+ localVarResp = listIdDelete(id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listIdDelete(retries - 1, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Delete List
* Delete a List that you own.
@@ -749,6 +821,24 @@ public SingleListLookupResponse listIdGet(String id, Set listFields, Set
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public SingleListLookupResponse listIdGet(Integer retries, String id, Set listFields, Set expansions, Set userFields) throws ApiException {
+ SingleListLookupResponse localVarResp;
+ try{
+ localVarResp = listIdGet(id, listFields, expansions, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listIdGet(retries - 1, id, listFields, expansions, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* List lookup by List ID
* Returns a List
@@ -891,6 +981,24 @@ public ListUpdateResponse listIdUpdate(ListUpdateRequest listUpdateRequest, Stri
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListUpdateResponse listIdUpdate(Integer retries, ListUpdateRequest listUpdateRequest, String id) throws ApiException {
+ ListUpdateResponse localVarResp;
+ try{
+ localVarResp = listIdUpdate(listUpdateRequest, id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listIdUpdate(retries - 1, listUpdateRequest, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Update List
* Update a List that you own.
@@ -1035,6 +1143,24 @@ public ListMemberResponse listRemoveMember(String id, String userId) throws ApiE
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListMemberResponse listRemoveMember(Integer retries, String id, String userId) throws ApiException {
+ ListMemberResponse localVarResp;
+ try{
+ localVarResp = listRemoveMember(id, userId);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listRemoveMember(retries - 1, id, userId);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Remove a List member
* Causes a user to be removed from the members of a List.
@@ -1173,6 +1299,24 @@ public ListFollowedResponse listUserFollow(ListFollowRequest listFollowRequest,
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListFollowedResponse listUserFollow(Integer retries, ListFollowRequest listFollowRequest, String id) throws ApiException {
+ ListFollowedResponse localVarResp;
+ try{
+ localVarResp = listUserFollow(listFollowRequest, id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listUserFollow(retries - 1, listFollowRequest, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Follow a List
* Causes a user to follow a List.
@@ -1339,6 +1483,24 @@ public MultiListResponse listUserOwnedLists(String id, Integer maxResults, Long
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiListResponse listUserOwnedLists(Integer retries, String id, Integer maxResults, Long paginationToken, Set listFields, Set expansions, Set userFields) throws ApiException {
+ MultiListResponse localVarResp;
+ try{
+ localVarResp = listUserOwnedLists(id, maxResults, paginationToken, listFields, expansions, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listUserOwnedLists(retries - 1, id, maxResults, paginationToken, listFields, expansions, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Get a User's Owned Lists
* Get a User's Owned Lists.
@@ -1485,6 +1647,24 @@ public ListPinnedResponse listUserPin(ListPinRequest listPinRequest, String id)
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListPinnedResponse listUserPin(Integer retries, ListPinRequest listPinRequest, String id) throws ApiException {
+ ListPinnedResponse localVarResp;
+ try{
+ localVarResp = listUserPin(listPinRequest, id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listUserPin(retries - 1, listPinRequest, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Pin a List
* Causes a user to pin a List.
@@ -1639,6 +1819,24 @@ public MultiListNoPaginationResponse listUserPinnedLists(String id, Set
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiListNoPaginationResponse listUserPinnedLists(Integer retries, String id, Set listFields, Set expansions, Set userFields) throws ApiException {
+ MultiListNoPaginationResponse localVarResp;
+ try{
+ localVarResp = listUserPinnedLists(id, listFields, expansions, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listUserPinnedLists(retries - 1, id, listFields, expansions, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Get a User's Pinned Lists
* Get a User's Pinned Lists.
@@ -1787,6 +1985,24 @@ public ListFollowedResponse listUserUnfollow(String id, String listId) throws Ap
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListFollowedResponse listUserUnfollow(Integer retries, String id, String listId) throws ApiException {
+ ListFollowedResponse localVarResp;
+ try{
+ localVarResp = listUserUnfollow(id, listId);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listUserUnfollow(retries - 1, id, listId);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Unfollow a List
* Causes a user to unfollow a List.
@@ -1931,6 +2147,24 @@ public ListPinnedResponse listUserUnpin(String id, String listId) throws ApiExce
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListPinnedResponse listUserUnpin(Integer retries, String id, String listId) throws ApiException {
+ ListPinnedResponse localVarResp;
+ try{
+ localVarResp = listUserUnpin(id, listId);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listUserUnpin(retries - 1, id, listId);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Unpin a List
* Causes a user to remove a pinned List.
@@ -2097,6 +2331,24 @@ public MultiListResponse userFollowedLists(String id, Integer maxResults, Long p
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiListResponse userFollowedLists(Integer retries, String id, Integer maxResults, Long paginationToken, Set listFields, Set expansions, Set userFields) throws ApiException {
+ MultiListResponse localVarResp;
+ try{
+ localVarResp = userFollowedLists(id, maxResults, paginationToken, listFields, expansions, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return userFollowedLists(retries - 1, id, maxResults, paginationToken, listFields, expansions, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Get User's Followed Lists
* Returns a user's followed Lists.
diff --git a/src/main/java/com/twitter/clientlib/api/SpacesApi.java b/src/main/java/com/twitter/clientlib/api/SpacesApi.java
index c0e4774..102b371 100644
--- a/src/main/java/com/twitter/clientlib/api/SpacesApi.java
+++ b/src/main/java/com/twitter/clientlib/api/SpacesApi.java
@@ -159,6 +159,24 @@ public SingleSpaceLookupResponse findSpaceById(String id, Set spaceField
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public SingleSpaceLookupResponse findSpaceById(Integer retries, String id, Set spaceFields, Set expansions) throws ApiException {
+ SingleSpaceLookupResponse localVarResp;
+ try{
+ localVarResp = findSpaceById(id, spaceFields, expansions);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return findSpaceById(retries - 1, id, spaceFields, expansions);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Space lookup by Space ID
* Returns a variety of information about the Space specified by the requested ID
@@ -312,6 +330,24 @@ public MultiSpaceLookupResponse findSpacesByCreatorIds(List userIds, Set
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiSpaceLookupResponse findSpacesByCreatorIds(Integer retries, List userIds, Set spaceFields, Set expansions) throws ApiException {
+ MultiSpaceLookupResponse localVarResp;
+ try{
+ localVarResp = findSpacesByCreatorIds(userIds, spaceFields, expansions);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return findSpacesByCreatorIds(retries - 1, userIds, spaceFields, expansions);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Space lookup by their creators
* Returns a variety of information about the Spaces created by the provided User IDs
@@ -465,6 +501,24 @@ public MultiSpaceLookupResponse findSpacesByIds(List ids, Set sp
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiSpaceLookupResponse findSpacesByIds(Integer retries, List ids, Set spaceFields, Set expansions) throws ApiException {
+ MultiSpaceLookupResponse localVarResp;
+ try{
+ localVarResp = findSpacesByIds(ids, spaceFields, expansions);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return findSpacesByIds(retries - 1, ids, spaceFields, expansions);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Space lookup up Space IDs
* Returns a variety of information about the Spaces specified by the requested IDs
@@ -630,6 +684,24 @@ public MultiSpaceLookupResponse searchSpaces(String query, String state, Integer
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiSpaceLookupResponse searchSpaces(Integer retries, String query, String state, Integer maxResults, Set spaceFields, Set expansions) throws ApiException {
+ MultiSpaceLookupResponse localVarResp;
+ try{
+ localVarResp = searchSpaces(query, state, maxResults, spaceFields, expansions);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return searchSpaces(retries - 1, query, state, maxResults, spaceFields, expansions);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Search for Spaces
* Returns Spaces that match the provided query.
@@ -778,6 +850,24 @@ public MultiUserLookupResponse spaceBuyers(String id, Set userFields) th
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiUserLookupResponse spaceBuyers(Integer retries, String id, Set userFields) throws ApiException {
+ MultiUserLookupResponse localVarResp;
+ try{
+ localVarResp = spaceBuyers(id, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return spaceBuyers(retries - 1, id, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Retrieve the list of users who purchased a ticket to the given space
* Retrieves the list of users who purchased a ticket to the given space
@@ -926,6 +1016,24 @@ public MultiTweetLookupResponse spaceTweets(Integer maxResults, String id, Set tweetFields) throws ApiException {
+ MultiTweetLookupResponse localVarResp;
+ try{
+ localVarResp = spaceTweets(maxResults, id, tweetFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return spaceTweets(retries - 1, maxResults, id, tweetFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Retrieve tweets from a Space
* Retrieves tweets shared in the specified space
diff --git a/src/main/java/com/twitter/clientlib/api/TweetsApi.java b/src/main/java/com/twitter/clientlib/api/TweetsApi.java
index a41e27a..54d296d 100644
--- a/src/main/java/com/twitter/clientlib/api/TweetsApi.java
+++ b/src/main/java/com/twitter/clientlib/api/TweetsApi.java
@@ -175,6 +175,24 @@ public AddOrDeleteRulesResponse addOrDeleteRules(AddOrDeleteRulesRequest addOrDe
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public AddOrDeleteRulesResponse addOrDeleteRules(Integer retries, AddOrDeleteRulesRequest addOrDeleteRulesRequest, Boolean dryRun) throws ApiException {
+ AddOrDeleteRulesResponse localVarResp;
+ try{
+ localVarResp = addOrDeleteRules(addOrDeleteRulesRequest, dryRun);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return addOrDeleteRules(retries - 1, addOrDeleteRulesRequest, dryRun);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Add/Delete rules
* Add or delete rules from a user's active rule set. Users can provide unique, optionally tagged rules to add. Users can delete their entire rule set or a subset specified by rule ids or values.
@@ -305,6 +323,24 @@ public TweetCreateResponse createTweet(CreateTweetRequest createTweetRequest) th
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public TweetCreateResponse createTweet(Integer retries, CreateTweetRequest createTweetRequest) throws ApiException {
+ TweetCreateResponse localVarResp;
+ try{
+ localVarResp = createTweet(createTweetRequest);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return createTweet(retries - 1, createTweetRequest);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Creation of a Tweet
* Causes the user to create a tweet under the authorized account.
@@ -439,6 +475,24 @@ public TweetDeleteResponse deleteTweetById(String id) throws ApiException {
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public TweetDeleteResponse deleteTweetById(Integer retries, String id) throws ApiException {
+ TweetDeleteResponse localVarResp;
+ try{
+ localVarResp = deleteTweetById(id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return deleteTweetById(retries - 1, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Tweet delete by Tweet ID
* Delete specified Tweet (in the path) by ID.
@@ -609,6 +663,24 @@ public SingleTweetLookupResponse findTweetById(String id, Set expansions
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public SingleTweetLookupResponse findTweetById(Integer retries, String id, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields) throws ApiException {
+ SingleTweetLookupResponse localVarResp;
+ try{
+ localVarResp = findTweetById(id, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return findTweetById(retries - 1, id, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Tweet lookup by Tweet ID
* Returns a variety of information about the Tweet specified by the requested ID.
@@ -794,6 +866,24 @@ public MultiTweetLookupResponse findTweetsById(List ids, Set exp
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiTweetLookupResponse findTweetsById(Integer retries, List ids, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields) throws ApiException {
+ MultiTweetLookupResponse localVarResp;
+ try{
+ localVarResp = findTweetsById(ids, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return findTweetsById(retries - 1, ids, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Tweet lookup by Tweet IDs
* Returns a variety of information about the Tweet specified by the requested ID.
@@ -982,6 +1072,24 @@ public QuoteTweetLookupResponse findTweetsThatQuoteATweet(String id, Integer max
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public QuoteTweetLookupResponse findTweetsThatQuoteATweet(Integer retries, String id, Integer maxResults, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields) throws ApiException {
+ QuoteTweetLookupResponse localVarResp;
+ try{
+ localVarResp = findTweetsThatQuoteATweet(id, maxResults, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return findTweetsThatQuoteATweet(retries - 1, id, maxResults, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Retrieve tweets that quote a tweet.
* Returns a variety of information about each tweet that quotes the Tweet specified by the requested ID.
@@ -1140,6 +1248,24 @@ public GetRulesResponse getRules(List ids, Integer maxResults, String pa
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public GetRulesResponse getRules(Integer retries, List ids, Integer maxResults, String paginationToken) throws ApiException {
+ GetRulesResponse localVarResp;
+ try{
+ localVarResp = getRules(ids, maxResults, paginationToken);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return getRules(retries - 1, ids, maxResults, paginationToken);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Rules lookup
* Returns rules from a user's active rule set. Users can fetch all of their rules or a subset, specified by the provided rule ids.
@@ -1280,6 +1406,24 @@ public HideReplyByIdResponse hideReplyById(HideReplyByIdRequest hideReplyByIdReq
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public HideReplyByIdResponse hideReplyById(Integer retries, HideReplyByIdRequest hideReplyByIdRequest, String id) throws ApiException {
+ HideReplyByIdResponse localVarResp;
+ try{
+ localVarResp = hideReplyById(hideReplyByIdRequest, id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return hideReplyById(retries - 1, hideReplyByIdRequest, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Hide replies
* Hides or unhides a reply to an owned conversation.
@@ -1464,6 +1608,24 @@ public ListsIdTweetsResponse listsIdTweets(String id, Integer maxResults, String
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListsIdTweetsResponse listsIdTweets(Integer retries, String id, Integer maxResults, String paginationToken, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields) throws ApiException {
+ ListsIdTweetsResponse localVarResp;
+ try{
+ localVarResp = listsIdTweets(id, maxResults, paginationToken, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listsIdTweets(retries - 1, id, maxResults, paginationToken, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* List Tweets timeline by List ID
* Returns a list of Tweets associated with the provided List ID
@@ -1638,6 +1800,26 @@ public InputStream sampleStream(Set expansions, Set tweetFields,
return localVarResp;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public InputStream sampleStream(Integer retries, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields, Integer backfillMinutes) throws ApiException {
+ InputStream localVarResp;
+ try{
+ localVarResp = sampleStream(expansions, tweetFields, userFields, mediaFields, placeFields, pollFields, backfillMinutes);
+ }
+ catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return sampleStream(retries - 1, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields, backfillMinutes);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
+
/**
* Sample stream
* Streams a deterministic 1% of public Tweets.
@@ -1808,6 +1990,26 @@ public InputStream searchStream(Set expansions, Set tweetFields,
return localVarResp;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public InputStream searchStream(Integer retries, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields, Integer backfillMinutes) throws ApiException {
+ InputStream localVarResp;
+ try{
+ localVarResp = searchStream(expansions, tweetFields, userFields, mediaFields, placeFields, pollFields, backfillMinutes);
+ }
+ catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return searchStream(retries - 1, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields, backfillMinutes);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
+
/**
* Filtered stream
* Streams Tweets matching the stream's active rule set.
@@ -1960,6 +2162,24 @@ public MultiUserLookupResponse spaceBuyers(String id, Set userFields) th
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiUserLookupResponse spaceBuyers(Integer retries, String id, Set userFields) throws ApiException {
+ MultiUserLookupResponse localVarResp;
+ try{
+ localVarResp = spaceBuyers(id, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return spaceBuyers(retries - 1, id, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Retrieve the list of users who purchased a ticket to the given space
* Retrieves the list of users who purchased a ticket to the given space
@@ -2108,6 +2328,24 @@ public MultiTweetLookupResponse spaceTweets(Integer maxResults, String id, Set tweetFields) throws ApiException {
+ MultiTweetLookupResponse localVarResp;
+ try{
+ localVarResp = spaceTweets(maxResults, id, tweetFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return spaceTweets(retries - 1, maxResults, id, tweetFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Retrieve tweets from a Space
* Retrieves tweets shared in the specified space
@@ -2291,6 +2529,24 @@ public TweetCountsResponse tweetCountsFullArchiveSearch(String query, OffsetDate
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public TweetCountsResponse tweetCountsFullArchiveSearch(Integer retries, String query, OffsetDateTime startTime, OffsetDateTime endTime, String sinceId, String untilId, String nextToken, String paginationToken, Granularity granularity) throws ApiException {
+ TweetCountsResponse localVarResp;
+ try{
+ localVarResp = tweetCountsFullArchiveSearch(query, startTime, endTime, sinceId, untilId, nextToken, paginationToken, granularity);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return tweetCountsFullArchiveSearch(retries - 1, query, startTime, endTime, sinceId, untilId, nextToken, paginationToken, granularity);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Full archive search counts
* Returns Tweet Counts that match a search query.
@@ -2484,6 +2740,24 @@ public TweetCountsResponse tweetCountsRecentSearch(String query, OffsetDateTime
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public TweetCountsResponse tweetCountsRecentSearch(Integer retries, String query, OffsetDateTime startTime, OffsetDateTime endTime, String sinceId, String untilId, String nextToken, String paginationToken, Granularity granularity) throws ApiException {
+ TweetCountsResponse localVarResp;
+ try{
+ localVarResp = tweetCountsRecentSearch(query, startTime, endTime, sinceId, untilId, nextToken, paginationToken, granularity);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return tweetCountsRecentSearch(retries - 1, query, startTime, endTime, sinceId, untilId, nextToken, paginationToken, granularity);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Recent search counts
* Returns Tweet Counts from the last 7 days that match a search query.
@@ -2719,6 +2993,24 @@ public TweetSearchResponse tweetsFullarchiveSearch(String query, OffsetDateTime
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public TweetSearchResponse tweetsFullarchiveSearch(Integer retries, String query, OffsetDateTime startTime, OffsetDateTime endTime, String sinceId, String untilId, Integer maxResults, String sortOrder, String nextToken, String paginationToken, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields) throws ApiException {
+ TweetSearchResponse localVarResp;
+ try{
+ localVarResp = tweetsFullarchiveSearch(query, startTime, endTime, sinceId, untilId, maxResults, sortOrder, nextToken, paginationToken, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return tweetsFullarchiveSearch(retries - 1, query, startTime, endTime, sinceId, untilId, maxResults, sortOrder, nextToken, paginationToken, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Full-archive search
* Returns Tweets that match a search query.
@@ -2968,6 +3260,24 @@ public TweetSearchResponse tweetsRecentSearch(String query, OffsetDateTime start
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public TweetSearchResponse tweetsRecentSearch(Integer retries, String query, OffsetDateTime startTime, OffsetDateTime endTime, String sinceId, String untilId, Integer maxResults, String sortOrder, String nextToken, String paginationToken, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields) throws ApiException {
+ TweetSearchResponse localVarResp;
+ try{
+ localVarResp = tweetsRecentSearch(query, startTime, endTime, sinceId, untilId, maxResults, sortOrder, nextToken, paginationToken, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return tweetsRecentSearch(retries - 1, query, startTime, endTime, sinceId, untilId, maxResults, sortOrder, nextToken, paginationToken, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Recent search
* Returns Tweets from the last 7 days that match a search query.
@@ -3132,6 +3442,24 @@ public UsersLikesCreateResponse usersIdLike(UsersLikesCreateRequest usersLikesCr
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersLikesCreateResponse usersIdLike(Integer retries, UsersLikesCreateRequest usersLikesCreateRequest, String id) throws ApiException {
+ UsersLikesCreateResponse localVarResp;
+ try{
+ localVarResp = usersIdLike(usersLikesCreateRequest, id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdLike(retries - 1, usersLikesCreateRequest, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Causes the user (in the path) to like the specified tweet
* Causes the user (in the path) to like the specified tweet. The user in the path must match the user context authorizing the request.
@@ -3316,6 +3644,24 @@ public UsersIdLikedTweetsResponse usersIdLikedTweets(String id, Integer maxResul
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersIdLikedTweetsResponse usersIdLikedTweets(Integer retries, String id, Integer maxResults, String paginationToken, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields) throws ApiException {
+ UsersIdLikedTweetsResponse localVarResp;
+ try{
+ localVarResp = usersIdLikedTweets(id, maxResults, paginationToken, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdLikedTweets(retries - 1, id, maxResults, paginationToken, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Returns Tweet objects liked by the provided User ID
* Returns a list of Tweets liked by the provided User ID
@@ -3538,6 +3884,24 @@ public GenericTweetsTimelineResponse usersIdMentions(String id, String sinceId,
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public GenericTweetsTimelineResponse usersIdMentions(Integer retries, String id, String sinceId, String untilId, Integer maxResults, String paginationToken, OffsetDateTime startTime, OffsetDateTime endTime, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields) throws ApiException {
+ GenericTweetsTimelineResponse localVarResp;
+ try{
+ localVarResp = usersIdMentions(id, sinceId, untilId, maxResults, paginationToken, startTime, endTime, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdMentions(retries - 1, id, sinceId, untilId, maxResults, paginationToken, startTime, endTime, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* User mention timeline by User ID
* Returns Tweet objects that mention username associated to the provided User ID
@@ -3698,6 +4062,24 @@ public UsersRetweetsCreateResponse usersIdRetweets(UsersRetweetsCreateRequest us
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersRetweetsCreateResponse usersIdRetweets(Integer retries, UsersRetweetsCreateRequest usersRetweetsCreateRequest, String id) throws ApiException {
+ UsersRetweetsCreateResponse localVarResp;
+ try{
+ localVarResp = usersIdRetweets(usersRetweetsCreateRequest, id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdRetweets(retries - 1, usersRetweetsCreateRequest, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Causes the user (in the path) to retweet the specified tweet
* Causes the user (in the path) to retweet the specified tweet. The user in the path must match the user context authorizing the request.
@@ -3912,6 +4294,24 @@ public GenericTweetsTimelineResponse usersIdTweets(String id, String sinceId, St
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public GenericTweetsTimelineResponse usersIdTweets(Integer retries, String id, String sinceId, String untilId, Integer maxResults, Set exclude, String paginationToken, OffsetDateTime startTime, OffsetDateTime endTime, Set expansions, Set tweetFields, Set userFields, Set mediaFields, Set placeFields, Set pollFields) throws ApiException {
+ GenericTweetsTimelineResponse localVarResp;
+ try{
+ localVarResp = usersIdTweets(id, sinceId, untilId, maxResults, exclude, paginationToken, startTime, endTime, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdTweets(retries - 1, id, sinceId, untilId, maxResults, exclude, paginationToken, startTime, endTime, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* User Tweets timeline by User ID
* Returns a list of Tweets authored by the provided User ID
@@ -4080,6 +4480,24 @@ public UsersLikesDeleteResponse usersIdUnlike(String id, String tweetId) throws
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersLikesDeleteResponse usersIdUnlike(Integer retries, String id, String tweetId) throws ApiException {
+ UsersLikesDeleteResponse localVarResp;
+ try{
+ localVarResp = usersIdUnlike(id, tweetId);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdUnlike(retries - 1, id, tweetId);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Causes the user (in the path) to unlike the specified tweet
* Causes the user (in the path) to unlike the specified tweet. The user must match the user context authorizing the request
@@ -4224,6 +4642,24 @@ public UsersRetweetsDeleteResponse usersIdUnretweets(String id, String sourceTwe
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersRetweetsDeleteResponse usersIdUnretweets(Integer retries, String id, String sourceTweetId) throws ApiException {
+ UsersRetweetsDeleteResponse localVarResp;
+ try{
+ localVarResp = usersIdUnretweets(id, sourceTweetId);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdUnretweets(retries - 1, id, sourceTweetId);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Causes the user (in the path) to unretweet the specified tweet
* Causes the user (in the path) to unretweet the specified tweet. The user must match the user context authorizing the request
diff --git a/src/main/java/com/twitter/clientlib/api/UsersApi.java b/src/main/java/com/twitter/clientlib/api/UsersApi.java
index 6e2579b..3ea319e 100644
--- a/src/main/java/com/twitter/clientlib/api/UsersApi.java
+++ b/src/main/java/com/twitter/clientlib/api/UsersApi.java
@@ -165,6 +165,24 @@ public SingleUserLookupResponse findMyUser(Set expansions, Set t
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public SingleUserLookupResponse findMyUser(Integer retries, Set expansions, Set tweetFields, Set userFields) throws ApiException {
+ SingleUserLookupResponse localVarResp;
+ try{
+ localVarResp = findMyUser(expansions, tweetFields, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return findMyUser(retries - 1, expansions, tweetFields, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* User lookup me
* This endpoint returns information about the requesting user.
@@ -321,6 +339,24 @@ public SingleUserLookupResponse findUserById(String id, Set expansions,
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public SingleUserLookupResponse findUserById(Integer retries, String id, Set expansions, Set tweetFields, Set userFields) throws ApiException {
+ SingleUserLookupResponse localVarResp;
+ try{
+ localVarResp = findUserById(id, expansions, tweetFields, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return findUserById(retries - 1, id, expansions, tweetFields, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* User lookup by ID
* This endpoint returns information about a user. Specify user by ID.
@@ -479,6 +515,24 @@ public SingleUserLookupResponse findUserByUsername(String username, Set
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public SingleUserLookupResponse findUserByUsername(Integer retries, String username, Set expansions, Set tweetFields, Set userFields) throws ApiException {
+ SingleUserLookupResponse localVarResp;
+ try{
+ localVarResp = findUserByUsername(username, expansions, tweetFields, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return findUserByUsername(retries - 1, username, expansions, tweetFields, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* User lookup by username
* This endpoint returns information about a user. Specify user by username.
@@ -640,6 +694,24 @@ public MultiUserLookupResponse findUsersById(List ids, Set expan
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public MultiUserLookupResponse findUsersById(Integer retries, List ids, Set expansions, Set tweetFields, Set userFields) throws ApiException {
+ MultiUserLookupResponse localVarResp;
+ try{
+ localVarResp = findUsersById(ids, expansions, tweetFields, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return findUsersById(retries - 1, ids, expansions, tweetFields, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* User lookup by IDs
* This endpoint returns information about users. Specify users by their ID.
@@ -801,6 +873,24 @@ public MultiUserLookupResponse findUsersByUsername(List usernames, Set usernames, Set expansions, Set tweetFields, Set userFields) throws ApiException {
+ MultiUserLookupResponse localVarResp;
+ try{
+ localVarResp = findUsersByUsername(usernames, expansions, tweetFields, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return findUsersByUsername(retries - 1, usernames, expansions, tweetFields, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* User lookup by usernames
* This endpoint returns information about users. Specify users by their username.
@@ -971,6 +1061,24 @@ public ListLookupMultipleUsersLookupResponse listGetFollowers(String id, Integer
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListLookupMultipleUsersLookupResponse listGetFollowers(Integer retries, String id, Integer maxResults, Long paginationToken, Set expansions, Set tweetFields, Set userFields) throws ApiException {
+ ListLookupMultipleUsersLookupResponse localVarResp;
+ try{
+ localVarResp = listGetFollowers(id, maxResults, paginationToken, expansions, tweetFields, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listGetFollowers(retries - 1, id, maxResults, paginationToken, expansions, tweetFields, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Returns user objects that follow a List by the provided List ID
* Returns a list of users that follow a List by the provided List ID
@@ -1145,6 +1253,24 @@ public ListLookupMultipleUsersLookupResponse listGetMembers(String id, Integer m
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public ListLookupMultipleUsersLookupResponse listGetMembers(Integer retries, String id, Integer maxResults, Long paginationToken, Set expansions, Set tweetFields, Set userFields) throws ApiException {
+ ListLookupMultipleUsersLookupResponse localVarResp;
+ try{
+ localVarResp = listGetMembers(id, maxResults, paginationToken, expansions, tweetFields, userFields);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return listGetMembers(retries - 1, id, maxResults, paginationToken, expansions, tweetFields, userFields);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Returns user objects that are members of a List by the provided List ID
* Returns a list of users that are members of a List by the provided List ID
@@ -1301,6 +1427,24 @@ public GenericMultipleUsersLookupResponse tweetsIdLikingUsers(String id, Integer
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public GenericMultipleUsersLookupResponse tweetsIdLikingUsers(Integer retries, String id, Integer maxResults, String paginationToken) throws ApiException {
+ GenericMultipleUsersLookupResponse localVarResp;
+ try{
+ localVarResp = tweetsIdLikingUsers(id, maxResults, paginationToken);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return tweetsIdLikingUsers(retries - 1, id, maxResults, paginationToken);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Returns user objects that have liked the provided Tweet ID
* Returns a list of users that have liked the provided Tweet ID
@@ -1451,6 +1595,24 @@ public GenericMultipleUsersLookupResponse tweetsIdRetweetingUsers(String id, Int
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public GenericMultipleUsersLookupResponse tweetsIdRetweetingUsers(Integer retries, String id, Integer maxResults, String paginationToken) throws ApiException {
+ GenericMultipleUsersLookupResponse localVarResp;
+ try{
+ localVarResp = tweetsIdRetweetingUsers(id, maxResults, paginationToken);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return tweetsIdRetweetingUsers(retries - 1, id, maxResults, paginationToken);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Returns user objects that have retweeted the provided Tweet ID
* Returns a list of users that have retweeted the provided Tweet ID
@@ -1591,6 +1753,24 @@ public UsersBlockingMutationResponse usersIdBlock(UsersIdBlockRequest usersIdBlo
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersBlockingMutationResponse usersIdBlock(Integer retries, UsersIdBlockRequest usersIdBlockRequest, String id) throws ApiException {
+ UsersBlockingMutationResponse localVarResp;
+ try{
+ localVarResp = usersIdBlock(usersIdBlockRequest, id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdBlock(retries - 1, usersIdBlockRequest, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Block User by User ID
* Causes the user (in the path) to block the target user. The user (in the path) must match the user context authorizing the request
@@ -1739,6 +1919,24 @@ public GenericMultipleUsersLookupResponse usersIdBlocking(String id, Integer max
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public GenericMultipleUsersLookupResponse usersIdBlocking(Integer retries, String id, Integer maxResults, String paginationToken) throws ApiException {
+ GenericMultipleUsersLookupResponse localVarResp;
+ try{
+ localVarResp = usersIdBlocking(id, maxResults, paginationToken);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdBlocking(retries - 1, id, maxResults, paginationToken);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Returns user objects that are blocked by provided user ID
* Returns a list of users that are blocked by the provided user ID
@@ -1879,6 +2077,24 @@ public UsersFollowingCreateResponse usersIdFollow(UsersIdFollowRequest usersIdFo
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersFollowingCreateResponse usersIdFollow(Integer retries, UsersIdFollowRequest usersIdFollowRequest, String id) throws ApiException {
+ UsersFollowingCreateResponse localVarResp;
+ try{
+ localVarResp = usersIdFollow(usersIdFollowRequest, id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdFollow(retries - 1, usersIdFollowRequest, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Follow User
* Causes the user(in the path) to follow, or “request to follow” for protected users, the target user. The user(in the path) must match the user context authorizing the request
@@ -2027,6 +2243,24 @@ public GenericMultipleUsersLookupResponse usersIdFollowers(String id, Integer ma
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public GenericMultipleUsersLookupResponse usersIdFollowers(Integer retries, String id, Integer maxResults, String paginationToken) throws ApiException {
+ GenericMultipleUsersLookupResponse localVarResp;
+ try{
+ localVarResp = usersIdFollowers(id, maxResults, paginationToken);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdFollowers(retries - 1, id, maxResults, paginationToken);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Returns user objects that follow the provided user ID
* Returns a list of users that follow the provided user ID
@@ -2177,6 +2411,24 @@ public UsersFollowingLookupResponse usersIdFollowing(String id, Integer maxResul
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersFollowingLookupResponse usersIdFollowing(Integer retries, String id, Integer maxResults, String paginationToken) throws ApiException {
+ UsersFollowingLookupResponse localVarResp;
+ try{
+ localVarResp = usersIdFollowing(id, maxResults, paginationToken);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdFollowing(retries - 1, id, maxResults, paginationToken);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Following by User ID
* Returns a list of users that are being followed by the provided user ID
@@ -2317,6 +2569,24 @@ public UsersMutingMutationResponse usersIdMute(UsersIdMuteRequest usersIdMuteReq
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersMutingMutationResponse usersIdMute(Integer retries, UsersIdMuteRequest usersIdMuteRequest, String id) throws ApiException {
+ UsersMutingMutationResponse localVarResp;
+ try{
+ localVarResp = usersIdMute(usersIdMuteRequest, id);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdMute(retries - 1, usersIdMuteRequest, id);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Mute User by User ID
* Causes the user (in the path) to mute the target user. The user (in the path) must match the user context authorizing the request
@@ -2465,6 +2735,24 @@ public GenericMultipleUsersLookupResponse usersIdMuting(String id, Integer maxRe
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public GenericMultipleUsersLookupResponse usersIdMuting(Integer retries, String id, Integer maxResults, String paginationToken) throws ApiException {
+ GenericMultipleUsersLookupResponse localVarResp;
+ try{
+ localVarResp = usersIdMuting(id, maxResults, paginationToken);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdMuting(retries - 1, id, maxResults, paginationToken);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Returns user objects that are muted by the provided user ID
* Returns a list of users that are muted by the provided user ID
@@ -2611,6 +2899,24 @@ public UsersBlockingMutationResponse usersIdUnblock(String sourceUserId, String
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersBlockingMutationResponse usersIdUnblock(Integer retries, String sourceUserId, String targetUserId) throws ApiException {
+ UsersBlockingMutationResponse localVarResp;
+ try{
+ localVarResp = usersIdUnblock(sourceUserId, targetUserId);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdUnblock(retries - 1, sourceUserId, targetUserId);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Unblock User by User ID
* Causes the source user to unblock the target user. The source user must match the user context authorizing the request
@@ -2755,6 +3061,24 @@ public UsersFollowingDeleteResponse usersIdUnfollow(String sourceUserId, String
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersFollowingDeleteResponse usersIdUnfollow(Integer retries, String sourceUserId, String targetUserId) throws ApiException {
+ UsersFollowingDeleteResponse localVarResp;
+ try{
+ localVarResp = usersIdUnfollow(sourceUserId, targetUserId);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdUnfollow(retries - 1, sourceUserId, targetUserId);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Unfollow User
* Causes the source user to unfollow the target user. The source user must match the user context authorizing the request
@@ -2899,6 +3223,24 @@ public UsersMutingMutationResponse usersIdUnmute(String sourceUserId, String tar
return localVarResp != null ? localVarResp.getData() : null;
}
+ /**
+ * Calls the API using a retry mechanism to handle rate limits errors.
+ *
+ */
+ public UsersMutingMutationResponse usersIdUnmute(Integer retries, String sourceUserId, String targetUserId) throws ApiException {
+ UsersMutingMutationResponse localVarResp;
+ try{
+ localVarResp = usersIdUnmute(sourceUserId, targetUserId);
+ } catch (ApiException e) {
+ if(handleRateLimit(e, retries)) {
+ return usersIdUnmute(retries - 1, sourceUserId, targetUserId);
+ } else {
+ throw e;
+ }
+ }
+ return localVarResp;
+ }
+
/**
* Unmute User by User ID
* Causes the source user to unmute the target user. The source user must match the user context authorizing the request