{
+
+ private DateFormat dateFormat;
+
+ public DateTypeAdapter() {
+ }
+
+ public DateTypeAdapter(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ }
+
+ public void setFormat(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ }
+
+ @Override
+ public void write(JsonWriter out, Date date) throws IOException {
+ if (date == null) {
+ out.nullValue();
+ } else {
+ String value;
+ if (dateFormat != null) {
+ value = dateFormat.format(date);
+ } else {
+ value = ISO8601Utils.format(date, true);
+ }
+ out.value(value);
+ }
+ }
+
+ @Override
+ public Date read(JsonReader in) throws IOException {
+ try {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String date = in.nextString();
+ try {
+ if (dateFormat != null) {
+ return dateFormat.parse(date);
+ }
+ return ISO8601Utils.parse(date, new ParsePosition(0));
+ } catch (ParseException e) {
+ throw new JsonParseException(e);
+ }
+ }
+ } catch (IllegalArgumentException e) {
+ throw new JsonParseException(e);
+ }
+ }
+ }
+
+ public JSON setDateFormat(DateFormat dateFormat) {
+ dateTypeAdapter.setFormat(dateFormat);
+ return this;
+ }
+
+ public JSON setSqlDateFormat(DateFormat dateFormat) {
+ sqlDateTypeAdapter.setFormat(dateFormat);
+ return this;
+ }
+
+}
diff --git a/src/io/swagger/client/Pair.java b/src/io/swagger/client/Pair.java
new file mode 100644
index 0000000..aa92d39
--- /dev/null
+++ b/src/io/swagger/client/Pair.java
@@ -0,0 +1,52 @@
+/*
+ * API
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
+ *
+ * OpenAPI spec version: 1.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+
+package io.swagger.client;
+
+@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-01-03T14:15:42.766Z")
+public class Pair {
+ private String name = "";
+ private String value = "";
+
+ public Pair (String name, String value) {
+ setName(name);
+ setValue(value);
+ }
+
+ private void setName(String name) {
+ if (!isValidString(name)) return;
+
+ this.name = name;
+ }
+
+ private void setValue(String value) {
+ if (!isValidString(value)) return;
+
+ this.value = value;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+
+ private boolean isValidString(String arg) {
+ if (arg == null) return false;
+ if (arg.trim().isEmpty()) return false;
+
+ return true;
+ }
+}
diff --git a/src/io/swagger/client/ProgressRequestBody.java b/src/io/swagger/client/ProgressRequestBody.java
new file mode 100644
index 0000000..ddb94b9
--- /dev/null
+++ b/src/io/swagger/client/ProgressRequestBody.java
@@ -0,0 +1,77 @@
+/*
+ * API
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
+ *
+ * OpenAPI spec version: 1.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+
+package io.swagger.client;
+
+import com.squareup.okhttp.MediaType;
+import com.squareup.okhttp.RequestBody;
+
+import java.io.IOException;
+
+import okio.Buffer;
+import okio.BufferedSink;
+import okio.ForwardingSink;
+import okio.Okio;
+import okio.Sink;
+
+public class ProgressRequestBody extends RequestBody {
+
+ public interface ProgressRequestListener {
+ void onRequestProgress(long bytesWritten, long contentLength, boolean done);
+ }
+
+ private final RequestBody requestBody;
+
+ private final ProgressRequestListener progressListener;
+
+ public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) {
+ this.requestBody = requestBody;
+ this.progressListener = progressListener;
+ }
+
+ @Override
+ public MediaType contentType() {
+ return requestBody.contentType();
+ }
+
+ @Override
+ public long contentLength() throws IOException {
+ return requestBody.contentLength();
+ }
+
+ @Override
+ public void writeTo(BufferedSink sink) throws IOException {
+ BufferedSink bufferedSink = Okio.buffer(sink(sink));
+ requestBody.writeTo(bufferedSink);
+ bufferedSink.flush();
+ }
+
+ private Sink sink(Sink sink) {
+ return new ForwardingSink(sink) {
+
+ long bytesWritten = 0L;
+ long contentLength = 0L;
+
+ @Override
+ public void write(Buffer source, long byteCount) throws IOException {
+ super.write(source, byteCount);
+ if (contentLength == 0) {
+ contentLength = contentLength();
+ }
+
+ bytesWritten += byteCount;
+ progressListener.onRequestProgress(bytesWritten, contentLength, bytesWritten == contentLength);
+ }
+ };
+ }
+}
diff --git a/src/io/swagger/client/ProgressResponseBody.java b/src/io/swagger/client/ProgressResponseBody.java
new file mode 100644
index 0000000..738a2b3
--- /dev/null
+++ b/src/io/swagger/client/ProgressResponseBody.java
@@ -0,0 +1,76 @@
+/*
+ * API
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
+ *
+ * OpenAPI spec version: 1.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+
+package io.swagger.client;
+
+import com.squareup.okhttp.MediaType;
+import com.squareup.okhttp.ResponseBody;
+
+import java.io.IOException;
+
+import okio.Buffer;
+import okio.BufferedSource;
+import okio.ForwardingSource;
+import okio.Okio;
+import okio.Source;
+
+public class ProgressResponseBody extends ResponseBody {
+
+ public interface ProgressListener {
+ void update(long bytesRead, long contentLength, boolean done);
+ }
+
+ private final ResponseBody responseBody;
+ private final ProgressListener progressListener;
+ private BufferedSource bufferedSource;
+
+ public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) {
+ this.responseBody = responseBody;
+ this.progressListener = progressListener;
+ }
+
+ @Override
+ public MediaType contentType() {
+ return responseBody.contentType();
+ }
+
+ @Override
+ public long contentLength() throws IOException {
+ return responseBody.contentLength();
+ }
+
+ @Override
+ public BufferedSource source() throws IOException {
+ if (bufferedSource == null) {
+ bufferedSource = Okio.buffer(source(responseBody.source()));
+ }
+ return bufferedSource;
+ }
+
+ private Source source(Source source) {
+ return new ForwardingSource(source) {
+ long totalBytesRead = 0L;
+
+ @Override
+ public long read(Buffer sink, long byteCount) throws IOException {
+ long bytesRead = super.read(sink, byteCount);
+ // read() returns the number of bytes read, or -1 if this source is exhausted.
+ totalBytesRead += bytesRead != -1 ? bytesRead : 0;
+ progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
+ return bytesRead;
+ }
+ };
+ }
+}
+
+
diff --git a/src/io/swagger/client/StringUtil.java b/src/io/swagger/client/StringUtil.java
new file mode 100644
index 0000000..c71e533
--- /dev/null
+++ b/src/io/swagger/client/StringUtil.java
@@ -0,0 +1,55 @@
+/*
+ * API
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
+ *
+ * OpenAPI spec version: 1.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+
+package io.swagger.client;
+
+@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-01-03T14:15:42.766Z")
+public class StringUtil {
+ /**
+ * Check if the given array contains the given value (with case-insensitive comparison).
+ *
+ * @param array The array
+ * @param value The value to search
+ * @return true if the array contains the value
+ */
+ public static boolean containsIgnoreCase(String[] array, String value) {
+ for (String str : array) {
+ if (value == null && str == null) return true;
+ if (value != null && value.equalsIgnoreCase(str)) return true;
+ }
+ return false;
+ }
+
+ /**
+ * Join an array of strings with the given separator.
+ *
+ * Note: This might be replaced by utility method from commons-lang or guava someday
+ * if one of those libraries is added as dependency.
+ *
+ *
+ * @param array The array of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(String[] array, String separator) {
+ int len = array.length;
+ if (len == 0) return "";
+
+ StringBuilder out = new StringBuilder();
+ out.append(array[0]);
+ for (int i = 1; i < len; i++) {
+ out.append(separator).append(array[i]);
+ }
+ return out.toString();
+ }
+}
diff --git a/src/io/swagger/client/api/DefaultApi.java b/src/io/swagger/client/api/DefaultApi.java
new file mode 100644
index 0000000..6277aad
--- /dev/null
+++ b/src/io/swagger/client/api/DefaultApi.java
@@ -0,0 +1,1920 @@
+/*
+ * API
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
+ *
+ * OpenAPI spec version: 1.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+
+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.Bucket;
+import io.swagger.client.model.CreateBucket;
+import io.swagger.client.model.Event;
+import io.swagger.client.model.Export;
+import io.swagger.client.model.Info;
+import io.swagger.client.model.Query;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class DefaultApi {
+ private ApiClient apiClient;
+
+ public DefaultApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public DefaultApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Build call for deleteBucketResource
+ * @param bucketId (required)
+ * @param force Needs to be =1 to delete a bucket it non-testing mode (optional)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call deleteBucketResourceCall(String bucketId, String force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/0/buckets/{bucket_id}"
+ .replaceAll("\\{" + "bucket_id" + "\\}", apiClient.escapeString(bucketId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (force != null)
+ localVarQueryParams.addAll(apiClient.parameterToPair("force", force));
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call deleteBucketResourceValidateBeforeCall(String bucketId, String force, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'bucketId' is set
+ if (bucketId == null) {
+ throw new ApiException("Missing the required parameter 'bucketId' when calling deleteBucketResource(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = deleteBucketResourceCall(bucketId, force, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Delete a bucket
+ *
+ * @param bucketId (required)
+ * @param force Needs to be =1 to delete a bucket it non-testing mode (optional)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void deleteBucketResource(String bucketId, String force) throws ApiException {
+ deleteBucketResourceWithHttpInfo(bucketId, force);
+ }
+
+ /**
+ * Delete a bucket
+ *
+ * @param bucketId (required)
+ * @param force Needs to be =1 to delete a bucket it non-testing mode (optional)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse deleteBucketResourceWithHttpInfo(String bucketId, String force) throws ApiException {
+ com.squareup.okhttp.Call call = deleteBucketResourceValidateBeforeCall(bucketId, force, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Delete a bucket (asynchronously)
+ *
+ * @param bucketId (required)
+ * @param force Needs to be =1 to delete a bucket it non-testing mode (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
+ */
+ public com.squareup.okhttp.Call deleteBucketResourceAsync(String bucketId, String force, 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 = deleteBucketResourceValidateBeforeCall(bucketId, force, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /**
+ * Build call for deleteEventResource
+ * @param bucketId (required)
+ * @param eventId (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call deleteEventResourceCall(String bucketId, String eventId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/0/buckets/{bucket_id}/events/{event_id}"
+ .replaceAll("\\{" + "bucket_id" + "\\}", apiClient.escapeString(bucketId.toString()))
+ .replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call deleteEventResourceValidateBeforeCall(String bucketId, String eventId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'bucketId' is set
+ if (bucketId == null) {
+ throw new ApiException("Missing the required parameter 'bucketId' when calling deleteEventResource(Async)");
+ }
+
+ // verify the required parameter 'eventId' is set
+ if (eventId == null) {
+ throw new ApiException("Missing the required parameter 'eventId' when calling deleteEventResource(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = deleteEventResourceCall(bucketId, eventId, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Delete a single event from a bucket
+ *
+ * @param bucketId (required)
+ * @param eventId (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void deleteEventResource(String bucketId, String eventId) throws ApiException {
+ deleteEventResourceWithHttpInfo(bucketId, eventId);
+ }
+
+ /**
+ * Delete a single event from a bucket
+ *
+ * @param bucketId (required)
+ * @param eventId (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse deleteEventResourceWithHttpInfo(String bucketId, String eventId) throws ApiException {
+ com.squareup.okhttp.Call call = deleteEventResourceValidateBeforeCall(bucketId, eventId, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Delete a single event from a bucket (asynchronously)
+ *
+ * @param bucketId (required)
+ * @param eventId (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
+ */
+ public com.squareup.okhttp.Call deleteEventResourceAsync(String bucketId, String eventId, 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 = deleteEventResourceValidateBeforeCall(bucketId, eventId, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /**
+ * Build call for getBucketExportResource
+ * @param bucketId (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call getBucketExportResourceCall(String bucketId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/0/buckets/{bucket_id}/export"
+ .replaceAll("\\{" + "bucket_id" + "\\}", apiClient.escapeString(bucketId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call getBucketExportResourceValidateBeforeCall(String bucketId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'bucketId' is set
+ if (bucketId == null) {
+ throw new ApiException("Missing the required parameter 'bucketId' when calling getBucketExportResource(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = getBucketExportResourceCall(bucketId, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Export a bucket to a dataformat consistent across versions, including all events in it
+ *
+ * @param bucketId (required)
+ * @return Export
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public Export getBucketExportResource(String bucketId) throws ApiException {
+ ApiResponse resp = getBucketExportResourceWithHttpInfo(bucketId);
+ return resp.getData();
+ }
+
+ /**
+ * Export a bucket to a dataformat consistent across versions, including all events in it
+ *
+ * @param bucketId (required)
+ * @return ApiResponse<Export>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getBucketExportResourceWithHttpInfo(String bucketId) throws ApiException {
+ com.squareup.okhttp.Call call = getBucketExportResourceValidateBeforeCall(bucketId, null, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Export a bucket to a dataformat consistent across versions, including all events in it (asynchronously)
+ *
+ * @param bucketId (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
+ */
+ public com.squareup.okhttp.Call getBucketExportResourceAsync(String bucketId, 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 = getBucketExportResourceValidateBeforeCall(bucketId, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+ /**
+ * Build call for getBucketResource
+ * @param bucketId (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call getBucketResourceCall(String bucketId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/0/buckets/{bucket_id}"
+ .replaceAll("\\{" + "bucket_id" + "\\}", apiClient.escapeString(bucketId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call getBucketResourceValidateBeforeCall(String bucketId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'bucketId' is set
+ if (bucketId == null) {
+ throw new ApiException("Missing the required parameter 'bucketId' when calling getBucketResource(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = getBucketResourceCall(bucketId, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get metadata about bucket
+ *
+ * @param bucketId (required)
+ * @return Bucket
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public Bucket getBucketResource(String bucketId) throws ApiException {
+ ApiResponse resp = getBucketResourceWithHttpInfo(bucketId);
+ return resp.getData();
+ }
+
+ /**
+ * Get metadata about bucket
+ *
+ * @param bucketId (required)
+ * @return ApiResponse<Bucket>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getBucketResourceWithHttpInfo(String bucketId) throws ApiException {
+ com.squareup.okhttp.Call call = getBucketResourceValidateBeforeCall(bucketId, null, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get metadata about bucket (asynchronously)
+ *
+ * @param bucketId (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
+ */
+ public com.squareup.okhttp.Call getBucketResourceAsync(String bucketId, 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 = getBucketResourceValidateBeforeCall(bucketId, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+ /**
+ * Build call for getBucketsResource
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call getBucketsResourceCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/0/buckets/";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call getBucketsResourceValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+
+ com.squareup.okhttp.Call call = getBucketsResourceCall(progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get dict {bucket_name: Bucket} of all buckets
+ *
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void getBucketsResource() throws ApiException {
+ getBucketsResourceWithHttpInfo();
+ }
+
+ /**
+ * Get dict {bucket_name: Bucket} of all buckets
+ *
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getBucketsResourceWithHttpInfo() throws ApiException {
+ com.squareup.okhttp.Call call = getBucketsResourceValidateBeforeCall(null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Get dict {bucket_name: Bucket} of all buckets (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
+ */
+ public com.squareup.okhttp.Call getBucketsResourceAsync(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 = getBucketsResourceValidateBeforeCall(progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /**
+ * Build call for getEventCountResource
+ * @param bucketId (required)
+ * @param end End date of eventcount (optional)
+ * @param start Start date of eventcount (optional)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call getEventCountResourceCall(String bucketId, String end, String start, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/0/buckets/{bucket_id}/events/count"
+ .replaceAll("\\{" + "bucket_id" + "\\}", apiClient.escapeString(bucketId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (end != null)
+ localVarQueryParams.addAll(apiClient.parameterToPair("end", end));
+ if (start != null)
+ localVarQueryParams.addAll(apiClient.parameterToPair("start", start));
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call getEventCountResourceValidateBeforeCall(String bucketId, String end, String start, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'bucketId' is set
+ if (bucketId == null) {
+ throw new ApiException("Missing the required parameter 'bucketId' when calling getEventCountResource(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = getEventCountResourceCall(bucketId, end, start, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get eventcount from a bucket
+ *
+ * @param bucketId (required)
+ * @param end End date of eventcount (optional)
+ * @param start Start date of eventcount (optional)
+ * @return Integer
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public Integer getEventCountResource(String bucketId, String end, String start) throws ApiException {
+ ApiResponse resp = getEventCountResourceWithHttpInfo(bucketId, end, start);
+ return resp.getData();
+ }
+
+ /**
+ * Get eventcount from a bucket
+ *
+ * @param bucketId (required)
+ * @param end End date of eventcount (optional)
+ * @param start Start date of eventcount (optional)
+ * @return ApiResponse<Integer>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getEventCountResourceWithHttpInfo(String bucketId, String end, String start) throws ApiException {
+ com.squareup.okhttp.Call call = getEventCountResourceValidateBeforeCall(bucketId, end, start, null, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get eventcount from a bucket (asynchronously)
+ *
+ * @param bucketId (required)
+ * @param end End date of eventcount (optional)
+ * @param start Start date of eventcount (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
+ */
+ public com.squareup.okhttp.Call getEventCountResourceAsync(String bucketId, String end, String start, 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 = getEventCountResourceValidateBeforeCall(bucketId, end, start, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+ /**
+ * Build call for getEventsResource
+ * @param bucketId (required)
+ * @param end End date of events (optional)
+ * @param start Start date of events (optional)
+ * @param limit the maximum number of requests to get (optional)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call getEventsResourceCall(String bucketId, String end, String start, String limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/0/buckets/{bucket_id}/events"
+ .replaceAll("\\{" + "bucket_id" + "\\}", apiClient.escapeString(bucketId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (end != null)
+ localVarQueryParams.addAll(apiClient.parameterToPair("end", end));
+ if (start != null)
+ localVarQueryParams.addAll(apiClient.parameterToPair("start", start));
+ if (limit != null)
+ localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call getEventsResourceValidateBeforeCall(String bucketId, String end, String start, String limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'bucketId' is set
+ if (bucketId == null) {
+ throw new ApiException("Missing the required parameter 'bucketId' when calling getEventsResource(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = getEventsResourceCall(bucketId, end, start, limit, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get events from a bucket
+ *
+ * @param bucketId (required)
+ * @param end End date of events (optional)
+ * @param start Start date of events (optional)
+ * @param limit the maximum number of requests to get (optional)
+ * @return Event
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public Event getEventsResource(String bucketId, String end, String start, String limit) throws ApiException {
+ ApiResponse resp = getEventsResourceWithHttpInfo(bucketId, end, start, limit);
+ return resp.getData();
+ }
+
+ /**
+ * Get events from a bucket
+ *
+ * @param bucketId (required)
+ * @param end End date of events (optional)
+ * @param start Start date of events (optional)
+ * @param limit the maximum number of requests to get (optional)
+ * @return ApiResponse<Event>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getEventsResourceWithHttpInfo(String bucketId, String end, String start, String limit) throws ApiException {
+ com.squareup.okhttp.Call call = getEventsResourceValidateBeforeCall(bucketId, end, start, limit, null, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get events from a bucket (asynchronously)
+ *
+ * @param bucketId (required)
+ * @param end End date of events (optional)
+ * @param start Start date of events (optional)
+ * @param limit the maximum number of requests to get (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
+ */
+ public com.squareup.okhttp.Call getEventsResourceAsync(String bucketId, String end, String start, String limit, 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 = getEventsResourceValidateBeforeCall(bucketId, end, start, limit, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+ /**
+ * Build call for getExportAllResource
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call getExportAllResourceCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/0/export";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call getExportAllResourceValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+
+ com.squareup.okhttp.Call call = getExportAllResourceCall(progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Exports all buckets and their events to a format consistent across versions
+ *
+ * @return Export
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public Export getExportAllResource() throws ApiException {
+ ApiResponse resp = getExportAllResourceWithHttpInfo();
+ return resp.getData();
+ }
+
+ /**
+ * Exports all buckets and their events to a format consistent across versions
+ *
+ * @return ApiResponse<Export>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getExportAllResourceWithHttpInfo() throws ApiException {
+ com.squareup.okhttp.Call call = getExportAllResourceValidateBeforeCall(null, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Exports all buckets and their events to a format consistent across versions (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
+ */
+ public com.squareup.okhttp.Call getExportAllResourceAsync(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 = getExportAllResourceValidateBeforeCall(progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+ /**
+ * Build call for getInfoResource
+ * @param xFields An optional fields mask (optional)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call getInfoResourceCall(String xFields, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/0/info";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+ if (xFields != null)
+ localVarHeaderParams.put("X-Fields", apiClient.parameterToString(xFields));
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call getInfoResourceValidateBeforeCall(String xFields, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+
+ com.squareup.okhttp.Call call = getInfoResourceCall(xFields, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get server info
+ *
+ * @param xFields An optional fields mask (optional)
+ * @return Info
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public Info getInfoResource(String xFields) throws ApiException {
+ ApiResponse resp = getInfoResourceWithHttpInfo(xFields);
+ return resp.getData();
+ }
+
+ /**
+ * Get server info
+ *
+ * @param xFields An optional fields mask (optional)
+ * @return ApiResponse<Info>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getInfoResourceWithHttpInfo(String xFields) throws ApiException {
+ com.squareup.okhttp.Call call = getInfoResourceValidateBeforeCall(xFields, null, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return apiClient.execute(call, localVarReturnType);
+ }
+
+ /**
+ * Get server info (asynchronously)
+ *
+ * @param xFields An optional fields mask (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
+ */
+ public com.squareup.okhttp.Call getInfoResourceAsync(String xFields, 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 = getInfoResourceValidateBeforeCall(xFields, progressListener, progressRequestListener);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ apiClient.executeAsync(call, localVarReturnType, callback);
+ return call;
+ }
+ /**
+ * Build call for getLogResource
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call getLogResourceCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/0/log";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call getLogResourceValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+
+ com.squareup.okhttp.Call call = getLogResourceCall(progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Get the server log in json format
+ *
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void getLogResource() throws ApiException {
+ getLogResourceWithHttpInfo();
+ }
+
+ /**
+ * Get the server log in json format
+ *
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getLogResourceWithHttpInfo() throws ApiException {
+ com.squareup.okhttp.Call call = getLogResourceValidateBeforeCall(null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Get the server log in json format (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
+ */
+ public com.squareup.okhttp.Call getLogResourceAsync(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 = getLogResourceValidateBeforeCall(progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /**
+ * Build call for postBucketResource
+ * @param bucketId (required)
+ * @param payload (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call postBucketResourceCall(String bucketId, CreateBucket payload, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = payload;
+
+ // create path and map variables
+ String localVarPath = "/0/buckets/{bucket_id}"
+ .replaceAll("\\{" + "bucket_id" + "\\}", apiClient.escapeString(bucketId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call postBucketResourceValidateBeforeCall(String bucketId, CreateBucket payload, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'bucketId' is set
+ if (bucketId == null) {
+ throw new ApiException("Missing the required parameter 'bucketId' when calling postBucketResource(Async)");
+ }
+
+ // verify the required parameter 'payload' is set
+ if (payload == null) {
+ throw new ApiException("Missing the required parameter 'payload' when calling postBucketResource(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = postBucketResourceCall(bucketId, payload, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Create bucket
+ * Returns True if successful, otherwise false if a bucket with the given ID already existed.
+ * @param bucketId (required)
+ * @param payload (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void postBucketResource(String bucketId, CreateBucket payload) throws ApiException {
+ postBucketResourceWithHttpInfo(bucketId, payload);
+ }
+
+ /**
+ * Create bucket
+ * Returns True if successful, otherwise false if a bucket with the given ID already existed.
+ * @param bucketId (required)
+ * @param payload (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse postBucketResourceWithHttpInfo(String bucketId, CreateBucket payload) throws ApiException {
+ com.squareup.okhttp.Call call = postBucketResourceValidateBeforeCall(bucketId, payload, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Create bucket (asynchronously)
+ * Returns True if successful, otherwise false if a bucket with the given ID already existed.
+ * @param bucketId (required)
+ * @param payload (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
+ */
+ public com.squareup.okhttp.Call postBucketResourceAsync(String bucketId, CreateBucket payload, 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 = postBucketResourceValidateBeforeCall(bucketId, payload, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /**
+ * Build call for postEventsResource
+ * @param bucketId (required)
+ * @param payload (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call postEventsResourceCall(String bucketId, Event payload, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = payload;
+
+ // create path and map variables
+ String localVarPath = "/0/buckets/{bucket_id}/events"
+ .replaceAll("\\{" + "bucket_id" + "\\}", apiClient.escapeString(bucketId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call postEventsResourceValidateBeforeCall(String bucketId, Event payload, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'bucketId' is set
+ if (bucketId == null) {
+ throw new ApiException("Missing the required parameter 'bucketId' when calling postEventsResource(Async)");
+ }
+
+ // verify the required parameter 'payload' is set
+ if (payload == null) {
+ throw new ApiException("Missing the required parameter 'payload' when calling postEventsResource(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = postEventsResourceCall(bucketId, payload, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Create events for a bucket
+ * Can handle both single events and multiple ones. Returns the inserted event when a single event was inserted, otherwise None.
+ * @param bucketId (required)
+ * @param payload (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void postEventsResource(String bucketId, Event payload) throws ApiException {
+ postEventsResourceWithHttpInfo(bucketId, payload);
+ }
+
+ /**
+ * Create events for a bucket
+ * Can handle both single events and multiple ones. Returns the inserted event when a single event was inserted, otherwise None.
+ * @param bucketId (required)
+ * @param payload (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse postEventsResourceWithHttpInfo(String bucketId, Event payload) throws ApiException {
+ com.squareup.okhttp.Call call = postEventsResourceValidateBeforeCall(bucketId, payload, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Create events for a bucket (asynchronously)
+ * Can handle both single events and multiple ones. Returns the inserted event when a single event was inserted, otherwise None.
+ * @param bucketId (required)
+ * @param payload (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
+ */
+ public com.squareup.okhttp.Call postEventsResourceAsync(String bucketId, Event payload, 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 = postEventsResourceValidateBeforeCall(bucketId, payload, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /**
+ * Build call for postHeartbeatResource
+ * @param bucketId (required)
+ * @param payload (required)
+ * @param pulsetime Largest timewindow allowed between heartbeats for them to merge (optional)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call postHeartbeatResourceCall(String bucketId, Event payload, String pulsetime, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = payload;
+
+ // create path and map variables
+ String localVarPath = "/0/buckets/{bucket_id}/heartbeat"
+ .replaceAll("\\{" + "bucket_id" + "\\}", apiClient.escapeString(bucketId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (pulsetime != null)
+ localVarQueryParams.addAll(apiClient.parameterToPair("pulsetime", pulsetime));
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call postHeartbeatResourceValidateBeforeCall(String bucketId, Event payload, String pulsetime, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'bucketId' is set
+ if (bucketId == null) {
+ throw new ApiException("Missing the required parameter 'bucketId' when calling postHeartbeatResource(Async)");
+ }
+
+ // verify the required parameter 'payload' is set
+ if (payload == null) {
+ throw new ApiException("Missing the required parameter 'payload' when calling postHeartbeatResource(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = postHeartbeatResourceCall(bucketId, payload, pulsetime, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ * Heartbeats are useful when implementing watchers that simply keep
+ * track of a state, how long it's in that state and when it changes. A single heartbeat always has a duration of zero. If the heartbeat was identical to the last (apart from timestamp), then the last event has its duration updated. If the heartbeat differed, then a new event is created. Such as: - Active application and window title - Example: aw-watcher-window - Currently open document/browser tab/playing song - Example: wakatime - Example: aw-watcher-web - Example: aw-watcher-spotify - Is the user active/inactive? Send an event on some interval indicating if the user is active or not. - Example: aw-watcher-afk Inspired by: https://wakatime.com/developers#heartbeats
+ * @param bucketId (required)
+ * @param payload (required)
+ * @param pulsetime Largest timewindow allowed between heartbeats for them to merge (optional)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void postHeartbeatResource(String bucketId, Event payload, String pulsetime) throws ApiException {
+ postHeartbeatResourceWithHttpInfo(bucketId, payload, pulsetime);
+ }
+
+ /**
+ * Heartbeats are useful when implementing watchers that simply keep
+ * track of a state, how long it's in that state and when it changes. A single heartbeat always has a duration of zero. If the heartbeat was identical to the last (apart from timestamp), then the last event has its duration updated. If the heartbeat differed, then a new event is created. Such as: - Active application and window title - Example: aw-watcher-window - Currently open document/browser tab/playing song - Example: wakatime - Example: aw-watcher-web - Example: aw-watcher-spotify - Is the user active/inactive? Send an event on some interval indicating if the user is active or not. - Example: aw-watcher-afk Inspired by: https://wakatime.com/developers#heartbeats
+ * @param bucketId (required)
+ * @param payload (required)
+ * @param pulsetime Largest timewindow allowed between heartbeats for them to merge (optional)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse postHeartbeatResourceWithHttpInfo(String bucketId, Event payload, String pulsetime) throws ApiException {
+ com.squareup.okhttp.Call call = postHeartbeatResourceValidateBeforeCall(bucketId, payload, pulsetime, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * Heartbeats are useful when implementing watchers that simply keep (asynchronously)
+ * track of a state, how long it's in that state and when it changes. A single heartbeat always has a duration of zero. If the heartbeat was identical to the last (apart from timestamp), then the last event has its duration updated. If the heartbeat differed, then a new event is created. Such as: - Active application and window title - Example: aw-watcher-window - Currently open document/browser tab/playing song - Example: wakatime - Example: aw-watcher-web - Example: aw-watcher-spotify - Is the user active/inactive? Send an event on some interval indicating if the user is active or not. - Example: aw-watcher-afk Inspired by: https://wakatime.com/developers#heartbeats
+ * @param bucketId (required)
+ * @param payload (required)
+ * @param pulsetime Largest timewindow allowed between heartbeats for them to merge (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
+ */
+ public com.squareup.okhttp.Call postHeartbeatResourceAsync(String bucketId, Event payload, String pulsetime, 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 = postHeartbeatResourceValidateBeforeCall(bucketId, payload, pulsetime, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /**
+ * Build call for postImportAllResource
+ * @param payload (required)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call postImportAllResourceCall(Export payload, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = payload;
+
+ // create path and map variables
+ String localVarPath = "/0/import";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call postImportAllResourceValidateBeforeCall(Export payload, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'payload' is set
+ if (payload == null) {
+ throw new ApiException("Missing the required parameter 'payload' when calling postImportAllResource(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = postImportAllResourceCall(payload, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ *
+ *
+ * @param payload (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void postImportAllResource(Export payload) throws ApiException {
+ postImportAllResourceWithHttpInfo(payload);
+ }
+
+ /**
+ *
+ *
+ * @param payload (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse postImportAllResourceWithHttpInfo(Export payload) throws ApiException {
+ com.squareup.okhttp.Call call = postImportAllResourceValidateBeforeCall(payload, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * (asynchronously)
+ *
+ * @param payload (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
+ */
+ public com.squareup.okhttp.Call postImportAllResourceAsync(Export payload, 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 = postImportAllResourceValidateBeforeCall(payload, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+ /**
+ * Build call for postQueryResource
+ * @param payload (required)
+ * @param name Name of the query (required if using cache) (optional)
+ * @param progressListener Progress listener
+ * @param progressRequestListener Progress request listener
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call postQueryResourceCall(Query payload, String name, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+ Object localVarPostBody = payload;
+
+ // create path and map variables
+ String localVarPath = "/0/query/";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ if (name != null)
+ localVarQueryParams.addAll(apiClient.parameterToPair("name", name));
+
+ Map localVarHeaderParams = new HashMap();
+
+ 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 = {
+ "application/json"
+ };
+ 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[] { };
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private com.squareup.okhttp.Call postQueryResourceValidateBeforeCall(Query payload, String name, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
+
+ // verify the required parameter 'payload' is set
+ if (payload == null) {
+ throw new ApiException("Missing the required parameter 'payload' when calling postQueryResource(Async)");
+ }
+
+
+ com.squareup.okhttp.Call call = postQueryResourceCall(payload, name, progressListener, progressRequestListener);
+ return call;
+
+ }
+
+ /**
+ *
+ *
+ * @param payload (required)
+ * @param name Name of the query (required if using cache) (optional)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public void postQueryResource(Query payload, String name) throws ApiException {
+ postQueryResourceWithHttpInfo(payload, name);
+ }
+
+ /**
+ *
+ *
+ * @param payload (required)
+ * @param name Name of the query (required if using cache) (optional)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse postQueryResourceWithHttpInfo(Query payload, String name) throws ApiException {
+ com.squareup.okhttp.Call call = postQueryResourceValidateBeforeCall(payload, name, null, null);
+ return apiClient.execute(call);
+ }
+
+ /**
+ * (asynchronously)
+ *
+ * @param payload (required)
+ * @param name Name of the query (required if using cache) (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
+ */
+ public com.squareup.okhttp.Call postQueryResourceAsync(Query payload, String name, 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 = postQueryResourceValidateBeforeCall(payload, name, progressListener, progressRequestListener);
+ apiClient.executeAsync(call, callback);
+ return call;
+ }
+}
diff --git a/src/io/swagger/client/auth/ApiKeyAuth.java b/src/io/swagger/client/auth/ApiKeyAuth.java
new file mode 100644
index 0000000..2c7711c
--- /dev/null
+++ b/src/io/swagger/client/auth/ApiKeyAuth.java
@@ -0,0 +1,75 @@
+/*
+ * API
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
+ *
+ * OpenAPI spec version: 1.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+
+package io.swagger.client.auth;
+
+import io.swagger.client.Pair;
+
+import java.util.Map;
+import java.util.List;
+
+@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-01-03T14:15:42.766Z")
+public class ApiKeyAuth implements Authentication {
+ private final String location;
+ private final String paramName;
+
+ private String apiKey;
+ private String apiKeyPrefix;
+
+ public ApiKeyAuth(String location, String paramName) {
+ this.location = location;
+ this.paramName = paramName;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getParamName() {
+ return paramName;
+ }
+
+ public String getApiKey() {
+ return apiKey;
+ }
+
+ public void setApiKey(String apiKey) {
+ this.apiKey = apiKey;
+ }
+
+ public String getApiKeyPrefix() {
+ return apiKeyPrefix;
+ }
+
+ public void setApiKeyPrefix(String apiKeyPrefix) {
+ this.apiKeyPrefix = apiKeyPrefix;
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map