Tickets.java
package io.swagger.client.api;
import io.swagger.client.ApiCallback;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.ProgressRequestBody;
import io.swagger.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import io.swagger.client.model.Model400;
import io.swagger.client.model.Model401;
import io.swagger.client.model.Model404;
import io.swagger.client.model.Model405;
import io.swagger.client.model.Model500;
import io.swagger.client.model.RespuestaOkTickets;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TicketsApi {
private ApiClient apiClient;
public TicketsApi() {
this(Configuration.getDefaultApiClient());
}
public TicketsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
public com.squareup.okhttp.Call ticketsGetCall(String authorization, String startDate, String endDate, Integer seccion,
Integer terminal, Integer turno, String fecha, final ProgressResponseBody.ProgressListener progressListener,
final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
String localVarPath = "/tickets";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (startDate != null)
localVarQueryParams.addAll(apiClient.parameterToPair("start_date", startDate));
if (endDate != null)
localVarQueryParams.addAll(apiClient.parameterToPair("end_date", endDate));
if (seccion != null)
localVarQueryParams.addAll(apiClient.parameterToPair("seccion", seccion));
if (terminal != null)
localVarQueryParams.addAll(apiClient.parameterToPair("terminal", terminal));
if (turno != null)
localVarQueryParams.addAll(apiClient.parameterToPair("turno", turno));
if (fecha != null)
localVarQueryParams.addAll(apiClient.parameterToPair("fecha", fecha));
Map localVarHeaderParams = new HashMap();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "Authorization" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody,
localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call ticketsGetValidateBeforeCall(String authorization, String startDate, String endDate,
Integer seccion, Integer terminal, Integer turno, String fecha, final ProgressResponseBody.ProgressListener progressListener,
final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
if (authorization == null) {
throw new ApiException("Missing the required parameter 'authorization' when calling ticketsGet(Async)");
}
com.squareup.okhttp.Call call = ticketsGetCall(authorization, startDate, endDate, seccion, terminal, turno, fecha,
progressListener, progressRequestListener);
return call;
}
public RespuestaOkTickets ticketsGet(String authorization, String startDate, String endDate, Integer seccion,
Integer terminal, Integer turno, String fecha) throws ApiException {
ApiResponse resp = ticketsGetWithHttpInfo(authorization, startDate, endDate, seccion,
terminal, turno, fecha);
return resp.getData();
}
public ApiResponse ticketsGetWithHttpInfo(String authorization, String startDate,
String endDate, Integer seccion, Integer terminal, Integer turno, String fecha) throws ApiException {
com.squareup.okhttp.Call call = ticketsGetValidateBeforeCall(authorization, startDate, endDate, seccion,
terminal, turno, fecha, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
public com.squareup.okhttp.Call ticketsGetAsync(String authorization, String startDate, String endDate,
Integer seccion, Integer terminal,Integer turno, String fecha,
final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = ticketsGetValidateBeforeCall(authorization, startDate, endDate, seccion,
terminal, turno, fecha, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}