All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.konfigthis.newscatcherapi.client.api.AuthorsApiGenerated Maven / Gradle / Ivy

/*
 * NewsCatcher-V3 Production API
 *  

Visit our website https://newscatcherapi.com * * The version of the OpenAPI document: 3.2.16 * Contact: [email protected] * * NOTE: This class is auto generated by Konfig (https://konfigthis.com). * Do not edit the class manually. */ package com.konfigthis.newscatcherapi.client.api; import com.konfigthis.newscatcherapi.client.ApiCallback; import com.konfigthis.newscatcherapi.client.ApiClient; import com.konfigthis.newscatcherapi.client.ApiException; import com.konfigthis.newscatcherapi.client.ApiResponse; import com.konfigthis.newscatcherapi.client.Configuration; import com.konfigthis.newscatcherapi.client.Pair; import com.konfigthis.newscatcherapi.client.ProgressRequestBody; import com.konfigthis.newscatcherapi.client.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; import com.konfigthis.newscatcherapi.client.model.AuthorSearchRequest; import com.konfigthis.newscatcherapi.client.model.FSearchResponse; import com.konfigthis.newscatcherapi.client.model.FSearchResponse1; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.ws.rs.core.GenericType; public class AuthorsApiGenerated { private ApiClient localVarApiClient; private int localHostIndex; private String localCustomBaseUrl; public AuthorsApiGenerated() throws IllegalArgumentException { this(Configuration.getDefaultApiClient()); } public AuthorsApiGenerated(ApiClient apiClient) throws IllegalArgumentException { if (apiClient.getApiKey() == null) { throw new IllegalArgumentException("\"x-api-token\" is required but no API key was provided. Please set \"x-api-token\" with ApiClient#setApiKey(String)."); } this.localVarApiClient = apiClient; } public ApiClient getApiClient() { return localVarApiClient; } public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } public int getHostIndex() { return localHostIndex; } public void setHostIndex(int hostIndex) { this.localHostIndex = hostIndex; } public String getCustomBaseUrl() { return localCustomBaseUrl; } public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } private okhttp3.Call getCall(String authorName, String notAuthorName, Object sources, Object predefinedSources, Object notSources, Object lang, Object notLang, Object countries, Object notCountries, String from, String to, String publishedDatePrecision, Boolean byParseDate, String sortBy, String rankedOnly, Integer fromRank, Integer toRank, Boolean isHeadline, Boolean isPaidContent, Object parentUrl, Object allLinks, Object allDomainLinks, Integer wordCountMin, Integer wordCountMax, Integer page, Integer pageSize, Boolean includeNlpData, Boolean hasNlp, String theme, String notTheme, String nerName, Double titleSentimentMin, Double titleSentimentMax, Double contentSentimentMin, Double contentSentimentMax, Object iptcTags, Object notIptcTags, Object iabTags, Object notIabTags, 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 = null; // create path and map variables String localVarPath = "/api/authors"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (authorName != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("author_name", authorName)); } if (notAuthorName != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("not_author_name", notAuthorName)); } if (sources != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("sources", sources)); } if (predefinedSources != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("predefined_sources", predefinedSources)); } if (notSources != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("not_sources", notSources)); } if (lang != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("lang", lang)); } if (notLang != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("not_lang", notLang)); } if (countries != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("countries", countries)); } if (notCountries != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("not_countries", notCountries)); } if (from != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("from_", from)); } if (to != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("to_", to)); } if (publishedDatePrecision != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("published_date_precision", publishedDatePrecision)); } if (byParseDate != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("by_parse_date", byParseDate)); } if (sortBy != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort_by", sortBy)); } if (rankedOnly != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("ranked_only", rankedOnly)); } if (fromRank != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("from_rank", fromRank)); } if (toRank != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("to_rank", toRank)); } if (isHeadline != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("is_headline", isHeadline)); } if (isPaidContent != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("is_paid_content", isPaidContent)); } if (parentUrl != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("parent_url", parentUrl)); } if (allLinks != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("all_links", allLinks)); } if (allDomainLinks != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("all_domain_links", allDomainLinks)); } if (wordCountMin != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("word_count_min", wordCountMin)); } if (wordCountMax != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("word_count_max", wordCountMax)); } if (page != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (includeNlpData != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("include_nlp_data", includeNlpData)); } if (hasNlp != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("has_nlp", hasNlp)); } if (theme != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("theme", theme)); } if (notTheme != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("not_theme", notTheme)); } if (nerName != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("ner_name", nerName)); } if (titleSentimentMin != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("title_sentiment_min", titleSentimentMin)); } if (titleSentimentMax != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("title_sentiment_max", titleSentimentMax)); } if (contentSentimentMin != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("content_sentiment_min", contentSentimentMin)); } if (contentSentimentMax != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("content_sentiment_max", contentSentimentMax)); } if (iptcTags != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("iptc_tags", iptcTags)); } if (notIptcTags != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("not_iptc_tags", notIptcTags)); } if (iabTags != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("iab_tags", iabTags)); } if (notIabTags != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("not_iab_tags", notIabTags)); } final String[] localVarAccepts = { "application/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[] { "apiKey" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getValidateBeforeCall(String authorName, String notAuthorName, Object sources, Object predefinedSources, Object notSources, Object lang, Object notLang, Object countries, Object notCountries, String from, String to, String publishedDatePrecision, Boolean byParseDate, String sortBy, String rankedOnly, Integer fromRank, Integer toRank, Boolean isHeadline, Boolean isPaidContent, Object parentUrl, Object allLinks, Object allDomainLinks, Integer wordCountMin, Integer wordCountMax, Integer page, Integer pageSize, Boolean includeNlpData, Boolean hasNlp, String theme, String notTheme, String nerName, Double titleSentimentMin, Double titleSentimentMax, Double contentSentimentMin, Double contentSentimentMax, Object iptcTags, Object notIptcTags, Object iabTags, Object notIabTags, final ApiCallback _callback) throws ApiException { // verify the required parameter 'authorName' is set if (authorName == null) { throw new ApiException("Missing the required parameter 'authorName' when calling get(Async)"); } return getCall(authorName, notAuthorName, sources, predefinedSources, notSources, lang, notLang, countries, notCountries, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, includeNlpData, hasNlp, theme, notTheme, nerName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, iabTags, notIabTags, _callback); } private ApiResponse getWithHttpInfo(String authorName, String notAuthorName, Object sources, Object predefinedSources, Object notSources, Object lang, Object notLang, Object countries, Object notCountries, String from, String to, String publishedDatePrecision, Boolean byParseDate, String sortBy, String rankedOnly, Integer fromRank, Integer toRank, Boolean isHeadline, Boolean isPaidContent, Object parentUrl, Object allLinks, Object allDomainLinks, Integer wordCountMin, Integer wordCountMax, Integer page, Integer pageSize, Boolean includeNlpData, Boolean hasNlp, String theme, String notTheme, String nerName, Double titleSentimentMin, Double titleSentimentMax, Double contentSentimentMin, Double contentSentimentMax, Object iptcTags, Object notIptcTags, Object iabTags, Object notIabTags) throws ApiException { okhttp3.Call localVarCall = getValidateBeforeCall(authorName, notAuthorName, sources, predefinedSources, notSources, lang, notLang, countries, notCountries, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, includeNlpData, hasNlp, theme, notTheme, nerName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, iabTags, notIabTags, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getAsync(String authorName, String notAuthorName, Object sources, Object predefinedSources, Object notSources, Object lang, Object notLang, Object countries, Object notCountries, String from, String to, String publishedDatePrecision, Boolean byParseDate, String sortBy, String rankedOnly, Integer fromRank, Integer toRank, Boolean isHeadline, Boolean isPaidContent, Object parentUrl, Object allLinks, Object allDomainLinks, Integer wordCountMin, Integer wordCountMax, Integer page, Integer pageSize, Boolean includeNlpData, Boolean hasNlp, String theme, String notTheme, String nerName, Double titleSentimentMin, Double titleSentimentMax, Double contentSentimentMin, Double contentSentimentMax, Object iptcTags, Object notIptcTags, Object iabTags, Object notIabTags, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getValidateBeforeCall(authorName, notAuthorName, sources, predefinedSources, notSources, lang, notLang, countries, notCountries, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, includeNlpData, hasNlp, theme, notTheme, nerName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, iabTags, notIabTags, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class GetRequestBuilder { private final String authorName; private String notAuthorName; private Object sources; private Object predefinedSources; private Object notSources; private Object lang; private Object notLang; private Object countries; private Object notCountries; 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 Boolean includeNlpData; private Boolean hasNlp; private String theme; private String notTheme; private String nerName; private Double titleSentimentMin; private Double titleSentimentMax; private Double contentSentimentMin; private Double contentSentimentMax; private Object iptcTags; private Object notIptcTags; private Object iabTags; private Object notIabTags; private GetRequestBuilder(String authorName) { this.authorName = authorName; } /** * Set notAuthorName * @param notAuthorName (optional) * @return GetRequestBuilder */ public GetRequestBuilder notAuthorName(String notAuthorName) { this.notAuthorName = notAuthorName; return this; } /** * Set sources * @param sources (optional) * @return GetRequestBuilder */ public GetRequestBuilder sources(Object sources) { this.sources = sources; return this; } /** * Set predefinedSources * @param predefinedSources (optional) * @return GetRequestBuilder */ public GetRequestBuilder predefinedSources(Object predefinedSources) { this.predefinedSources = predefinedSources; return this; } /** * Set notSources * @param notSources (optional) * @return GetRequestBuilder */ public GetRequestBuilder notSources(Object notSources) { this.notSources = notSources; return this; } /** * Set lang * @param lang (optional) * @return GetRequestBuilder */ public GetRequestBuilder lang(Object lang) { this.lang = lang; return this; } /** * Set notLang * @param notLang (optional) * @return GetRequestBuilder */ public GetRequestBuilder notLang(Object notLang) { this.notLang = notLang; return this; } /** * Set countries * @param countries (optional) * @return GetRequestBuilder */ public GetRequestBuilder countries(Object countries) { this.countries = countries; return this; } /** * Set notCountries * @param notCountries (optional) * @return GetRequestBuilder */ public GetRequestBuilder notCountries(Object notCountries) { this.notCountries = notCountries; return this; } /** * Set from * @param from (optional) * @return GetRequestBuilder */ public GetRequestBuilder from(String from) { this.from = from; return this; } /** * Set to * @param to (optional) * @return GetRequestBuilder */ public GetRequestBuilder to(String to) { this.to = to; return this; } /** * Set publishedDatePrecision * @param publishedDatePrecision (optional) * @return GetRequestBuilder */ public GetRequestBuilder publishedDatePrecision(String publishedDatePrecision) { this.publishedDatePrecision = publishedDatePrecision; return this; } /** * Set byParseDate * @param byParseDate (optional, default to false) * @return GetRequestBuilder */ public GetRequestBuilder byParseDate(Boolean byParseDate) { this.byParseDate = byParseDate; return this; } /** * Set sortBy * @param sortBy (optional, default to relevancy) * @return GetRequestBuilder */ public GetRequestBuilder sortBy(String sortBy) { this.sortBy = sortBy; return this; } /** * Set rankedOnly * @param rankedOnly (optional) * @return GetRequestBuilder */ public GetRequestBuilder rankedOnly(String rankedOnly) { this.rankedOnly = rankedOnly; return this; } /** * Set fromRank * @param fromRank (optional) * @return GetRequestBuilder */ public GetRequestBuilder fromRank(Integer fromRank) { this.fromRank = fromRank; return this; } /** * Set toRank * @param toRank (optional) * @return GetRequestBuilder */ public GetRequestBuilder toRank(Integer toRank) { this.toRank = toRank; return this; } /** * Set isHeadline * @param isHeadline (optional) * @return GetRequestBuilder */ public GetRequestBuilder isHeadline(Boolean isHeadline) { this.isHeadline = isHeadline; return this; } /** * Set isPaidContent * @param isPaidContent (optional) * @return GetRequestBuilder */ public GetRequestBuilder isPaidContent(Boolean isPaidContent) { this.isPaidContent = isPaidContent; return this; } /** * Set parentUrl * @param parentUrl (optional) * @return GetRequestBuilder */ public GetRequestBuilder parentUrl(Object parentUrl) { this.parentUrl = parentUrl; return this; } /** * Set allLinks * @param allLinks (optional) * @return GetRequestBuilder */ public GetRequestBuilder allLinks(Object allLinks) { this.allLinks = allLinks; return this; } /** * Set allDomainLinks * @param allDomainLinks (optional) * @return GetRequestBuilder */ public GetRequestBuilder allDomainLinks(Object allDomainLinks) { this.allDomainLinks = allDomainLinks; return this; } /** * Set wordCountMin * @param wordCountMin (optional) * @return GetRequestBuilder */ public GetRequestBuilder wordCountMin(Integer wordCountMin) { this.wordCountMin = wordCountMin; return this; } /** * Set wordCountMax * @param wordCountMax (optional) * @return GetRequestBuilder */ public GetRequestBuilder wordCountMax(Integer wordCountMax) { this.wordCountMax = wordCountMax; return this; } /** * Set page * @param page (optional, default to 1) * @return GetRequestBuilder */ public GetRequestBuilder page(Integer page) { this.page = page; return this; } /** * Set pageSize * @param pageSize (optional, default to 100) * @return GetRequestBuilder */ public GetRequestBuilder pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } /** * Set includeNlpData * @param includeNlpData (optional) * @return GetRequestBuilder */ public GetRequestBuilder includeNlpData(Boolean includeNlpData) { this.includeNlpData = includeNlpData; return this; } /** * Set hasNlp * @param hasNlp (optional) * @return GetRequestBuilder */ public GetRequestBuilder hasNlp(Boolean hasNlp) { this.hasNlp = hasNlp; return this; } /** * Set theme * @param theme (optional) * @return GetRequestBuilder */ public GetRequestBuilder theme(String theme) { this.theme = theme; return this; } /** * Set notTheme * @param notTheme (optional) * @return GetRequestBuilder */ public GetRequestBuilder notTheme(String notTheme) { this.notTheme = notTheme; return this; } /** * Set nerName * @param nerName (optional) * @return GetRequestBuilder */ public GetRequestBuilder nerName(String nerName) { this.nerName = nerName; return this; } /** * Set titleSentimentMin * @param titleSentimentMin (optional) * @return GetRequestBuilder */ public GetRequestBuilder titleSentimentMin(Double titleSentimentMin) { this.titleSentimentMin = titleSentimentMin; return this; } /** * Set titleSentimentMax * @param titleSentimentMax (optional) * @return GetRequestBuilder */ public GetRequestBuilder titleSentimentMax(Double titleSentimentMax) { this.titleSentimentMax = titleSentimentMax; return this; } /** * Set contentSentimentMin * @param contentSentimentMin (optional) * @return GetRequestBuilder */ public GetRequestBuilder contentSentimentMin(Double contentSentimentMin) { this.contentSentimentMin = contentSentimentMin; return this; } /** * Set contentSentimentMax * @param contentSentimentMax (optional) * @return GetRequestBuilder */ public GetRequestBuilder contentSentimentMax(Double contentSentimentMax) { this.contentSentimentMax = contentSentimentMax; return this; } /** * Set iptcTags * @param iptcTags (optional) * @return GetRequestBuilder */ public GetRequestBuilder iptcTags(Object iptcTags) { this.iptcTags = iptcTags; return this; } /** * Set notIptcTags * @param notIptcTags (optional) * @return GetRequestBuilder */ public GetRequestBuilder notIptcTags(Object notIptcTags) { this.notIptcTags = notIptcTags; return this; } /** * Set iabTags * @param iabTags (optional) * @return GetRequestBuilder */ public GetRequestBuilder iabTags(Object iabTags) { this.iabTags = iabTags; return this; } /** * Set notIabTags * @param notIabTags (optional) * @return GetRequestBuilder */ public GetRequestBuilder notIabTags(Object notIabTags) { this.notIabTags = notIabTags; return this; } /** * Build call for get * @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 { return getCall(authorName, notAuthorName, sources, predefinedSources, notSources, lang, notLang, countries, notCountries, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, includeNlpData, hasNlp, theme, notTheme, nerName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, iabTags, notIabTags, _callback); } /** * Execute get request * @return FSearchResponse * @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 FSearchResponse execute() throws ApiException { ApiResponse localVarResp = getWithHttpInfo(authorName, notAuthorName, sources, predefinedSources, notSources, lang, notLang, countries, notCountries, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, includeNlpData, hasNlp, theme, notTheme, nerName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, iabTags, notIabTags); return localVarResp.getResponseBody(); } /** * Execute get request with HTTP info returned * @return ApiResponse<FSearchResponse> * @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(authorName, notAuthorName, sources, predefinedSources, notSources, lang, notLang, countries, notCountries, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, includeNlpData, hasNlp, theme, notTheme, nerName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, iabTags, notIabTags); } /** * 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(authorName, notAuthorName, sources, predefinedSources, notSources, lang, notLang, countries, notCountries, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, includeNlpData, hasNlp, theme, notTheme, nerName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, iabTags, notIabTags, _callback); } } /** * [Get] Search By Author Request * This endpoint allows you to search for articles by author. You need to specify the author name. You can also filter by language, country, source, and more. * @param authorName (required) * @return GetRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public GetRequestBuilder get(String authorName) throws IllegalArgumentException { if (authorName == null) throw new IllegalArgumentException("\"authorName\" is required but got null"); return new GetRequestBuilder(authorName); } private okhttp3.Call postCall(AuthorSearchRequest authorSearchRequest, 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 = authorSearchRequest; // create path and map variables String localVarPath = "/api/authors"; 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(AuthorSearchRequest authorSearchRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'authorSearchRequest' is set if (authorSearchRequest == null) { throw new ApiException("Missing the required parameter 'authorSearchRequest' when calling post(Async)"); } return postCall(authorSearchRequest, _callback); } private ApiResponse postWithHttpInfo(AuthorSearchRequest authorSearchRequest) throws ApiException { okhttp3.Call localVarCall = postValidateBeforeCall(authorSearchRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call postAsync(AuthorSearchRequest authorSearchRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = postValidateBeforeCall(authorSearchRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class PostRequestBuilder { private final String authorName; private String notAuthorName; private Object sources; private Object predefinedSources; private Object notSources; private Object lang; private Object notLang; private Object countries; private Object notCountries; 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 Boolean includeNlpData; private Boolean hasNlp; private String theme; private String notTheme; private String nerName; private Double titleSentimentMin; private Double titleSentimentMax; private Double contentSentimentMin; private Double contentSentimentMax; private Object iptcTags; private Object notIptcTags; private Object iabTags; private Object notIabTags; private PostRequestBuilder(String authorName) { this.authorName = authorName; } /** * Set notAuthorName * @param notAuthorName (optional) * @return PostRequestBuilder */ public PostRequestBuilder notAuthorName(String notAuthorName) { this.notAuthorName = notAuthorName; return this; } /** * Set sources * @param sources (optional) * @return PostRequestBuilder */ public PostRequestBuilder sources(Object sources) { this.sources = sources; return this; } /** * Set predefinedSources * @param predefinedSources (optional) * @return PostRequestBuilder */ public PostRequestBuilder predefinedSources(Object predefinedSources) { this.predefinedSources = predefinedSources; 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 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 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 nerName * @param nerName (optional) * @return PostRequestBuilder */ public PostRequestBuilder nerName(String nerName) { this.nerName = nerName; 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 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; } /** * 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 { AuthorSearchRequest authorSearchRequest = buildBodyParams(); return postCall(authorSearchRequest, _callback); } private AuthorSearchRequest buildBodyParams() { AuthorSearchRequest authorSearchRequest = new AuthorSearchRequest(); authorSearchRequest.authorName(this.authorName); authorSearchRequest.notAuthorName(this.notAuthorName); authorSearchRequest.sources(this.sources); authorSearchRequest.predefinedSources(this.predefinedSources); authorSearchRequest.notSources(this.notSources); authorSearchRequest.lang(this.lang); authorSearchRequest.notLang(this.notLang); authorSearchRequest.countries(this.countries); authorSearchRequest.notCountries(this.notCountries); authorSearchRequest.from(this.from); authorSearchRequest.to(this.to); authorSearchRequest.publishedDatePrecision(this.publishedDatePrecision); authorSearchRequest.byParseDate(this.byParseDate); authorSearchRequest.sortBy(this.sortBy); authorSearchRequest.rankedOnly(this.rankedOnly); authorSearchRequest.fromRank(this.fromRank); authorSearchRequest.toRank(this.toRank); authorSearchRequest.isHeadline(this.isHeadline); authorSearchRequest.isPaidContent(this.isPaidContent); authorSearchRequest.parentUrl(this.parentUrl); authorSearchRequest.allLinks(this.allLinks); authorSearchRequest.allDomainLinks(this.allDomainLinks); authorSearchRequest.wordCountMin(this.wordCountMin); authorSearchRequest.wordCountMax(this.wordCountMax); authorSearchRequest.page(this.page); authorSearchRequest.pageSize(this.pageSize); authorSearchRequest.includeNlpData(this.includeNlpData); authorSearchRequest.hasNlp(this.hasNlp); authorSearchRequest.theme(this.theme); authorSearchRequest.notTheme(this.notTheme); authorSearchRequest.nerName(this.nerName); authorSearchRequest.titleSentimentMin(this.titleSentimentMin); authorSearchRequest.titleSentimentMax(this.titleSentimentMax); authorSearchRequest.contentSentimentMin(this.contentSentimentMin); authorSearchRequest.contentSentimentMax(this.contentSentimentMax); authorSearchRequest.iptcTags(this.iptcTags); authorSearchRequest.notIptcTags(this.notIptcTags); authorSearchRequest.iabTags(this.iabTags); authorSearchRequest.notIabTags(this.notIabTags); return authorSearchRequest; } /** * Execute post request * @return FSearchResponse1 * @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 FSearchResponse1 execute() throws ApiException { AuthorSearchRequest authorSearchRequest = buildBodyParams(); ApiResponse localVarResp = postWithHttpInfo(authorSearchRequest); return localVarResp.getResponseBody(); } /** * Execute post request with HTTP info returned * @return ApiResponse<FSearchResponse1> * @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 { AuthorSearchRequest authorSearchRequest = buildBodyParams(); return postWithHttpInfo(authorSearchRequest); } /** * 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 { AuthorSearchRequest authorSearchRequest = buildBodyParams(); return postAsync(authorSearchRequest, _callback); } } /** * [Post] Search By Author Request * This endpoint allows you to search for articles by author. You need to specify the author name. You can also filter by language, country, source, and more. * @param authorSearchRequest (required) * @return PostRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public PostRequestBuilder post(String authorName) throws IllegalArgumentException { if (authorName == null) throw new IllegalArgumentException("\"authorName\" is required but got null"); return new PostRequestBuilder(authorName); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy