Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
Copyright 2020 Twitter, Inc.
SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
https://openapi-generator.tech
Do not edit the class manually.
*/
package com.twitter.clientlib.api;
import com.twitter.clientlib.ApiCallback;
import com.twitter.clientlib.ApiClient;
import com.twitter.clientlib.auth.*;
import com.twitter.clientlib.ApiException;
import com.twitter.clientlib.ApiResponse;
import com.twitter.clientlib.Configuration;
import com.twitter.clientlib.Pair;
import com.twitter.clientlib.ProgressRequestBody;
import com.twitter.clientlib.ProgressResponseBody;
import com.github.scribejava.core.model.OAuth2AccessToken;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.twitter.clientlib.model.AddOrDeleteRulesRequest;
import com.twitter.clientlib.model.AddOrDeleteRulesResponse;
import com.twitter.clientlib.model.Error;
import com.twitter.clientlib.model.FilteredStreamingTweetResponse;
import com.twitter.clientlib.model.Get2ListsIdTweetsResponse;
import com.twitter.clientlib.model.Get2SpacesIdBuyersResponse;
import com.twitter.clientlib.model.Get2SpacesIdTweetsResponse;
import com.twitter.clientlib.model.Get2TweetsCountsAllResponse;
import com.twitter.clientlib.model.Get2TweetsCountsRecentResponse;
import com.twitter.clientlib.model.Get2TweetsIdQuoteTweetsResponse;
import com.twitter.clientlib.model.Get2TweetsIdResponse;
import com.twitter.clientlib.model.Get2TweetsResponse;
import com.twitter.clientlib.model.Get2TweetsSearchAllResponse;
import com.twitter.clientlib.model.Get2TweetsSearchRecentResponse;
import com.twitter.clientlib.model.Get2UsersIdLikedTweetsResponse;
import com.twitter.clientlib.model.Get2UsersIdMentionsResponse;
import com.twitter.clientlib.model.Get2UsersIdTimelinesReverseChronologicalResponse;
import com.twitter.clientlib.model.Get2UsersIdTweetsResponse;
import java.time.OffsetDateTime;
import com.twitter.clientlib.model.Problem;
import com.twitter.clientlib.model.RulesLookupResponse;
import java.util.Set;
import com.twitter.clientlib.model.StreamingTweetResponse;
import com.twitter.clientlib.model.TweetCreateRequest;
import com.twitter.clientlib.model.TweetCreateResponse;
import com.twitter.clientlib.model.TweetDeleteResponse;
import com.twitter.clientlib.model.TweetHideRequest;
import com.twitter.clientlib.model.TweetHideResponse;
import com.twitter.clientlib.model.UsersLikesCreateRequest;
import com.twitter.clientlib.model.UsersLikesCreateResponse;
import com.twitter.clientlib.model.UsersLikesDeleteResponse;
import com.twitter.clientlib.model.UsersRetweetsCreateRequest;
import com.twitter.clientlib.model.UsersRetweetsCreateResponse;
import com.twitter.clientlib.model.UsersRetweetsDeleteResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Arrays;
import java.io.InputStream;
import javax.ws.rs.core.GenericType;
import org.apache.commons.lang3.StringUtils;
public class TweetsApi extends ApiCommon {
private okhttp3.Call addOrDeleteRulesCall(AddOrDeleteRulesRequest addOrDeleteRulesRequest, Boolean dryRun, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = addOrDeleteRulesRequest;
// create path and map variables
String localVarPath = "/2/tweets/search/stream/rules";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (dryRun != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("dry_run", dryRun));
}
final String[] localVarAccepts = {
"application/json", "application/problem+json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "BearerToken" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, reduceAuthNames(localVarAuthNames), _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call addOrDeleteRulesValidateBeforeCall(AddOrDeleteRulesRequest addOrDeleteRulesRequest, Boolean dryRun, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'addOrDeleteRulesRequest' is set
if (addOrDeleteRulesRequest == null) {
throw new ApiException("Missing the required parameter 'addOrDeleteRulesRequest' when calling addOrDeleteRules(Async)");
}
okhttp3.Call localVarCall = addOrDeleteRulesCall(addOrDeleteRulesRequest, dryRun, _callback);
return localVarCall;
}
private ApiResponse addOrDeleteRulesWithHttpInfo(AddOrDeleteRulesRequest addOrDeleteRulesRequest, Boolean dryRun) throws ApiException {
okhttp3.Call localVarCall = addOrDeleteRulesValidateBeforeCall(addOrDeleteRulesRequest, dryRun, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call addOrDeleteRulesAsync(AddOrDeleteRulesRequest addOrDeleteRulesRequest, Boolean dryRun, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = addOrDeleteRulesValidateBeforeCall(addOrDeleteRulesRequest, dryRun, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIaddOrDeleteRulesRequest {
private final AddOrDeleteRulesRequest addOrDeleteRulesRequest;
private Boolean dryRun;
private APIaddOrDeleteRulesRequest(AddOrDeleteRulesRequest addOrDeleteRulesRequest) {
this.addOrDeleteRulesRequest = addOrDeleteRulesRequest;
}
/**
* Set dryRun
* @param dryRun Dry Run can be used with both the add and delete action, with the expected result given, but without actually taking any action in the system (meaning the end state will always be as it was when the request was submitted). This is particularly useful to validate rule changes. (optional)
* @return APIaddOrDeleteRulesRequest
*/
public APIaddOrDeleteRulesRequest dryRun(Boolean dryRun) {
this.dryRun = dryRun;
return this;
}
/**
* Build call for addOrDeleteRules
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return addOrDeleteRulesCall(addOrDeleteRulesRequest, dryRun, _callback);
}
/**
* Execute addOrDeleteRules request
* @return AddOrDeleteRulesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public AddOrDeleteRulesResponse execute() throws ApiException {
ApiResponse localVarResp = addOrDeleteRulesWithHttpInfo(addOrDeleteRulesRequest, dryRun);
return localVarResp.getData();
}
/**
* Calls the API using a retry mechanism to handle rate limits errors.
*
*/
public AddOrDeleteRulesResponse execute(Integer retries) throws ApiException {
AddOrDeleteRulesResponse localVarResp;
try{
localVarResp = execute();
} catch (ApiException e) {
if(handleRateLimit(e, retries)) {
return execute(retries - 1);
} else {
throw e;
}
}
return localVarResp;
}
/**
* Execute addOrDeleteRules request with HTTP info returned
* @return ApiResponse<AddOrDeleteRulesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return addOrDeleteRulesWithHttpInfo(addOrDeleteRulesRequest, dryRun);
}
/**
* Execute addOrDeleteRules request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return addOrDeleteRulesAsync(addOrDeleteRulesRequest, dryRun, _callback);
}
}
/**
* 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.
* @param addOrDeleteRulesRequest (required)
* @return APIaddOrDeleteRulesRequest
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public APIaddOrDeleteRulesRequest addOrDeleteRules(AddOrDeleteRulesRequest addOrDeleteRulesRequest) {
return new APIaddOrDeleteRulesRequest(addOrDeleteRulesRequest);
}
private okhttp3.Call createTweetCall(TweetCreateRequest tweetCreateRequest, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = tweetCreateRequest;
// create path and map variables
String localVarPath = "/2/tweets";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json", "application/problem+json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "OAuth2UserToken", "UserToken" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, reduceAuthNames(localVarAuthNames), _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createTweetValidateBeforeCall(TweetCreateRequest tweetCreateRequest, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'tweetCreateRequest' is set
if (tweetCreateRequest == null) {
throw new ApiException("Missing the required parameter 'tweetCreateRequest' when calling createTweet(Async)");
}
okhttp3.Call localVarCall = createTweetCall(tweetCreateRequest, _callback);
return localVarCall;
}
private ApiResponse createTweetWithHttpInfo(TweetCreateRequest tweetCreateRequest) throws ApiException {
okhttp3.Call localVarCall = createTweetValidateBeforeCall(tweetCreateRequest, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call createTweetAsync(TweetCreateRequest tweetCreateRequest, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createTweetValidateBeforeCall(tweetCreateRequest, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIcreateTweetRequest {
private final TweetCreateRequest tweetCreateRequest;
private APIcreateTweetRequest(TweetCreateRequest tweetCreateRequest) {
this.tweetCreateRequest = tweetCreateRequest;
}
/**
* Build call for createTweet
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
201
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return createTweetCall(tweetCreateRequest, _callback);
}
/**
* Execute createTweet request
* @return TweetCreateResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
201
The request has succeeded.
-
0
The request has failed.
-
*/
public TweetCreateResponse execute() throws ApiException {
ApiResponse localVarResp = createTweetWithHttpInfo(tweetCreateRequest);
return localVarResp.getData();
}
/**
* Calls the API using a retry mechanism to handle rate limits errors.
*
*/
public TweetCreateResponse execute(Integer retries) throws ApiException {
TweetCreateResponse localVarResp;
try{
localVarResp = execute();
} catch (ApiException e) {
if(handleRateLimit(e, retries)) {
return execute(retries - 1);
} else {
throw e;
}
}
return localVarResp;
}
/**
* Execute createTweet request with HTTP info returned
* @return ApiResponse<TweetCreateResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
201
The request has succeeded.
-
0
The request has failed.
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return createTweetWithHttpInfo(tweetCreateRequest);
}
/**
* Execute createTweet request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
201
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return createTweetAsync(tweetCreateRequest, _callback);
}
}
/**
* Creation of a Tweet
* Causes the User to create a Tweet under the authorized account.
* @param tweetCreateRequest (required)
* @return APIcreateTweetRequest
* @http.response.details
Status Code
Description
Response Headers
201
The request has succeeded.
-
0
The request has failed.
-
*/
public APIcreateTweetRequest createTweet(TweetCreateRequest tweetCreateRequest) {
return new APIcreateTweetRequest(tweetCreateRequest);
}
private okhttp3.Call deleteTweetByIdCall(String id, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/2/tweets/{id}"
.replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json", "application/problem+json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "OAuth2UserToken", "UserToken" };
return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, reduceAuthNames(localVarAuthNames), _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteTweetByIdValidateBeforeCall(String id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteTweetById(Async)");
}
okhttp3.Call localVarCall = deleteTweetByIdCall(id, _callback);
return localVarCall;
}
private ApiResponse deleteTweetByIdWithHttpInfo(String id) throws ApiException {
okhttp3.Call localVarCall = deleteTweetByIdValidateBeforeCall(id, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call deleteTweetByIdAsync(String id, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteTweetByIdValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIdeleteTweetByIdRequest {
private final String id;
private APIdeleteTweetByIdRequest(String id) {
this.id = id;
}
/**
* Build call for deleteTweetById
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return deleteTweetByIdCall(id, _callback);
}
/**
* Execute deleteTweetById request
* @return TweetDeleteResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public TweetDeleteResponse execute() throws ApiException {
ApiResponse localVarResp = deleteTweetByIdWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Calls the API using a retry mechanism to handle rate limits errors.
*
*/
public TweetDeleteResponse execute(Integer retries) throws ApiException {
TweetDeleteResponse localVarResp;
try{
localVarResp = execute();
} catch (ApiException e) {
if(handleRateLimit(e, retries)) {
return execute(retries - 1);
} else {
throw e;
}
}
return localVarResp;
}
/**
* Execute deleteTweetById request with HTTP info returned
* @return ApiResponse<TweetDeleteResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return deleteTweetByIdWithHttpInfo(id);
}
/**
* Execute deleteTweetById request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return deleteTweetByIdAsync(id, _callback);
}
}
/**
* Tweet delete by Tweet ID
* Delete specified Tweet (in the path) by ID.
* @param id The ID of the Tweet to be deleted. (required)
* @return APIdeleteTweetByIdRequest
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public APIdeleteTweetByIdRequest deleteTweetById(String id) {
return new APIdeleteTweetByIdRequest(id);
}
private okhttp3.Call findTweetByIdCall(String id, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/2/tweets/{id}"
.replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (tweetFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "tweet.fields", tweetFields));
}
if (expansions != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "expansions", expansions));
}
if (mediaFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "media.fields", mediaFields));
}
if (pollFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "poll.fields", pollFields));
}
if (userFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "user.fields", userFields));
}
if (placeFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "place.fields", placeFields));
}
final String[] localVarAccepts = {
"application/json", "application/problem+json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "BearerToken", "OAuth2UserToken", "UserToken" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, reduceAuthNames(localVarAuthNames), _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call findTweetByIdValidateBeforeCall(String id, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling findTweetById(Async)");
}
okhttp3.Call localVarCall = findTweetByIdCall(id, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
return localVarCall;
}
private ApiResponse findTweetByIdWithHttpInfo(String id, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields) throws ApiException {
okhttp3.Call localVarCall = findTweetByIdValidateBeforeCall(id, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call findTweetByIdAsync(String id, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = findTweetByIdValidateBeforeCall(id, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIfindTweetByIdRequest {
private final String id;
private Set tweetFields;
private Set expansions;
private Set mediaFields;
private Set pollFields;
private Set userFields;
private Set placeFields;
private APIfindTweetByIdRequest(String id) {
this.id = id;
}
/**
* Set tweetFields
* @param tweetFields A comma separated list of Tweet fields to display. (optional)
* @return APIfindTweetByIdRequest
*/
public APIfindTweetByIdRequest tweetFields(Set tweetFields) {
this.tweetFields = tweetFields;
return this;
}
/**
* Set expansions
* @param expansions A comma separated list of fields to expand. (optional)
* @return APIfindTweetByIdRequest
*/
public APIfindTweetByIdRequest expansions(Set expansions) {
this.expansions = expansions;
return this;
}
/**
* Set mediaFields
* @param mediaFields A comma separated list of Media fields to display. (optional)
* @return APIfindTweetByIdRequest
*/
public APIfindTweetByIdRequest mediaFields(Set mediaFields) {
this.mediaFields = mediaFields;
return this;
}
/**
* Set pollFields
* @param pollFields A comma separated list of Poll fields to display. (optional)
* @return APIfindTweetByIdRequest
*/
public APIfindTweetByIdRequest pollFields(Set pollFields) {
this.pollFields = pollFields;
return this;
}
/**
* Set userFields
* @param userFields A comma separated list of User fields to display. (optional)
* @return APIfindTweetByIdRequest
*/
public APIfindTweetByIdRequest userFields(Set userFields) {
this.userFields = userFields;
return this;
}
/**
* Set placeFields
* @param placeFields A comma separated list of Place fields to display. (optional)
* @return APIfindTweetByIdRequest
*/
public APIfindTweetByIdRequest placeFields(Set placeFields) {
this.placeFields = placeFields;
return this;
}
/**
* Build call for findTweetById
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return findTweetByIdCall(id, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
}
/**
* Execute findTweetById request
* @return Get2TweetsIdResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public Get2TweetsIdResponse execute() throws ApiException {
ApiResponse localVarResp = findTweetByIdWithHttpInfo(id, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields);
return localVarResp.getData();
}
/**
* Calls the API using a retry mechanism to handle rate limits errors.
*
*/
public Get2TweetsIdResponse execute(Integer retries) throws ApiException {
Get2TweetsIdResponse localVarResp;
try{
localVarResp = execute();
} catch (ApiException e) {
if(handleRateLimit(e, retries)) {
return execute(retries - 1);
} else {
throw e;
}
}
return localVarResp;
}
/**
* Execute findTweetById request with HTTP info returned
* @return ApiResponse<Get2TweetsIdResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return findTweetByIdWithHttpInfo(id, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields);
}
/**
* Execute findTweetById request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return findTweetByIdAsync(id, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
}
}
/**
* Tweet lookup by Tweet ID
* Returns a variety of information about the Tweet specified by the requested ID.
* @param id A single Tweet ID. (required)
* @return APIfindTweetByIdRequest
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public APIfindTweetByIdRequest findTweetById(String id) {
return new APIfindTweetByIdRequest(id);
}
private okhttp3.Call findTweetsByIdCall(List ids, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/2/tweets";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (ids != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "ids", ids));
}
if (tweetFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "tweet.fields", tweetFields));
}
if (expansions != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "expansions", expansions));
}
if (mediaFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "media.fields", mediaFields));
}
if (pollFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "poll.fields", pollFields));
}
if (userFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "user.fields", userFields));
}
if (placeFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "place.fields", placeFields));
}
final String[] localVarAccepts = {
"application/json", "application/problem+json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "BearerToken", "OAuth2UserToken", "UserToken" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, reduceAuthNames(localVarAuthNames), _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call findTweetsByIdValidateBeforeCall(List ids, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'ids' is set
if (ids == null) {
throw new ApiException("Missing the required parameter 'ids' when calling findTweetsById(Async)");
}
okhttp3.Call localVarCall = findTweetsByIdCall(ids, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
return localVarCall;
}
private ApiResponse findTweetsByIdWithHttpInfo(List ids, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields) throws ApiException {
okhttp3.Call localVarCall = findTweetsByIdValidateBeforeCall(ids, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call findTweetsByIdAsync(List ids, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = findTweetsByIdValidateBeforeCall(ids, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIfindTweetsByIdRequest {
private final List ids;
private Set tweetFields;
private Set expansions;
private Set mediaFields;
private Set pollFields;
private Set userFields;
private Set placeFields;
private APIfindTweetsByIdRequest(List ids) {
this.ids = ids;
}
/**
* Set tweetFields
* @param tweetFields A comma separated list of Tweet fields to display. (optional)
* @return APIfindTweetsByIdRequest
*/
public APIfindTweetsByIdRequest tweetFields(Set tweetFields) {
this.tweetFields = tweetFields;
return this;
}
/**
* Set expansions
* @param expansions A comma separated list of fields to expand. (optional)
* @return APIfindTweetsByIdRequest
*/
public APIfindTweetsByIdRequest expansions(Set expansions) {
this.expansions = expansions;
return this;
}
/**
* Set mediaFields
* @param mediaFields A comma separated list of Media fields to display. (optional)
* @return APIfindTweetsByIdRequest
*/
public APIfindTweetsByIdRequest mediaFields(Set mediaFields) {
this.mediaFields = mediaFields;
return this;
}
/**
* Set pollFields
* @param pollFields A comma separated list of Poll fields to display. (optional)
* @return APIfindTweetsByIdRequest
*/
public APIfindTweetsByIdRequest pollFields(Set pollFields) {
this.pollFields = pollFields;
return this;
}
/**
* Set userFields
* @param userFields A comma separated list of User fields to display. (optional)
* @return APIfindTweetsByIdRequest
*/
public APIfindTweetsByIdRequest userFields(Set userFields) {
this.userFields = userFields;
return this;
}
/**
* Set placeFields
* @param placeFields A comma separated list of Place fields to display. (optional)
* @return APIfindTweetsByIdRequest
*/
public APIfindTweetsByIdRequest placeFields(Set placeFields) {
this.placeFields = placeFields;
return this;
}
/**
* Build call for findTweetsById
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return findTweetsByIdCall(ids, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
}
/**
* Execute findTweetsById request
* @return Get2TweetsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public Get2TweetsResponse execute() throws ApiException {
ApiResponse localVarResp = findTweetsByIdWithHttpInfo(ids, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields);
return localVarResp.getData();
}
/**
* Calls the API using a retry mechanism to handle rate limits errors.
*
*/
public Get2TweetsResponse execute(Integer retries) throws ApiException {
Get2TweetsResponse localVarResp;
try{
localVarResp = execute();
} catch (ApiException e) {
if(handleRateLimit(e, retries)) {
return execute(retries - 1);
} else {
throw e;
}
}
return localVarResp;
}
/**
* Execute findTweetsById request with HTTP info returned
* @return ApiResponse<Get2TweetsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return findTweetsByIdWithHttpInfo(ids, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields);
}
/**
* Execute findTweetsById request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return findTweetsByIdAsync(ids, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
}
}
/**
* Tweet lookup by Tweet IDs
* Returns a variety of information about the Tweet specified by the requested ID.
* @param ids A comma separated list of Tweet IDs. Up to 100 are allowed in a single request. (required)
* @return APIfindTweetsByIdRequest
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public APIfindTweetsByIdRequest findTweetsById(List ids) {
return new APIfindTweetsByIdRequest(ids);
}
private okhttp3.Call findTweetsThatQuoteATweetCall(String id, Integer maxResults, String paginationToken, Set exclude, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/2/tweets/{id}/quote_tweets"
.replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (maxResults != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("max_results", maxResults));
}
if (paginationToken != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination_token", paginationToken));
}
if (exclude != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "exclude", exclude));
}
if (tweetFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "tweet.fields", tweetFields));
}
if (expansions != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "expansions", expansions));
}
if (mediaFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "media.fields", mediaFields));
}
if (pollFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "poll.fields", pollFields));
}
if (userFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "user.fields", userFields));
}
if (placeFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "place.fields", placeFields));
}
final String[] localVarAccepts = {
"application/json", "application/problem+json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "BearerToken", "OAuth2UserToken", "UserToken" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, reduceAuthNames(localVarAuthNames), _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call findTweetsThatQuoteATweetValidateBeforeCall(String id, Integer maxResults, String paginationToken, Set exclude, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling findTweetsThatQuoteATweet(Async)");
}
okhttp3.Call localVarCall = findTweetsThatQuoteATweetCall(id, maxResults, paginationToken, exclude, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
return localVarCall;
}
private ApiResponse findTweetsThatQuoteATweetWithHttpInfo(String id, Integer maxResults, String paginationToken, Set exclude, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields) throws ApiException {
okhttp3.Call localVarCall = findTweetsThatQuoteATweetValidateBeforeCall(id, maxResults, paginationToken, exclude, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call findTweetsThatQuoteATweetAsync(String id, Integer maxResults, String paginationToken, Set exclude, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = findTweetsThatQuoteATweetValidateBeforeCall(id, maxResults, paginationToken, exclude, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIfindTweetsThatQuoteATweetRequest {
private final String id;
private Integer maxResults;
private String paginationToken;
private Set exclude;
private Set tweetFields;
private Set expansions;
private Set mediaFields;
private Set pollFields;
private Set userFields;
private Set placeFields;
private APIfindTweetsThatQuoteATweetRequest(String id) {
this.id = id;
}
/**
* Set maxResults
* @param maxResults The maximum number of results to be returned. (optional, default to 10)
* @return APIfindTweetsThatQuoteATweetRequest
*/
public APIfindTweetsThatQuoteATweetRequest maxResults(Integer maxResults) {
this.maxResults = maxResults;
return this;
}
/**
* Set paginationToken
* @param paginationToken This parameter is used to get a specified 'page' of results. (optional)
* @return APIfindTweetsThatQuoteATweetRequest
*/
public APIfindTweetsThatQuoteATweetRequest paginationToken(String paginationToken) {
this.paginationToken = paginationToken;
return this;
}
/**
* Set exclude
* @param exclude The set of entities to exclude (e.g. 'replies' or 'retweets'). (optional)
* @return APIfindTweetsThatQuoteATweetRequest
*/
public APIfindTweetsThatQuoteATweetRequest exclude(Set exclude) {
this.exclude = exclude;
return this;
}
/**
* Set tweetFields
* @param tweetFields A comma separated list of Tweet fields to display. (optional)
* @return APIfindTweetsThatQuoteATweetRequest
*/
public APIfindTweetsThatQuoteATweetRequest tweetFields(Set tweetFields) {
this.tweetFields = tweetFields;
return this;
}
/**
* Set expansions
* @param expansions A comma separated list of fields to expand. (optional)
* @return APIfindTweetsThatQuoteATweetRequest
*/
public APIfindTweetsThatQuoteATweetRequest expansions(Set expansions) {
this.expansions = expansions;
return this;
}
/**
* Set mediaFields
* @param mediaFields A comma separated list of Media fields to display. (optional)
* @return APIfindTweetsThatQuoteATweetRequest
*/
public APIfindTweetsThatQuoteATweetRequest mediaFields(Set mediaFields) {
this.mediaFields = mediaFields;
return this;
}
/**
* Set pollFields
* @param pollFields A comma separated list of Poll fields to display. (optional)
* @return APIfindTweetsThatQuoteATweetRequest
*/
public APIfindTweetsThatQuoteATweetRequest pollFields(Set pollFields) {
this.pollFields = pollFields;
return this;
}
/**
* Set userFields
* @param userFields A comma separated list of User fields to display. (optional)
* @return APIfindTweetsThatQuoteATweetRequest
*/
public APIfindTweetsThatQuoteATweetRequest userFields(Set userFields) {
this.userFields = userFields;
return this;
}
/**
* Set placeFields
* @param placeFields A comma separated list of Place fields to display. (optional)
* @return APIfindTweetsThatQuoteATweetRequest
*/
public APIfindTweetsThatQuoteATweetRequest placeFields(Set placeFields) {
this.placeFields = placeFields;
return this;
}
/**
* Build call for findTweetsThatQuoteATweet
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return findTweetsThatQuoteATweetCall(id, maxResults, paginationToken, exclude, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
}
/**
* Execute findTweetsThatQuoteATweet request
* @return Get2TweetsIdQuoteTweetsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public Get2TweetsIdQuoteTweetsResponse execute() throws ApiException {
ApiResponse localVarResp = findTweetsThatQuoteATweetWithHttpInfo(id, maxResults, paginationToken, exclude, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields);
return localVarResp.getData();
}
/**
* Calls the API using a retry mechanism to handle rate limits errors.
*
*/
public Get2TweetsIdQuoteTweetsResponse execute(Integer retries) throws ApiException {
Get2TweetsIdQuoteTweetsResponse localVarResp;
try{
localVarResp = execute();
} catch (ApiException e) {
if(handleRateLimit(e, retries)) {
return execute(retries - 1);
} else {
throw e;
}
}
return localVarResp;
}
/**
* Execute findTweetsThatQuoteATweet request with HTTP info returned
* @return ApiResponse<Get2TweetsIdQuoteTweetsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return findTweetsThatQuoteATweetWithHttpInfo(id, maxResults, paginationToken, exclude, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields);
}
/**
* Execute findTweetsThatQuoteATweet request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return findTweetsThatQuoteATweetAsync(id, maxResults, paginationToken, exclude, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback);
}
}
/**
* Retrieve Tweets that quote a Tweet.
* Returns a variety of information about each Tweet that quotes the Tweet specified by the requested ID.
* @param id A single Tweet ID. (required)
* @return APIfindTweetsThatQuoteATweetRequest
* @http.response.details
Status Code
Description
Response Headers
200
The request has succeeded.
-
0
The request has failed.
-
*/
public APIfindTweetsThatQuoteATweetRequest findTweetsThatQuoteATweet(String id) {
return new APIfindTweetsThatQuoteATweetRequest(id);
}
private okhttp3.Call getRulesCall(List ids, Integer maxResults, String paginationToken, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/2/tweets/search/stream/rules";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (ids != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "ids", ids));
}
if (maxResults != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("max_results", maxResults));
}
if (paginationToken != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination_token", paginationToken));
}
final String[] localVarAccepts = {
"application/json", "application/problem+json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "BearerToken" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, reduceAuthNames(localVarAuthNames), _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getRulesValidateBeforeCall(List ids, Integer maxResults, String paginationToken, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getRulesCall(ids, maxResults, paginationToken, _callback);
return localVarCall;
}
private ApiResponse getRulesWithHttpInfo(List ids, Integer maxResults, String paginationToken) throws ApiException {
okhttp3.Call localVarCall = getRulesValidateBeforeCall(ids, maxResults, paginationToken, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call getRulesAsync(List ids, Integer maxResults, String paginationToken, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getRulesValidateBeforeCall(ids, maxResults, paginationToken, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIgetRulesRequest {
private List ids;
private Integer maxResults;
private String paginationToken;
private APIgetRulesRequest() {
}
/**
* Set ids
* @param ids A comma-separated list of Rule IDs. (optional)
* @return APIgetRulesRequest
*/
public APIgetRulesRequest ids(List ids) {
this.ids = ids;
return this;
}
/**
* Set maxResults
* @param maxResults The maximum number of results. (optional, default to 1000)
* @return APIgetRulesRequest
*/
public APIgetRulesRequest maxResults(Integer maxResults) {
this.maxResults = maxResults;
return this;
}
/**
* Set paginationToken
* @param paginationToken This value is populated by passing the 'next_token' returned in a request to paginate through results. (optional)
* @return APIgetRulesRequest
*/
public APIgetRulesRequest paginationToken(String paginationToken) {
this.paginationToken = paginationToken;
return this;
}
/**
* Build call for getRules
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details