Skip to content

Commit

Permalink
Merge pull request #15 from sematext/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
hollerloudly authored Sep 30, 2020
2 parents 83375bb + 5778f44 commit 1fd85ef
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'idea'
apply plugin: 'eclipse'

group = 'com.sematext'
version = '0.1.1'
version = '0.1.2'

buildscript {
repositories {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>SematextCloudClient</artifactId>
<packaging>jar</packaging>
<name>SematextCloudClient</name>
<version>0.1.1</version>
<version>0.1.2</version>
<url>https://github.com/sematext/sematext-api-client-java</url>
<description>Client for Sematext Cloud API at https://sematext.com/docs/api/</description>

Expand Down
125 changes: 125 additions & 0 deletions src/main/java/com/sematext/cloud/client/AppsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,131 @@ public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}


/**
* Build call for deleteUsingDELETE
* @param anyStateAppId anyStateAppId (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 deleteUsingDELETECall(Long anyStateAppId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;

// create path and map variables
String localVarPath = "/users-web/api/v3/apps/{anyStateAppId}"
.replaceAll("\\{" + "anyStateAppId" + "\\}", apiClient.escapeString(anyStateAppId.toString()));

List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Map<String, Object> localVarFormParams = new HashMap<String, Object>();

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[] { "api_key" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}

@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deleteUsingDELETEValidateBeforeCall(Long anyStateAppId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

// verify the required parameter 'anyStateAppId' is set
if (anyStateAppId == null) {
throw new ApiException("Missing the required parameter 'anyStateAppId' when calling deleteUsingDELETE(Async)");
}


com.squareup.okhttp.Call call = deleteUsingDELETECall(anyStateAppId, progressListener, progressRequestListener);
return call;

}

/**
* delete
*
* @param anyStateAppId anyStateAppId (required)
* @return GenericApiResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public GenericApiResponse deleteUsingDELETE(Long anyStateAppId) throws ApiException {
ApiResponse<GenericApiResponse> resp = deleteUsingDELETEWithHttpInfo(anyStateAppId);
return resp.getData();
}

/**
* delete
*
* @param anyStateAppId anyStateAppId (required)
* @return ApiResponse&lt;GenericApiResponse&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<GenericApiResponse> deleteUsingDELETEWithHttpInfo(Long anyStateAppId) throws ApiException {
com.squareup.okhttp.Call call = deleteUsingDELETEValidateBeforeCall(anyStateAppId, null, null);
Type localVarReturnType = new TypeToken<GenericApiResponse>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}

/**
* delete (asynchronously)
*
* @param anyStateAppId anyStateAppId (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 deleteUsingDELETEAsync(Long anyStateAppId, final ApiCallback<GenericApiResponse> 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 = deleteUsingDELETEValidateBeforeCall(anyStateAppId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<GenericApiResponse>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}

/**
* Build call for getAppTypesUsingGET
* @param progressListener Progress listener
Expand Down

0 comments on commit 1fd85ef

Please sign in to comment.