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.
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.SubscriptionResponse;
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 SubscriptionApiGenerated {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public SubscriptionApiGenerated() throws IllegalArgumentException {
this(Configuration.getDefaultApiClient());
}
public SubscriptionApiGenerated(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(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/subscription";
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 = {
};
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(final ApiCallback _callback) throws ApiException {
return getCall(_callback);
}
private ApiResponse getWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getValidateBeforeCall(null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getAsync(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class GetRequestBuilderGenerated {
public GetRequestBuilderGenerated() {
}
/**
* 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(_callback);
}
/**
* Execute get request
* @return SubscriptionResponse
* @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 SubscriptionResponse execute() throws ApiException {
ApiResponse localVarResp = getWithHttpInfo();
return localVarResp.getResponseBody();
}
/**
* Execute get request with HTTP info returned
* @return ApiResponse<SubscriptionResponse>
* @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();
}
/**
* 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(_callback);
}
}
/**
* [Get] Get My Plan Info
* This endpoint allows you to get info about your subscription plan.
* @return GetRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public SubscriptionApi.GetRequestBuilder get() throws IllegalArgumentException {
return ((SubscriptionApi) this).new GetRequestBuilder();
}
private okhttp3.Call postCall(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/subscription";
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 = {
};
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(final ApiCallback _callback) throws ApiException {
return postCall(_callback);
}
private ApiResponse postWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = postValidateBeforeCall(null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call postAsync(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = postValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class PostRequestBuilderGenerated {
public PostRequestBuilderGenerated() {
}
/**
* 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 {
return postCall(_callback);
}
/**
* Execute post request
* @return SubscriptionResponse
* @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 SubscriptionResponse execute() throws ApiException {
ApiResponse localVarResp = postWithHttpInfo();
return localVarResp.getResponseBody();
}
/**
* Execute post request with HTTP info returned
* @return ApiResponse<SubscriptionResponse>
* @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 postWithHttpInfo();
}
/**
* 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 {
return postAsync(_callback);
}
}
/**
* [Post] Get My Plan Info
* This endpoint allows you to get info about your subscription plan.
* @return PostRequestBuilder
* @http.response.details