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.
/*
* 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.AirlineSession;
import com.hopper.cloud.airlines.model.BadRequest;
import com.hopper.cloud.airlines.model.CreateAirlineSessionRequest;
import com.hopper.cloud.airlines.model.IdentifyAirlineSessionRequest;
import com.hopper.cloud.airlines.model.UnprocessableEntity;
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 SessionsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public SessionsApi() {
this(Configuration.getDefaultApiClient());
}
public SessionsApi(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 postSessions
* @param createAirlineSessionRequest (required)
* @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 created airline session
-
204
The airline session creation request was 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 postSessionsCall(CreateAirlineSessionRequest createAirlineSessionRequest, 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 = createAirlineSessionRequest;
// create path and map variables
String localVarPath = "/sessions";
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[] { "PartnerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call postSessionsValidateBeforeCall(CreateAirlineSessionRequest createAirlineSessionRequest, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createAirlineSessionRequest' is set
if (createAirlineSessionRequest == null) {
throw new ApiException("Missing the required parameter 'createAirlineSessionRequest' when calling postSessions(Async)");
}
okhttp3.Call localVarCall = postSessionsCall(createAirlineSessionRequest, _callback);
return localVarCall;
}
/**
* Create a airline Session
* Create a new session for which events will be collected
* @param createAirlineSessionRequest (required)
* @return AirlineSession
* @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 created airline session
-
204
The airline session creation request was 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 AirlineSession postSessions(CreateAirlineSessionRequest createAirlineSessionRequest) throws ApiException {
ApiResponse localVarResp = postSessionsWithHttpInfo(createAirlineSessionRequest);
return localVarResp.getData();
}
/**
* Create a airline Session
* Create a new session for which events will be collected
* @param createAirlineSessionRequest (required)
* @return ApiResponse<AirlineSession>
* @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 created airline session
-
204
The airline session creation request was 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 postSessionsWithHttpInfo(CreateAirlineSessionRequest createAirlineSessionRequest) throws ApiException {
okhttp3.Call localVarCall = postSessionsValidateBeforeCall(createAirlineSessionRequest, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create a airline Session (asynchronously)
* Create a new session for which events will be collected
* @param createAirlineSessionRequest (required)
* @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 created airline session
-
204
The airline session creation request was 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 postSessionsAsync(CreateAirlineSessionRequest createAirlineSessionRequest, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = postSessionsValidateBeforeCall(createAirlineSessionRequest, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for putSessionsIdIdentify
* @param id The ID of the airline session to identify (required)
* @param identifyAirlineSessionRequest (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
200
The airline session has been successfully identified
-
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 putSessionsIdIdentifyCall(String id, IdentifyAirlineSessionRequest identifyAirlineSessionRequest, 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 = identifyAirlineSessionRequest;
// create path and map variables
String localVarPath = "/sessions/{id}/identify"
.replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString()));
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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call putSessionsIdIdentifyValidateBeforeCall(String id, IdentifyAirlineSessionRequest identifyAirlineSessionRequest, String hcSessionID, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling putSessionsIdIdentify(Async)");
}
// verify the required parameter 'identifyAirlineSessionRequest' is set
if (identifyAirlineSessionRequest == null) {
throw new ApiException("Missing the required parameter 'identifyAirlineSessionRequest' when calling putSessionsIdIdentify(Async)");
}
okhttp3.Call localVarCall = putSessionsIdIdentifyCall(id, identifyAirlineSessionRequest, hcSessionID, _callback);
return localVarCall;
}
/**
* Identify a airline Session
* Add a airline user ID for a session that has already been created. This endpoint should be called when a session was created for an anonymous user, but they later login.
* @param id The ID of the airline session to identify (required)
* @param identifyAirlineSessionRequest (required)
* @param hcSessionID The ID of the current airline session, see [Sessions](#tag/Sessions) (optional)
* @return AirlineSession
* @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
The airline session has been successfully identified
-
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 AirlineSession putSessionsIdIdentify(String id, IdentifyAirlineSessionRequest identifyAirlineSessionRequest, String hcSessionID) throws ApiException {
ApiResponse localVarResp = putSessionsIdIdentifyWithHttpInfo(id, identifyAirlineSessionRequest, hcSessionID);
return localVarResp.getData();
}
/**
* Identify a airline Session
* Add a airline user ID for a session that has already been created. This endpoint should be called when a session was created for an anonymous user, but they later login.
* @param id The ID of the airline session to identify (required)
* @param identifyAirlineSessionRequest (required)
* @param hcSessionID The ID of the current airline session, see [Sessions](#tag/Sessions) (optional)
* @return ApiResponse<AirlineSession>
* @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
The airline session has been successfully identified
-
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 putSessionsIdIdentifyWithHttpInfo(String id, IdentifyAirlineSessionRequest identifyAirlineSessionRequest, String hcSessionID) throws ApiException {
okhttp3.Call localVarCall = putSessionsIdIdentifyValidateBeforeCall(id, identifyAirlineSessionRequest, hcSessionID, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Identify a airline Session (asynchronously)
* Add a airline user ID for a session that has already been created. This endpoint should be called when a session was created for an anonymous user, but they later login.
* @param id The ID of the airline session to identify (required)
* @param identifyAirlineSessionRequest (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
200
The airline session has been successfully identified
-
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 putSessionsIdIdentifyAsync(String id, IdentifyAirlineSessionRequest identifyAirlineSessionRequest, String hcSessionID, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = putSessionsIdIdentifyValidateBeforeCall(id, identifyAirlineSessionRequest, hcSessionID, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}