com.adzerk.sdk.generated.api.DecisionApi Maven / Gradle / Ivy
/*
* Adzerk Decision API
* Adzerk Decision API
*
* The version of the OpenAPI document: 1.0
*
*
* 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.adzerk.sdk.generated.api;
import com.adzerk.sdk.generated.ApiCallback;
import com.adzerk.sdk.generated.ApiClient;
import com.adzerk.sdk.generated.ApiException;
import com.adzerk.sdk.generated.ApiResponse;
import com.adzerk.sdk.generated.Configuration;
import com.adzerk.sdk.generated.Pair;
import com.adzerk.sdk.generated.ProgressRequestBody;
import com.adzerk.sdk.generated.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.adzerk.sdk.generated.model.DecisionRequest;
import com.adzerk.sdk.generated.model.DecisionResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DecisionApi {
private ApiClient localVarApiClient;
public DecisionApi() {
this(Configuration.getDefaultApiClient());
}
public DecisionApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for getDecisions
* @param decisionRequest (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code Description Response Headers
400 Bad Request -
200 Successful decision request -
*/
public okhttp3.Call getDecisionsCall(DecisionRequest decisionRequest, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = decisionRequest;
// create path and map variables
String localVarPath = "/api/v2";
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);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getDecisionsValidateBeforeCall(DecisionRequest decisionRequest, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getDecisionsCall(decisionRequest, _callback);
return localVarCall;
}
/**
*
* Request Decision(s)
* @param decisionRequest (optional)
* @return DecisionResponse
* @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
400 Bad Request -
200 Successful decision request -
*/
public DecisionResponse getDecisions(DecisionRequest decisionRequest) throws ApiException {
ApiResponse localVarResp = getDecisionsWithHttpInfo(decisionRequest);
return localVarResp.getData();
}
/**
*
* Request Decision(s)
* @param decisionRequest (optional)
* @return ApiResponse<DecisionResponse>
* @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
400 Bad Request -
200 Successful decision request -
*/
public ApiResponse getDecisionsWithHttpInfo(DecisionRequest decisionRequest) throws ApiException {
okhttp3.Call localVarCall = getDecisionsValidateBeforeCall(decisionRequest, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Request Decision(s)
* @param decisionRequest (optional)
* @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
400 Bad Request -
200 Successful decision request -
*/
public okhttp3.Call getDecisionsAsync(DecisionRequest decisionRequest, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getDecisionsValidateBeforeCall(decisionRequest, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}