Skip to content

Commit 1fd85ef

Browse files
authored
Merge pull request #15 from sematext/develop
Develop
2 parents 83375bb + 5778f44 commit 1fd85ef

File tree

3 files changed

+127
-2
lines changed

3 files changed

+127
-2
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'idea'
22
apply plugin: 'eclipse'
33

44
group = 'com.sematext'
5-
version = '0.1.1'
5+
version = '0.1.2'
66

77
buildscript {
88
repositories {

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>SematextCloudClient</artifactId>
66
<packaging>jar</packaging>
77
<name>SematextCloudClient</name>
8-
<version>0.1.1</version>
8+
<version>0.1.2</version>
99
<url>https://github.com/sematext/sematext-api-client-java</url>
1010
<description>Client for Sematext Cloud API at https://sematext.com/docs/api/</description>
1111

src/main/java/com/sematext/cloud/client/AppsApi.java

+125
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,131 @@ public void setApiClient(ApiClient apiClient) {
5757
this.apiClient = apiClient;
5858
}
5959

60+
61+
/**
62+
* Build call for deleteUsingDELETE
63+
* @param anyStateAppId anyStateAppId (required)
64+
* @param progressListener Progress listener
65+
* @param progressRequestListener Progress request listener
66+
* @return Call to execute
67+
* @throws ApiException If fail to serialize the request body object
68+
*/
69+
public com.squareup.okhttp.Call deleteUsingDELETECall(Long anyStateAppId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
70+
Object localVarPostBody = null;
71+
72+
// create path and map variables
73+
String localVarPath = "/users-web/api/v3/apps/{anyStateAppId}"
74+
.replaceAll("\\{" + "anyStateAppId" + "\\}", apiClient.escapeString(anyStateAppId.toString()));
75+
76+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
77+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
78+
79+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
80+
81+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
82+
83+
final String[] localVarAccepts = {
84+
"application/json"
85+
};
86+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
87+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
88+
89+
final String[] localVarContentTypes = {
90+
"application/json"
91+
};
92+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
93+
localVarHeaderParams.put("Content-Type", localVarContentType);
94+
95+
if(progressListener != null) {
96+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
97+
@Override
98+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
99+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
100+
return originalResponse.newBuilder()
101+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
102+
.build();
103+
}
104+
});
105+
}
106+
107+
String[] localVarAuthNames = new String[] { "api_key" };
108+
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
109+
}
110+
111+
@SuppressWarnings("rawtypes")
112+
private com.squareup.okhttp.Call deleteUsingDELETEValidateBeforeCall(Long anyStateAppId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
113+
114+
// verify the required parameter 'anyStateAppId' is set
115+
if (anyStateAppId == null) {
116+
throw new ApiException("Missing the required parameter 'anyStateAppId' when calling deleteUsingDELETE(Async)");
117+
}
118+
119+
120+
com.squareup.okhttp.Call call = deleteUsingDELETECall(anyStateAppId, progressListener, progressRequestListener);
121+
return call;
122+
123+
}
124+
125+
/**
126+
* delete
127+
*
128+
* @param anyStateAppId anyStateAppId (required)
129+
* @return GenericApiResponse
130+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
131+
*/
132+
public GenericApiResponse deleteUsingDELETE(Long anyStateAppId) throws ApiException {
133+
ApiResponse<GenericApiResponse> resp = deleteUsingDELETEWithHttpInfo(anyStateAppId);
134+
return resp.getData();
135+
}
136+
137+
/**
138+
* delete
139+
*
140+
* @param anyStateAppId anyStateAppId (required)
141+
* @return ApiResponse&lt;GenericApiResponse&gt;
142+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
143+
*/
144+
public ApiResponse<GenericApiResponse> deleteUsingDELETEWithHttpInfo(Long anyStateAppId) throws ApiException {
145+
com.squareup.okhttp.Call call = deleteUsingDELETEValidateBeforeCall(anyStateAppId, null, null);
146+
Type localVarReturnType = new TypeToken<GenericApiResponse>(){}.getType();
147+
return apiClient.execute(call, localVarReturnType);
148+
}
149+
150+
/**
151+
* delete (asynchronously)
152+
*
153+
* @param anyStateAppId anyStateAppId (required)
154+
* @param callback The callback to be executed when the API call finishes
155+
* @return The request call
156+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
157+
*/
158+
public com.squareup.okhttp.Call deleteUsingDELETEAsync(Long anyStateAppId, final ApiCallback<GenericApiResponse> callback) throws ApiException {
159+
160+
ProgressResponseBody.ProgressListener progressListener = null;
161+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
162+
163+
if (callback != null) {
164+
progressListener = new ProgressResponseBody.ProgressListener() {
165+
@Override
166+
public void update(long bytesRead, long contentLength, boolean done) {
167+
callback.onDownloadProgress(bytesRead, contentLength, done);
168+
}
169+
};
170+
171+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
172+
@Override
173+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
174+
callback.onUploadProgress(bytesWritten, contentLength, done);
175+
}
176+
};
177+
}
178+
179+
com.squareup.okhttp.Call call = deleteUsingDELETEValidateBeforeCall(anyStateAppId, progressListener, progressRequestListener);
180+
Type localVarReturnType = new TypeToken<GenericApiResponse>(){}.getType();
181+
apiClient.executeAsync(call, localVarReturnType, callback);
182+
return call;
183+
}
184+
60185
/**
61186
* Build call for getAppTypesUsingGET
62187
* @param progressListener Progress listener

0 commit comments

Comments
 (0)