com.hopper.cloud.airlines.api.AnalyticsApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloud-airlines-java Show documentation
Show all versions of cloud-airlines-java Show documentation
Use the Hopper cloud airlines Web Services in Java!
The newest version!
/*
* Airline API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v1.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.hopper.cloud.airlines.api;
import com.hopper.cloud.airlines.ApiCallback;
import com.hopper.cloud.airlines.ApiClient;
import com.hopper.cloud.airlines.ApiException;
import com.hopper.cloud.airlines.ApiResponse;
import com.hopper.cloud.airlines.Configuration;
import com.hopper.cloud.airlines.Pair;
import com.hopper.cloud.airlines.ProgressRequestBody;
import com.hopper.cloud.airlines.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import com.hopper.cloud.airlines.model.*;
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 AnalyticsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public AnalyticsApi() {
this(Configuration.getDefaultApiClient());
}
public AnalyticsApi(ApiClient apiClient) {
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;
}
/**
* Build call for postEvents
* @param event (required)
* @param hcSessionID The ID of the current airline session, see [Sessions](#tag/Sessions) (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
201 The event was correctly fired -
204 The request was successfully validated but not performed -
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -
*/
public okhttp3.Call postEventsCall(Event event, String hcSessionID, 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 = event;
// create path and map variables
String localVarPath = "/events";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (hcSessionID != null) {
localVarHeaderParams.put("HC-Session-ID", localVarApiClient.parameterToString(hcSessionID));
}
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[] { "PartnerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call postEventsValidateBeforeCall(Event event, String hcSessionID, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'event' is set
if (event == null) {
throw new ApiException("Missing the required parameter 'event' when calling postEvents(Async)");
}
okhttp3.Call localVarCall = postEventsCall(event, hcSessionID, _callback);
return localVarCall;
}
/**
* Send a Backend Event
* Events can be send directly from partner backend using the same authentication as the other endpoints
* @param event (required)
* @param hcSessionID The ID of the current airline session, see [Sessions](#tag/Sessions) (optional)
* @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 event was correctly fired -
204 The request was successfully validated but not performed -
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -
*/
public void postEvents(Event event, String hcSessionID) throws ApiException {
postEventsWithHttpInfo(event, hcSessionID);
}
/**
* Send a Backend Event
* Events can be send directly from partner backend using the same authentication as the other endpoints
* @param event (required)
* @param hcSessionID The ID of the current airline session, see [Sessions](#tag/Sessions) (optional)
* @return ApiResponse<Void>
* @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 event was correctly fired -
204 The request was successfully validated but not performed -
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -
*/
public ApiResponse postEventsWithHttpInfo(Event event, String hcSessionID) throws ApiException {
okhttp3.Call localVarCall = postEventsValidateBeforeCall(event, hcSessionID, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Send a Backend Event (asynchronously)
* Events can be send directly from partner backend using the same authentication as the other endpoints
* @param event (required)
* @param hcSessionID The ID of the current airline session, see [Sessions](#tag/Sessions) (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
201 The event was correctly fired -
204 The request was successfully validated but not performed -
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -
*/
public okhttp3.Call postEventsAsync(Event event, String hcSessionID, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = postEventsValidateBeforeCall(event, hcSessionID, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy