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.
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return getCall(q, searchIn, predefinedSources, sources, notSources, lang, notLang, countries, notCountries, notAuthorName, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, clusteringVariable, clusteringEnabled, clusteringThreshold, includeNlpData, hasNlp, theme, notTheme, orGEntityName, peREntityName, loCEntityName, miSCEntityName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, sourceName, iabTags, notIabTags, excludeDuplicates, _callback);
}
/**
* Execute get request
* @return CSearchResponse
* @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
Successful Response
-
*/
public CSearchResponse execute() throws ApiException {
ApiResponse localVarResp = getWithHttpInfo(q, searchIn, predefinedSources, sources, notSources, lang, notLang, countries, notCountries, notAuthorName, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, clusteringVariable, clusteringEnabled, clusteringThreshold, includeNlpData, hasNlp, theme, notTheme, orGEntityName, peREntityName, loCEntityName, miSCEntityName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, sourceName, iabTags, notIabTags, excludeDuplicates);
return localVarResp.getResponseBody();
}
/**
* Execute get request with HTTP info returned
* @return ApiResponse<CSearchResponse>
* @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
Successful Response
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return getWithHttpInfo(q, searchIn, predefinedSources, sources, notSources, lang, notLang, countries, notCountries, notAuthorName, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, clusteringVariable, clusteringEnabled, clusteringThreshold, includeNlpData, hasNlp, theme, notTheme, orGEntityName, peREntityName, loCEntityName, miSCEntityName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, sourceName, iabTags, notIabTags, excludeDuplicates);
}
/**
* Execute get 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
Successful Response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getAsync(q, searchIn, predefinedSources, sources, notSources, lang, notLang, countries, notCountries, notAuthorName, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, clusteringVariable, clusteringEnabled, clusteringThreshold, includeNlpData, hasNlp, theme, notTheme, orGEntityName, peREntityName, loCEntityName, miSCEntityName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, sourceName, iabTags, notIabTags, excludeDuplicates, _callback);
}
}
/**
* [Get] Search For Articles Request
* This endpoint allows you to search for articles. You can search for articles by keyword, language, country, source, and more.
* @param q (required)
* @return GetRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public GetRequestBuilder get(String q) throws IllegalArgumentException {
if (q == null) throw new IllegalArgumentException("\"q\" is required but got null");
return new GetRequestBuilder(q);
}
private okhttp3.Call postCall(SearchRequest searchRequest, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = searchRequest;
// create path and map variables
String localVarPath = "/api/search";
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"
};
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[] { "apiKey" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call postValidateBeforeCall(SearchRequest searchRequest, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'searchRequest' is set
if (searchRequest == null) {
throw new ApiException("Missing the required parameter 'searchRequest' when calling post(Async)");
}
return postCall(searchRequest, _callback);
}
private ApiResponse postWithHttpInfo(SearchRequest searchRequest) throws ApiException {
okhttp3.Call localVarCall = postValidateBeforeCall(searchRequest, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call postAsync(SearchRequest searchRequest, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = postValidateBeforeCall(searchRequest, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class PostRequestBuilder {
private final String q;
private String searchIn;
private Object predefinedSources;
private Object sources;
private Object notSources;
private Object lang;
private Object notLang;
private Object countries;
private Object notCountries;
private Object notAuthorName;
private String from;
private String to;
private String publishedDatePrecision;
private Boolean byParseDate;
private String sortBy;
private String rankedOnly;
private Integer fromRank;
private Integer toRank;
private Boolean isHeadline;
private Boolean isPaidContent;
private Object parentUrl;
private Object allLinks;
private Object allDomainLinks;
private Integer wordCountMin;
private Integer wordCountMax;
private Integer page;
private Integer pageSize;
private String clusteringVariable;
private Boolean clusteringEnabled;
private Double clusteringThreshold;
private Boolean includeNlpData;
private Boolean hasNlp;
private String theme;
private String notTheme;
private String orGEntityName;
private String peREntityName;
private String loCEntityName;
private String miSCEntityName;
private Double titleSentimentMin;
private Double titleSentimentMax;
private Double contentSentimentMin;
private Double contentSentimentMax;
private Object iptcTags;
private Object notIptcTags;
private Object sourceName;
private Object iabTags;
private Object notIabTags;
private Boolean excludeDuplicates;
private PostRequestBuilder(String q) {
this.q = q;
}
/**
* Set searchIn
* @param searchIn (optional, default to title_content)
* @return PostRequestBuilder
*/
public PostRequestBuilder searchIn(String searchIn) {
this.searchIn = searchIn;
return this;
}
/**
* Set predefinedSources
* @param predefinedSources (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder predefinedSources(Object predefinedSources) {
this.predefinedSources = predefinedSources;
return this;
}
/**
* Set sources
* @param sources (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder sources(Object sources) {
this.sources = sources;
return this;
}
/**
* Set notSources
* @param notSources (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder notSources(Object notSources) {
this.notSources = notSources;
return this;
}
/**
* Set lang
* @param lang (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder lang(Object lang) {
this.lang = lang;
return this;
}
/**
* Set notLang
* @param notLang (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder notLang(Object notLang) {
this.notLang = notLang;
return this;
}
/**
* Set countries
* @param countries (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder countries(Object countries) {
this.countries = countries;
return this;
}
/**
* Set notCountries
* @param notCountries (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder notCountries(Object notCountries) {
this.notCountries = notCountries;
return this;
}
/**
* Set notAuthorName
* @param notAuthorName (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder notAuthorName(Object notAuthorName) {
this.notAuthorName = notAuthorName;
return this;
}
/**
* Set from
* @param from (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder from(String from) {
this.from = from;
return this;
}
/**
* Set to
* @param to (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder to(String to) {
this.to = to;
return this;
}
/**
* Set publishedDatePrecision
* @param publishedDatePrecision (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder publishedDatePrecision(String publishedDatePrecision) {
this.publishedDatePrecision = publishedDatePrecision;
return this;
}
/**
* Set byParseDate
* @param byParseDate (optional, default to false)
* @return PostRequestBuilder
*/
public PostRequestBuilder byParseDate(Boolean byParseDate) {
this.byParseDate = byParseDate;
return this;
}
/**
* Set sortBy
* @param sortBy (optional, default to relevancy)
* @return PostRequestBuilder
*/
public PostRequestBuilder sortBy(String sortBy) {
this.sortBy = sortBy;
return this;
}
/**
* Set rankedOnly
* @param rankedOnly (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder rankedOnly(String rankedOnly) {
this.rankedOnly = rankedOnly;
return this;
}
/**
* Set fromRank
* @param fromRank (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder fromRank(Integer fromRank) {
this.fromRank = fromRank;
return this;
}
/**
* Set toRank
* @param toRank (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder toRank(Integer toRank) {
this.toRank = toRank;
return this;
}
/**
* Set isHeadline
* @param isHeadline (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder isHeadline(Boolean isHeadline) {
this.isHeadline = isHeadline;
return this;
}
/**
* Set isPaidContent
* @param isPaidContent (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder isPaidContent(Boolean isPaidContent) {
this.isPaidContent = isPaidContent;
return this;
}
/**
* Set parentUrl
* @param parentUrl (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder parentUrl(Object parentUrl) {
this.parentUrl = parentUrl;
return this;
}
/**
* Set allLinks
* @param allLinks (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder allLinks(Object allLinks) {
this.allLinks = allLinks;
return this;
}
/**
* Set allDomainLinks
* @param allDomainLinks (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder allDomainLinks(Object allDomainLinks) {
this.allDomainLinks = allDomainLinks;
return this;
}
/**
* Set wordCountMin
* @param wordCountMin (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder wordCountMin(Integer wordCountMin) {
this.wordCountMin = wordCountMin;
return this;
}
/**
* Set wordCountMax
* @param wordCountMax (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder wordCountMax(Integer wordCountMax) {
this.wordCountMax = wordCountMax;
return this;
}
/**
* Set page
* @param page (optional, default to 1)
* @return PostRequestBuilder
*/
public PostRequestBuilder page(Integer page) {
this.page = page;
return this;
}
/**
* Set pageSize
* @param pageSize (optional, default to 100)
* @return PostRequestBuilder
*/
public PostRequestBuilder pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set clusteringVariable
* @param clusteringVariable (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder clusteringVariable(String clusteringVariable) {
this.clusteringVariable = clusteringVariable;
return this;
}
/**
* Set clusteringEnabled
* @param clusteringEnabled (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder clusteringEnabled(Boolean clusteringEnabled) {
this.clusteringEnabled = clusteringEnabled;
return this;
}
/**
* Set clusteringThreshold
* @param clusteringThreshold (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder clusteringThreshold(Double clusteringThreshold) {
this.clusteringThreshold = clusteringThreshold;
return this;
}
/**
* Set includeNlpData
* @param includeNlpData (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder includeNlpData(Boolean includeNlpData) {
this.includeNlpData = includeNlpData;
return this;
}
/**
* Set hasNlp
* @param hasNlp (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder hasNlp(Boolean hasNlp) {
this.hasNlp = hasNlp;
return this;
}
/**
* Set theme
* @param theme (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder theme(String theme) {
this.theme = theme;
return this;
}
/**
* Set notTheme
* @param notTheme (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder notTheme(String notTheme) {
this.notTheme = notTheme;
return this;
}
/**
* Set orGEntityName
* @param orGEntityName (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder orGEntityName(String orGEntityName) {
this.orGEntityName = orGEntityName;
return this;
}
/**
* Set peREntityName
* @param peREntityName (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder peREntityName(String peREntityName) {
this.peREntityName = peREntityName;
return this;
}
/**
* Set loCEntityName
* @param loCEntityName (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder loCEntityName(String loCEntityName) {
this.loCEntityName = loCEntityName;
return this;
}
/**
* Set miSCEntityName
* @param miSCEntityName (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder miSCEntityName(String miSCEntityName) {
this.miSCEntityName = miSCEntityName;
return this;
}
/**
* Set titleSentimentMin
* @param titleSentimentMin (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder titleSentimentMin(Double titleSentimentMin) {
this.titleSentimentMin = titleSentimentMin;
return this;
}
/**
* Set titleSentimentMax
* @param titleSentimentMax (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder titleSentimentMax(Double titleSentimentMax) {
this.titleSentimentMax = titleSentimentMax;
return this;
}
/**
* Set contentSentimentMin
* @param contentSentimentMin (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder contentSentimentMin(Double contentSentimentMin) {
this.contentSentimentMin = contentSentimentMin;
return this;
}
/**
* Set contentSentimentMax
* @param contentSentimentMax (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder contentSentimentMax(Double contentSentimentMax) {
this.contentSentimentMax = contentSentimentMax;
return this;
}
/**
* Set iptcTags
* @param iptcTags (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder iptcTags(Object iptcTags) {
this.iptcTags = iptcTags;
return this;
}
/**
* Set notIptcTags
* @param notIptcTags (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder notIptcTags(Object notIptcTags) {
this.notIptcTags = notIptcTags;
return this;
}
/**
* Set sourceName
* @param sourceName (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder sourceName(Object sourceName) {
this.sourceName = sourceName;
return this;
}
/**
* Set iabTags
* @param iabTags (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder iabTags(Object iabTags) {
this.iabTags = iabTags;
return this;
}
/**
* Set notIabTags
* @param notIabTags (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder notIabTags(Object notIabTags) {
this.notIabTags = notIabTags;
return this;
}
/**
* Set excludeDuplicates
* @param excludeDuplicates (optional)
* @return PostRequestBuilder
*/
public PostRequestBuilder excludeDuplicates(Boolean excludeDuplicates) {
this.excludeDuplicates = excludeDuplicates;
return this;
}
/**
* Build call for post
* @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
Successful Response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
SearchRequest searchRequest = buildBodyParams();
return postCall(searchRequest, _callback);
}
private SearchRequest buildBodyParams() {
SearchRequest searchRequest = new SearchRequest();
searchRequest.q(this.q);
searchRequest.searchIn(this.searchIn);
searchRequest.predefinedSources(this.predefinedSources);
searchRequest.sources(this.sources);
searchRequest.notSources(this.notSources);
searchRequest.lang(this.lang);
searchRequest.notLang(this.notLang);
searchRequest.countries(this.countries);
searchRequest.notCountries(this.notCountries);
searchRequest.notAuthorName(this.notAuthorName);
searchRequest.from(this.from);
searchRequest.to(this.to);
searchRequest.publishedDatePrecision(this.publishedDatePrecision);
searchRequest.byParseDate(this.byParseDate);
searchRequest.sortBy(this.sortBy);
searchRequest.rankedOnly(this.rankedOnly);
searchRequest.fromRank(this.fromRank);
searchRequest.toRank(this.toRank);
searchRequest.isHeadline(this.isHeadline);
searchRequest.isPaidContent(this.isPaidContent);
searchRequest.parentUrl(this.parentUrl);
searchRequest.allLinks(this.allLinks);
searchRequest.allDomainLinks(this.allDomainLinks);
searchRequest.wordCountMin(this.wordCountMin);
searchRequest.wordCountMax(this.wordCountMax);
searchRequest.page(this.page);
searchRequest.pageSize(this.pageSize);
searchRequest.clusteringVariable(this.clusteringVariable);
searchRequest.clusteringEnabled(this.clusteringEnabled);
searchRequest.clusteringThreshold(this.clusteringThreshold);
searchRequest.includeNlpData(this.includeNlpData);
searchRequest.hasNlp(this.hasNlp);
searchRequest.theme(this.theme);
searchRequest.notTheme(this.notTheme);
searchRequest.orGEntityName(this.orGEntityName);
searchRequest.peREntityName(this.peREntityName);
searchRequest.loCEntityName(this.loCEntityName);
searchRequest.miSCEntityName(this.miSCEntityName);
searchRequest.titleSentimentMin(this.titleSentimentMin);
searchRequest.titleSentimentMax(this.titleSentimentMax);
searchRequest.contentSentimentMin(this.contentSentimentMin);
searchRequest.contentSentimentMax(this.contentSentimentMax);
searchRequest.iptcTags(this.iptcTags);
searchRequest.notIptcTags(this.notIptcTags);
searchRequest.sourceName(this.sourceName);
searchRequest.iabTags(this.iabTags);
searchRequest.notIabTags(this.notIabTags);
searchRequest.excludeDuplicates(this.excludeDuplicates);
return searchRequest;
}
/**
* Execute post request
* @return CSearchResponse1
* @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
Successful Response
-
*/
public CSearchResponse1 execute() throws ApiException {
SearchRequest searchRequest = buildBodyParams();
ApiResponse localVarResp = postWithHttpInfo(searchRequest);
return localVarResp.getResponseBody();
}
/**
* Execute post request with HTTP info returned
* @return ApiResponse<CSearchResponse1>
* @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
Successful Response
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
SearchRequest searchRequest = buildBodyParams();
return postWithHttpInfo(searchRequest);
}
/**
* Execute post 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
Successful Response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
SearchRequest searchRequest = buildBodyParams();
return postAsync(searchRequest, _callback);
}
}
/**
* [Post] Search For Articles Request
* This endpoint allows you to search for articles. You can search for articles by keyword, language, country, source, and more.
* @param searchRequest (required)
* @return PostRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public PostRequestBuilder post(String q) throws IllegalArgumentException {
if (q == null) throw new IllegalArgumentException("\"q\" is required but got null");
return new PostRequestBuilder(q);
}
}